All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.servicefabricmanagedclusters.models.RuntimeResumeApplicationUpgradeParameters Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Service Fabric Managed Clusters Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Service Fabric Managed Clusters Management Client. Package tag package-2024-04.

There is a newer version: 1.0.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.servicefabricmanagedclusters.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Parameters for Resume Upgrade action. The upgrade domain name must be specified.
 */
@Fluent
public final class RuntimeResumeApplicationUpgradeParameters
    implements JsonSerializable {
    /*
     * The upgrade domain name. Expected to be the next upgrade domain if the application is upgrading.
     */
    private String upgradeDomainName;

    /**
     * Creates an instance of RuntimeResumeApplicationUpgradeParameters class.
     */
    public RuntimeResumeApplicationUpgradeParameters() {
    }

    /**
     * Get the upgradeDomainName property: The upgrade domain name. Expected to be the next upgrade domain if the
     * application is upgrading.
     * 
     * @return the upgradeDomainName value.
     */
    public String upgradeDomainName() {
        return this.upgradeDomainName;
    }

    /**
     * Set the upgradeDomainName property: The upgrade domain name. Expected to be the next upgrade domain if the
     * application is upgrading.
     * 
     * @param upgradeDomainName the upgradeDomainName value to set.
     * @return the RuntimeResumeApplicationUpgradeParameters object itself.
     */
    public RuntimeResumeApplicationUpgradeParameters withUpgradeDomainName(String upgradeDomainName) {
        this.upgradeDomainName = upgradeDomainName;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("upgradeDomainName", this.upgradeDomainName);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of RuntimeResumeApplicationUpgradeParameters from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of RuntimeResumeApplicationUpgradeParameters if the JsonReader was pointing to an instance of
     * it, or null if it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the RuntimeResumeApplicationUpgradeParameters.
     */
    public static RuntimeResumeApplicationUpgradeParameters fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            RuntimeResumeApplicationUpgradeParameters deserializedRuntimeResumeApplicationUpgradeParameters
                = new RuntimeResumeApplicationUpgradeParameters();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("upgradeDomainName".equals(fieldName)) {
                    deserializedRuntimeResumeApplicationUpgradeParameters.upgradeDomainName = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedRuntimeResumeApplicationUpgradeParameters;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy