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

com.azure.resourcemanager.netapp.fluent.models.RestoreStatusInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-2024-03.

There is a newer version: 1.4.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.netapp.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.netapp.models.MirrorState;
import com.azure.resourcemanager.netapp.models.RelationshipStatus;
import java.io.IOException;

/**
 * Restore status.
 */
@Immutable
public final class RestoreStatusInner implements JsonSerializable {
    /*
     * Restore health status
     */
    private Boolean healthy;

    /*
     * Status of the restore SnapMirror relationship
     */
    private RelationshipStatus relationshipStatus;

    /*
     * The status of the restore
     */
    private MirrorState mirrorState;

    /*
     * Reason for the unhealthy restore relationship
     */
    private String unhealthyReason;

    /*
     * Displays error message if the restore is in an error state
     */
    private String errorMessage;

    /*
     * Displays the total bytes transferred
     */
    private Long totalTransferBytes;

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

    /**
     * Get the healthy property: Restore health status.
     * 
     * @return the healthy value.
     */
    public Boolean healthy() {
        return this.healthy;
    }

    /**
     * Get the relationshipStatus property: Status of the restore SnapMirror relationship.
     * 
     * @return the relationshipStatus value.
     */
    public RelationshipStatus relationshipStatus() {
        return this.relationshipStatus;
    }

    /**
     * Get the mirrorState property: The status of the restore.
     * 
     * @return the mirrorState value.
     */
    public MirrorState mirrorState() {
        return this.mirrorState;
    }

    /**
     * Get the unhealthyReason property: Reason for the unhealthy restore relationship.
     * 
     * @return the unhealthyReason value.
     */
    public String unhealthyReason() {
        return this.unhealthyReason;
    }

    /**
     * Get the errorMessage property: Displays error message if the restore is in an error state.
     * 
     * @return the errorMessage value.
     */
    public String errorMessage() {
        return this.errorMessage;
    }

    /**
     * Get the totalTransferBytes property: Displays the total bytes transferred.
     * 
     * @return the totalTransferBytes value.
     */
    public Long totalTransferBytes() {
        return this.totalTransferBytes;
    }

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

                if ("healthy".equals(fieldName)) {
                    deserializedRestoreStatusInner.healthy = reader.getNullable(JsonReader::getBoolean);
                } else if ("relationshipStatus".equals(fieldName)) {
                    deserializedRestoreStatusInner.relationshipStatus
                        = RelationshipStatus.fromString(reader.getString());
                } else if ("mirrorState".equals(fieldName)) {
                    deserializedRestoreStatusInner.mirrorState = MirrorState.fromString(reader.getString());
                } else if ("unhealthyReason".equals(fieldName)) {
                    deserializedRestoreStatusInner.unhealthyReason = reader.getString();
                } else if ("errorMessage".equals(fieldName)) {
                    deserializedRestoreStatusInner.errorMessage = reader.getString();
                } else if ("totalTransferBytes".equals(fieldName)) {
                    deserializedRestoreStatusInner.totalTransferBytes = reader.getNullable(JsonReader::getLong);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedRestoreStatusInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy