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

com.azure.resourcemanager.azurestackhci.models.DeploymentSettingIntents 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 Intents of a cluster.
 */
@Fluent
public final class DeploymentSettingIntents implements JsonSerializable {
    /*
     * Name of the network intent you wish to create.
     */
    private String name;

    /*
     * List of network traffic types. Only allowed values are 'Compute', 'Storage', 'Management'.
     */
    private List trafficType;

    /*
     * Array of network interfaces used for the network intent.
     */
    private List adapter;

    /*
     * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM
     * validation.
     */
    private Boolean overrideVirtualSwitchConfiguration;

    /*
     * Set virtualSwitch ConfigurationOverrides for cluster.
     */
    private DeploymentSettingVirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides;

    /*
     * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM
     * validation.
     */
    private Boolean overrideQosPolicy;

    /*
     * Set QoS PolicyOverrides for cluster.
     */
    private QosPolicyOverrides qosPolicyOverrides;

    /*
     * This parameter should only be modified based on your OEM guidance. Do not modify this parameter without OEM
     * validation.
     */
    private Boolean overrideAdapterProperty;

    /*
     * Set Adapter PropertyOverrides for cluster.
     */
    private DeploymentSettingAdapterPropertyOverrides adapterPropertyOverrides;

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

    /**
     * Get the name property: Name of the network intent you wish to create.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

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

    /**
     * Get the trafficType property: List of network traffic types. Only allowed values are 'Compute', 'Storage',
     * 'Management'.
     * 
     * @return the trafficType value.
     */
    public List trafficType() {
        return this.trafficType;
    }

    /**
     * Set the trafficType property: List of network traffic types. Only allowed values are 'Compute', 'Storage',
     * 'Management'.
     * 
     * @param trafficType the trafficType value to set.
     * @return the DeploymentSettingIntents object itself.
     */
    public DeploymentSettingIntents withTrafficType(List trafficType) {
        this.trafficType = trafficType;
        return this;
    }

    /**
     * Get the adapter property: Array of network interfaces used for the network intent.
     * 
     * @return the adapter value.
     */
    public List adapter() {
        return this.adapter;
    }

    /**
     * Set the adapter property: Array of network interfaces used for the network intent.
     * 
     * @param adapter the adapter value to set.
     * @return the DeploymentSettingIntents object itself.
     */
    public DeploymentSettingIntents withAdapter(List adapter) {
        this.adapter = adapter;
        return this;
    }

    /**
     * Get the overrideVirtualSwitchConfiguration property: This parameter should only be modified based on your OEM
     * guidance. Do not modify this parameter without OEM validation.
     * 
     * @return the overrideVirtualSwitchConfiguration value.
     */
    public Boolean overrideVirtualSwitchConfiguration() {
        return this.overrideVirtualSwitchConfiguration;
    }

    /**
     * Set the overrideVirtualSwitchConfiguration property: This parameter should only be modified based on your OEM
     * guidance. Do not modify this parameter without OEM validation.
     * 
     * @param overrideVirtualSwitchConfiguration the overrideVirtualSwitchConfiguration value to set.
     * @return the DeploymentSettingIntents object itself.
     */
    public DeploymentSettingIntents withOverrideVirtualSwitchConfiguration(Boolean overrideVirtualSwitchConfiguration) {
        this.overrideVirtualSwitchConfiguration = overrideVirtualSwitchConfiguration;
        return this;
    }

    /**
     * Get the virtualSwitchConfigurationOverrides property: Set virtualSwitch ConfigurationOverrides for cluster.
     * 
     * @return the virtualSwitchConfigurationOverrides value.
     */
    public DeploymentSettingVirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides() {
        return this.virtualSwitchConfigurationOverrides;
    }

    /**
     * Set the virtualSwitchConfigurationOverrides property: Set virtualSwitch ConfigurationOverrides for cluster.
     * 
     * @param virtualSwitchConfigurationOverrides the virtualSwitchConfigurationOverrides value to set.
     * @return the DeploymentSettingIntents object itself.
     */
    public DeploymentSettingIntents withVirtualSwitchConfigurationOverrides(
        DeploymentSettingVirtualSwitchConfigurationOverrides virtualSwitchConfigurationOverrides) {
        this.virtualSwitchConfigurationOverrides = virtualSwitchConfigurationOverrides;
        return this;
    }

    /**
     * Get the overrideQosPolicy property: This parameter should only be modified based on your OEM guidance. Do not
     * modify this parameter without OEM validation.
     * 
     * @return the overrideQosPolicy value.
     */
    public Boolean overrideQosPolicy() {
        return this.overrideQosPolicy;
    }

    /**
     * Set the overrideQosPolicy property: This parameter should only be modified based on your OEM guidance. Do not
     * modify this parameter without OEM validation.
     * 
     * @param overrideQosPolicy the overrideQosPolicy value to set.
     * @return the DeploymentSettingIntents object itself.
     */
    public DeploymentSettingIntents withOverrideQosPolicy(Boolean overrideQosPolicy) {
        this.overrideQosPolicy = overrideQosPolicy;
        return this;
    }

    /**
     * Get the qosPolicyOverrides property: Set QoS PolicyOverrides for cluster.
     * 
     * @return the qosPolicyOverrides value.
     */
    public QosPolicyOverrides qosPolicyOverrides() {
        return this.qosPolicyOverrides;
    }

    /**
     * Set the qosPolicyOverrides property: Set QoS PolicyOverrides for cluster.
     * 
     * @param qosPolicyOverrides the qosPolicyOverrides value to set.
     * @return the DeploymentSettingIntents object itself.
     */
    public DeploymentSettingIntents withQosPolicyOverrides(QosPolicyOverrides qosPolicyOverrides) {
        this.qosPolicyOverrides = qosPolicyOverrides;
        return this;
    }

    /**
     * Get the overrideAdapterProperty property: This parameter should only be modified based on your OEM guidance. Do
     * not modify this parameter without OEM validation.
     * 
     * @return the overrideAdapterProperty value.
     */
    public Boolean overrideAdapterProperty() {
        return this.overrideAdapterProperty;
    }

    /**
     * Set the overrideAdapterProperty property: This parameter should only be modified based on your OEM guidance. Do
     * not modify this parameter without OEM validation.
     * 
     * @param overrideAdapterProperty the overrideAdapterProperty value to set.
     * @return the DeploymentSettingIntents object itself.
     */
    public DeploymentSettingIntents withOverrideAdapterProperty(Boolean overrideAdapterProperty) {
        this.overrideAdapterProperty = overrideAdapterProperty;
        return this;
    }

    /**
     * Get the adapterPropertyOverrides property: Set Adapter PropertyOverrides for cluster.
     * 
     * @return the adapterPropertyOverrides value.
     */
    public DeploymentSettingAdapterPropertyOverrides adapterPropertyOverrides() {
        return this.adapterPropertyOverrides;
    }

    /**
     * Set the adapterPropertyOverrides property: Set Adapter PropertyOverrides for cluster.
     * 
     * @param adapterPropertyOverrides the adapterPropertyOverrides value to set.
     * @return the DeploymentSettingIntents object itself.
     */
    public DeploymentSettingIntents
        withAdapterPropertyOverrides(DeploymentSettingAdapterPropertyOverrides adapterPropertyOverrides) {
        this.adapterPropertyOverrides = adapterPropertyOverrides;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (virtualSwitchConfigurationOverrides() != null) {
            virtualSwitchConfigurationOverrides().validate();
        }
        if (qosPolicyOverrides() != null) {
            qosPolicyOverrides().validate();
        }
        if (adapterPropertyOverrides() != null) {
            adapterPropertyOverrides().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("name", this.name);
        jsonWriter.writeArrayField("trafficType", this.trafficType, (writer, element) -> writer.writeString(element));
        jsonWriter.writeArrayField("adapter", this.adapter, (writer, element) -> writer.writeString(element));
        jsonWriter.writeBooleanField("overrideVirtualSwitchConfiguration", this.overrideVirtualSwitchConfiguration);
        jsonWriter.writeJsonField("virtualSwitchConfigurationOverrides", this.virtualSwitchConfigurationOverrides);
        jsonWriter.writeBooleanField("overrideQosPolicy", this.overrideQosPolicy);
        jsonWriter.writeJsonField("qosPolicyOverrides", this.qosPolicyOverrides);
        jsonWriter.writeBooleanField("overrideAdapterProperty", this.overrideAdapterProperty);
        jsonWriter.writeJsonField("adapterPropertyOverrides", this.adapterPropertyOverrides);
        return jsonWriter.writeEndObject();
    }

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

                if ("name".equals(fieldName)) {
                    deserializedDeploymentSettingIntents.name = reader.getString();
                } else if ("trafficType".equals(fieldName)) {
                    List trafficType = reader.readArray(reader1 -> reader1.getString());
                    deserializedDeploymentSettingIntents.trafficType = trafficType;
                } else if ("adapter".equals(fieldName)) {
                    List adapter = reader.readArray(reader1 -> reader1.getString());
                    deserializedDeploymentSettingIntents.adapter = adapter;
                } else if ("overrideVirtualSwitchConfiguration".equals(fieldName)) {
                    deserializedDeploymentSettingIntents.overrideVirtualSwitchConfiguration
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("virtualSwitchConfigurationOverrides".equals(fieldName)) {
                    deserializedDeploymentSettingIntents.virtualSwitchConfigurationOverrides
                        = DeploymentSettingVirtualSwitchConfigurationOverrides.fromJson(reader);
                } else if ("overrideQosPolicy".equals(fieldName)) {
                    deserializedDeploymentSettingIntents.overrideQosPolicy = reader.getNullable(JsonReader::getBoolean);
                } else if ("qosPolicyOverrides".equals(fieldName)) {
                    deserializedDeploymentSettingIntents.qosPolicyOverrides = QosPolicyOverrides.fromJson(reader);
                } else if ("overrideAdapterProperty".equals(fieldName)) {
                    deserializedDeploymentSettingIntents.overrideAdapterProperty
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("adapterPropertyOverrides".equals(fieldName)) {
                    deserializedDeploymentSettingIntents.adapterPropertyOverrides
                        = DeploymentSettingAdapterPropertyOverrides.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDeploymentSettingIntents;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy