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

com.azure.resourcemanager.netapp.fluent.models.BackupStatusInner 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;

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

    /*
     * Status of the backup mirror relationship
     */
    private RelationshipStatus relationshipStatus;

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

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

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

    /*
     * Displays the last transfer size
     */
    private Long lastTransferSize;

    /*
     * Displays the last transfer type
     */
    private String lastTransferType;

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

    /*
     * Displays the total number of bytes transferred for the ongoing operation
     */
    private Long transferProgressBytes;

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

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

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

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

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

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

    /**
     * Get the lastTransferSize property: Displays the last transfer size.
     * 
     * @return the lastTransferSize value.
     */
    public Long lastTransferSize() {
        return this.lastTransferSize;
    }

    /**
     * Get the lastTransferType property: Displays the last transfer type.
     * 
     * @return the lastTransferType value.
     */
    public String lastTransferType() {
        return this.lastTransferType;
    }

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

    /**
     * Get the transferProgressBytes property: Displays the total number of bytes transferred for the ongoing operation.
     * 
     * @return the transferProgressBytes value.
     */
    public Long transferProgressBytes() {
        return this.transferProgressBytes;
    }

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

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

            return deserializedBackupStatusInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy