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

com.azure.resourcemanager.avs.fluent.models.WorkloadNetworkVMGroupProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Avs Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure VMware Solution API. Package tag package-2023-09-01.

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.avs.fluent.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 com.azure.resourcemanager.avs.models.VMGroupStatusEnum;
import com.azure.resourcemanager.avs.models.WorkloadNetworkVMGroupProvisioningState;
import java.io.IOException;
import java.util.List;

/**
 * NSX VM Group Properties.
 */
@Fluent
public final class WorkloadNetworkVMGroupProperties implements JsonSerializable {
    /*
     * Display name of the VM group.
     */
    private String displayName;

    /*
     * Virtual machine members of this group.
     */
    private List members;

    /*
     * VM Group status.
     */
    private VMGroupStatusEnum status;

    /*
     * The provisioning state
     */
    private WorkloadNetworkVMGroupProvisioningState provisioningState;

    /*
     * NSX revision number.
     */
    private Long revision;

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

    /**
     * Get the displayName property: Display name of the VM group.
     * 
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: Display name of the VM group.
     * 
     * @param displayName the displayName value to set.
     * @return the WorkloadNetworkVMGroupProperties object itself.
     */
    public WorkloadNetworkVMGroupProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the members property: Virtual machine members of this group.
     * 
     * @return the members value.
     */
    public List members() {
        return this.members;
    }

    /**
     * Set the members property: Virtual machine members of this group.
     * 
     * @param members the members value to set.
     * @return the WorkloadNetworkVMGroupProperties object itself.
     */
    public WorkloadNetworkVMGroupProperties withMembers(List members) {
        this.members = members;
        return this;
    }

    /**
     * Get the status property: VM Group status.
     * 
     * @return the status value.
     */
    public VMGroupStatusEnum status() {
        return this.status;
    }

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

    /**
     * Get the revision property: NSX revision number.
     * 
     * @return the revision value.
     */
    public Long revision() {
        return this.revision;
    }

    /**
     * Set the revision property: NSX revision number.
     * 
     * @param revision the revision value to set.
     * @return the WorkloadNetworkVMGroupProperties object itself.
     */
    public WorkloadNetworkVMGroupProperties withRevision(Long revision) {
        this.revision = revision;
        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("displayName", this.displayName);
        jsonWriter.writeArrayField("members", this.members, (writer, element) -> writer.writeString(element));
        jsonWriter.writeNumberField("revision", this.revision);
        return jsonWriter.writeEndObject();
    }

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

                if ("displayName".equals(fieldName)) {
                    deserializedWorkloadNetworkVMGroupProperties.displayName = reader.getString();
                } else if ("members".equals(fieldName)) {
                    List members = reader.readArray(reader1 -> reader1.getString());
                    deserializedWorkloadNetworkVMGroupProperties.members = members;
                } else if ("status".equals(fieldName)) {
                    deserializedWorkloadNetworkVMGroupProperties.status
                        = VMGroupStatusEnum.fromString(reader.getString());
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedWorkloadNetworkVMGroupProperties.provisioningState
                        = WorkloadNetworkVMGroupProvisioningState.fromString(reader.getString());
                } else if ("revision".equals(fieldName)) {
                    deserializedWorkloadNetworkVMGroupProperties.revision = reader.getNullable(JsonReader::getLong);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedWorkloadNetworkVMGroupProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy