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

com.azure.resourcemanager.servicefabricmanagedclusters.models.ResourceAzStatus Maven / Gradle / Ivy

// 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.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 java.io.IOException;

/**
 * Describes Az Resiliency status of Base resources.
 */
@Immutable
public final class ResourceAzStatus implements JsonSerializable {
    /*
     * VM Size properties.
     */
    private String resourceName;

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

    /*
     * VM Size name.
     */
    private Boolean isZoneResilient;

    /*
     * Zone resiliency status details for the resource.
     */
    private String details;

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

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

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

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

    /**
     * Get the details property: Zone resiliency status details for the resource.
     * 
     * @return the details value.
     */
    public String details() {
        return this.details;
    }

    /**
     * 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();
        return jsonWriter.writeEndObject();
    }

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

                if ("resourceName".equals(fieldName)) {
                    deserializedResourceAzStatus.resourceName = reader.getString();
                } else if ("resourceType".equals(fieldName)) {
                    deserializedResourceAzStatus.resourceType = reader.getString();
                } else if ("isZoneResilient".equals(fieldName)) {
                    deserializedResourceAzStatus.isZoneResilient = reader.getNullable(JsonReader::getBoolean);
                } else if ("details".equals(fieldName)) {
                    deserializedResourceAzStatus.details = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedResourceAzStatus;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy