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

com.azure.resourcemanager.dataprotection.models.RecoveryPointDataStoreDetails Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for DataProtection Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2024-04.

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.dataprotection.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;

/**
 * RecoveryPointDataStoreDetails
 * 
 * RecoveryPoint datastore details.
 */
@Fluent
public final class RecoveryPointDataStoreDetails implements JsonSerializable {
    /*
     * The creationTime property.
     */
    private OffsetDateTime creationTime;

    /*
     * The expiryTime property.
     */
    private OffsetDateTime expiryTime;

    /*
     * The id property.
     */
    private String id;

    /*
     * The metaData property.
     */
    private String metadata;

    /*
     * The state property.
     */
    private String state;

    /*
     * The type property.
     */
    private String type;

    /*
     * The visible property.
     */
    private Boolean visible;

    /*
     * The rehydrationExpiryTime property.
     */
    private OffsetDateTime rehydrationExpiryTime;

    /*
     * The rehydrationStatus property.
     */
    private RehydrationStatus rehydrationStatus;

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

    /**
     * Get the creationTime property: The creationTime property.
     * 
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.creationTime;
    }

    /**
     * Set the creationTime property: The creationTime property.
     * 
     * @param creationTime the creationTime value to set.
     * @return the RecoveryPointDataStoreDetails object itself.
     */
    public RecoveryPointDataStoreDetails withCreationTime(OffsetDateTime creationTime) {
        this.creationTime = creationTime;
        return this;
    }

    /**
     * Get the expiryTime property: The expiryTime property.
     * 
     * @return the expiryTime value.
     */
    public OffsetDateTime expiryTime() {
        return this.expiryTime;
    }

    /**
     * Set the expiryTime property: The expiryTime property.
     * 
     * @param expiryTime the expiryTime value to set.
     * @return the RecoveryPointDataStoreDetails object itself.
     */
    public RecoveryPointDataStoreDetails withExpiryTime(OffsetDateTime expiryTime) {
        this.expiryTime = expiryTime;
        return this;
    }

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

    /**
     * Set the id property: The id property.
     * 
     * @param id the id value to set.
     * @return the RecoveryPointDataStoreDetails object itself.
     */
    public RecoveryPointDataStoreDetails withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the metadata property: The metaData property.
     * 
     * @return the metadata value.
     */
    public String metadata() {
        return this.metadata;
    }

    /**
     * Set the metadata property: The metaData property.
     * 
     * @param metadata the metadata value to set.
     * @return the RecoveryPointDataStoreDetails object itself.
     */
    public RecoveryPointDataStoreDetails withMetadata(String metadata) {
        this.metadata = metadata;
        return this;
    }

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

    /**
     * Set the state property: The state property.
     * 
     * @param state the state value to set.
     * @return the RecoveryPointDataStoreDetails object itself.
     */
    public RecoveryPointDataStoreDetails withState(String state) {
        this.state = state;
        return this;
    }

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

    /**
     * Set the type property: The type property.
     * 
     * @param type the type value to set.
     * @return the RecoveryPointDataStoreDetails object itself.
     */
    public RecoveryPointDataStoreDetails withType(String type) {
        this.type = type;
        return this;
    }

    /**
     * Get the visible property: The visible property.
     * 
     * @return the visible value.
     */
    public Boolean visible() {
        return this.visible;
    }

    /**
     * Set the visible property: The visible property.
     * 
     * @param visible the visible value to set.
     * @return the RecoveryPointDataStoreDetails object itself.
     */
    public RecoveryPointDataStoreDetails withVisible(Boolean visible) {
        this.visible = visible;
        return this;
    }

    /**
     * Get the rehydrationExpiryTime property: The rehydrationExpiryTime property.
     * 
     * @return the rehydrationExpiryTime value.
     */
    public OffsetDateTime rehydrationExpiryTime() {
        return this.rehydrationExpiryTime;
    }

    /**
     * Get the rehydrationStatus property: The rehydrationStatus property.
     * 
     * @return the rehydrationStatus value.
     */
    public RehydrationStatus rehydrationStatus() {
        return this.rehydrationStatus;
    }

    /**
     * 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("creationTime",
            this.creationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.creationTime));
        jsonWriter.writeStringField("expiryTime",
            this.expiryTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expiryTime));
        jsonWriter.writeStringField("id", this.id);
        jsonWriter.writeStringField("metaData", this.metadata);
        jsonWriter.writeStringField("state", this.state);
        jsonWriter.writeStringField("type", this.type);
        jsonWriter.writeBooleanField("visible", this.visible);
        return jsonWriter.writeEndObject();
    }

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

                if ("creationTime".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.creationTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("expiryTime".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.expiryTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("id".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.id = reader.getString();
                } else if ("metaData".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.metadata = reader.getString();
                } else if ("state".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.state = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.type = reader.getString();
                } else if ("visible".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.visible = reader.getNullable(JsonReader::getBoolean);
                } else if ("rehydrationExpiryTime".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.rehydrationExpiryTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("rehydrationStatus".equals(fieldName)) {
                    deserializedRecoveryPointDataStoreDetails.rehydrationStatus
                        = RehydrationStatus.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedRecoveryPointDataStoreDetails;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy