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

com.azure.resourcemanager.azurestackhci.models.DeploymentSettingStorageNetworks 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.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;
import java.util.List;

/**
 * The StorageNetworks of a cluster.
 */
@Fluent
public final class DeploymentSettingStorageNetworks implements JsonSerializable {
    /*
     * Name of the storage network.
     */
    private String name;

    /*
     * Name of the storage network adapter.
     */
    private String networkAdapterName;

    /*
     * ID specified for the VLAN storage network. This setting is applied to the network interfaces that route the
     * storage and VM migration traffic.
     */
    private String vlanId;

    /*
     * List of Storage adapter physical nodes config to deploy AzureStackHCI Cluster.
     */
    private List storageAdapterIpInfo;

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

    /**
     * Get the name property: Name of the storage network.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Name of the storage network.
     * 
     * @param name the name value to set.
     * @return the DeploymentSettingStorageNetworks object itself.
     */
    public DeploymentSettingStorageNetworks withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the networkAdapterName property: Name of the storage network adapter.
     * 
     * @return the networkAdapterName value.
     */
    public String networkAdapterName() {
        return this.networkAdapterName;
    }

    /**
     * Set the networkAdapterName property: Name of the storage network adapter.
     * 
     * @param networkAdapterName the networkAdapterName value to set.
     * @return the DeploymentSettingStorageNetworks object itself.
     */
    public DeploymentSettingStorageNetworks withNetworkAdapterName(String networkAdapterName) {
        this.networkAdapterName = networkAdapterName;
        return this;
    }

    /**
     * Get the vlanId property: ID specified for the VLAN storage network. This setting is applied to the network
     * interfaces that route the storage and VM migration traffic.
     * 
     * @return the vlanId value.
     */
    public String vlanId() {
        return this.vlanId;
    }

    /**
     * Set the vlanId property: ID specified for the VLAN storage network. This setting is applied to the network
     * interfaces that route the storage and VM migration traffic.
     * 
     * @param vlanId the vlanId value to set.
     * @return the DeploymentSettingStorageNetworks object itself.
     */
    public DeploymentSettingStorageNetworks withVlanId(String vlanId) {
        this.vlanId = vlanId;
        return this;
    }

    /**
     * Get the storageAdapterIpInfo property: List of Storage adapter physical nodes config to deploy AzureStackHCI
     * Cluster.
     * 
     * @return the storageAdapterIpInfo value.
     */
    public List storageAdapterIpInfo() {
        return this.storageAdapterIpInfo;
    }

    /**
     * Set the storageAdapterIpInfo property: List of Storage adapter physical nodes config to deploy AzureStackHCI
     * Cluster.
     * 
     * @param storageAdapterIpInfo the storageAdapterIpInfo value to set.
     * @return the DeploymentSettingStorageNetworks object itself.
     */
    public DeploymentSettingStorageNetworks
        withStorageAdapterIpInfo(List storageAdapterIpInfo) {
        this.storageAdapterIpInfo = storageAdapterIpInfo;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (storageAdapterIpInfo() != null) {
            storageAdapterIpInfo().forEach(e -> e.validate());
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("name", this.name);
        jsonWriter.writeStringField("networkAdapterName", this.networkAdapterName);
        jsonWriter.writeStringField("vlanId", this.vlanId);
        jsonWriter.writeArrayField("storageAdapterIPInfo", this.storageAdapterIpInfo,
            (writer, element) -> writer.writeJson(element));
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of DeploymentSettingStorageNetworks from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of DeploymentSettingStorageNetworks 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 DeploymentSettingStorageNetworks.
     */
    public static DeploymentSettingStorageNetworks fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            DeploymentSettingStorageNetworks deserializedDeploymentSettingStorageNetworks
                = new DeploymentSettingStorageNetworks();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("name".equals(fieldName)) {
                    deserializedDeploymentSettingStorageNetworks.name = reader.getString();
                } else if ("networkAdapterName".equals(fieldName)) {
                    deserializedDeploymentSettingStorageNetworks.networkAdapterName = reader.getString();
                } else if ("vlanId".equals(fieldName)) {
                    deserializedDeploymentSettingStorageNetworks.vlanId = reader.getString();
                } else if ("storageAdapterIPInfo".equals(fieldName)) {
                    List storageAdapterIpInfo
                        = reader.readArray(reader1 -> DeploymentSettingStorageAdapterIpInfo.fromJson(reader1));
                    deserializedDeploymentSettingStorageNetworks.storageAdapterIpInfo = storageAdapterIpInfo;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDeploymentSettingStorageNetworks;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy