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

com.azure.resourcemanager.azurestackhci.fluent.models.DeploymentSettingsProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. Package tag package-2024-04.

The 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.azurestackhci.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.azurestackhci.models.DeploymentConfiguration;
import com.azure.resourcemanager.azurestackhci.models.DeploymentMode;
import com.azure.resourcemanager.azurestackhci.models.EceReportedProperties;
import com.azure.resourcemanager.azurestackhci.models.OperationType;
import com.azure.resourcemanager.azurestackhci.models.ProvisioningState;
import java.io.IOException;
import java.util.List;

/**
 * DeploymentSetting properties.
 */
@Fluent
public final class DeploymentSettingsProperties implements JsonSerializable {
    /*
     * DeploymentSetting provisioning state
     */
    private ProvisioningState provisioningState;

    /*
     * Azure resource ids of Arc machines to be part of cluster.
     */
    private List arcNodeResourceIds;

    /*
     * The deployment mode for cluster deployment.
     */
    private DeploymentMode deploymentMode;

    /*
     * The intended operation for a cluster.
     */
    private OperationType operationType;

    /*
     * Scale units will contains list of deployment data
     */
    private DeploymentConfiguration deploymentConfiguration;

    /*
     * Deployment Status reported from cluster.
     */
    private EceReportedProperties reportedProperties;

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

    /**
     * Get the provisioningState property: DeploymentSetting provisioning state.
     * 
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster.
     * 
     * @return the arcNodeResourceIds value.
     */
    public List arcNodeResourceIds() {
        return this.arcNodeResourceIds;
    }

    /**
     * Set the arcNodeResourceIds property: Azure resource ids of Arc machines to be part of cluster.
     * 
     * @param arcNodeResourceIds the arcNodeResourceIds value to set.
     * @return the DeploymentSettingsProperties object itself.
     */
    public DeploymentSettingsProperties withArcNodeResourceIds(List arcNodeResourceIds) {
        this.arcNodeResourceIds = arcNodeResourceIds;
        return this;
    }

    /**
     * Get the deploymentMode property: The deployment mode for cluster deployment.
     * 
     * @return the deploymentMode value.
     */
    public DeploymentMode deploymentMode() {
        return this.deploymentMode;
    }

    /**
     * Set the deploymentMode property: The deployment mode for cluster deployment.
     * 
     * @param deploymentMode the deploymentMode value to set.
     * @return the DeploymentSettingsProperties object itself.
     */
    public DeploymentSettingsProperties withDeploymentMode(DeploymentMode deploymentMode) {
        this.deploymentMode = deploymentMode;
        return this;
    }

    /**
     * Get the operationType property: The intended operation for a cluster.
     * 
     * @return the operationType value.
     */
    public OperationType operationType() {
        return this.operationType;
    }

    /**
     * Set the operationType property: The intended operation for a cluster.
     * 
     * @param operationType the operationType value to set.
     * @return the DeploymentSettingsProperties object itself.
     */
    public DeploymentSettingsProperties withOperationType(OperationType operationType) {
        this.operationType = operationType;
        return this;
    }

    /**
     * Get the deploymentConfiguration property: Scale units will contains list of deployment data.
     * 
     * @return the deploymentConfiguration value.
     */
    public DeploymentConfiguration deploymentConfiguration() {
        return this.deploymentConfiguration;
    }

    /**
     * Set the deploymentConfiguration property: Scale units will contains list of deployment data.
     * 
     * @param deploymentConfiguration the deploymentConfiguration value to set.
     * @return the DeploymentSettingsProperties object itself.
     */
    public DeploymentSettingsProperties withDeploymentConfiguration(DeploymentConfiguration deploymentConfiguration) {
        this.deploymentConfiguration = deploymentConfiguration;
        return this;
    }

    /**
     * Get the reportedProperties property: Deployment Status reported from cluster.
     * 
     * @return the reportedProperties value.
     */
    public EceReportedProperties reportedProperties() {
        return this.reportedProperties;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (arcNodeResourceIds() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property arcNodeResourceIds in model DeploymentSettingsProperties"));
        }
        if (deploymentMode() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property deploymentMode in model DeploymentSettingsProperties"));
        }
        if (deploymentConfiguration() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property deploymentConfiguration in model DeploymentSettingsProperties"));
        } else {
            deploymentConfiguration().validate();
        }
        if (reportedProperties() != null) {
            reportedProperties().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(DeploymentSettingsProperties.class);

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeArrayField("arcNodeResourceIds", this.arcNodeResourceIds,
            (writer, element) -> writer.writeString(element));
        jsonWriter.writeStringField("deploymentMode",
            this.deploymentMode == null ? null : this.deploymentMode.toString());
        jsonWriter.writeJsonField("deploymentConfiguration", this.deploymentConfiguration);
        jsonWriter.writeStringField("operationType", this.operationType == null ? null : this.operationType.toString());
        return jsonWriter.writeEndObject();
    }

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

                if ("arcNodeResourceIds".equals(fieldName)) {
                    List arcNodeResourceIds = reader.readArray(reader1 -> reader1.getString());
                    deserializedDeploymentSettingsProperties.arcNodeResourceIds = arcNodeResourceIds;
                } else if ("deploymentMode".equals(fieldName)) {
                    deserializedDeploymentSettingsProperties.deploymentMode
                        = DeploymentMode.fromString(reader.getString());
                } else if ("deploymentConfiguration".equals(fieldName)) {
                    deserializedDeploymentSettingsProperties.deploymentConfiguration
                        = DeploymentConfiguration.fromJson(reader);
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedDeploymentSettingsProperties.provisioningState
                        = ProvisioningState.fromString(reader.getString());
                } else if ("operationType".equals(fieldName)) {
                    deserializedDeploymentSettingsProperties.operationType
                        = OperationType.fromString(reader.getString());
                } else if ("reportedProperties".equals(fieldName)) {
                    deserializedDeploymentSettingsProperties.reportedProperties
                        = EceReportedProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDeploymentSettingsProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy