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

com.azure.resourcemanager.storagecache.models.AmlFilesystemHealth Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob storage, for use on demand. These operations create and manage Azure Managed Lustre file systems. Package tag package-2024-03.

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.storagecache.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;

/**
 * An indication of AML file system health. Gives more information about health than just that related to provisioning.
 */
@Fluent
public final class AmlFilesystemHealth implements JsonSerializable {
    /*
     * List of AML file system health states.
     */
    private AmlFilesystemHealthStateType state;

    /*
     * Server-defined error code for the AML file system health
     */
    private String statusCode;

    /*
     * Describes the health state.
     */
    private String statusDescription;

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

    /**
     * Get the state property: List of AML file system health states.
     * 
     * @return the state value.
     */
    public AmlFilesystemHealthStateType state() {
        return this.state;
    }

    /**
     * Set the state property: List of AML file system health states.
     * 
     * @param state the state value to set.
     * @return the AmlFilesystemHealth object itself.
     */
    public AmlFilesystemHealth withState(AmlFilesystemHealthStateType state) {
        this.state = state;
        return this;
    }

    /**
     * Get the statusCode property: Server-defined error code for the AML file system health.
     * 
     * @return the statusCode value.
     */
    public String statusCode() {
        return this.statusCode;
    }

    /**
     * Set the statusCode property: Server-defined error code for the AML file system health.
     * 
     * @param statusCode the statusCode value to set.
     * @return the AmlFilesystemHealth object itself.
     */
    public AmlFilesystemHealth withStatusCode(String statusCode) {
        this.statusCode = statusCode;
        return this;
    }

    /**
     * Get the statusDescription property: Describes the health state.
     * 
     * @return the statusDescription value.
     */
    public String statusDescription() {
        return this.statusDescription;
    }

    /**
     * Set the statusDescription property: Describes the health state.
     * 
     * @param statusDescription the statusDescription value to set.
     * @return the AmlFilesystemHealth object itself.
     */
    public AmlFilesystemHealth withStatusDescription(String statusDescription) {
        this.statusDescription = statusDescription;
        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("state", this.state == null ? null : this.state.toString());
        jsonWriter.writeStringField("statusCode", this.statusCode);
        jsonWriter.writeStringField("statusDescription", this.statusDescription);
        return jsonWriter.writeEndObject();
    }

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

                if ("state".equals(fieldName)) {
                    deserializedAmlFilesystemHealth.state = AmlFilesystemHealthStateType.fromString(reader.getString());
                } else if ("statusCode".equals(fieldName)) {
                    deserializedAmlFilesystemHealth.statusCode = reader.getString();
                } else if ("statusDescription".equals(fieldName)) {
                    deserializedAmlFilesystemHealth.statusDescription = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAmlFilesystemHealth;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy