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

com.azure.resourcemanager.servicefabricmanagedclusters.fluent.models.ManagedVMSizeInner 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.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.servicefabricmanagedclusters.models.VMSize;
import java.io.IOException;

/**
 * Describes a VM Sizes.
 */
@Immutable
public final class ManagedVMSizeInner implements JsonSerializable {
    /*
     * VM Size properties.
     */
    private VMSize properties;

    /*
     * VM Size id.
     */
    private String id;

    /*
     * VM Size name.
     */
    private String name;

    /*
     * VM Size type.
     */
    private String type;

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

    /**
     * Get the properties property: VM Size properties.
     * 
     * @return the properties value.
     */
    public VMSize properties() {
        return this.properties;
    }

    /**
     * Get the id property: VM Size id.
     * 
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

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

    /**
     * Get the type property: VM Size type.
     * 
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

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

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

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

                if ("properties".equals(fieldName)) {
                    deserializedManagedVMSizeInner.properties = VMSize.fromJson(reader);
                } else if ("id".equals(fieldName)) {
                    deserializedManagedVMSizeInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedManagedVMSizeInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedManagedVMSizeInner.type = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedManagedVMSizeInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy