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

com.azure.resourcemanager.dataprotection.models.ResourceMoveDetails 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.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * ResourceMoveDetails will be returned in response to GetResource call from ARM.
 */
@Fluent
public final class ResourceMoveDetails implements JsonSerializable {
    /*
     * CorrelationId of latest ResourceMove operation attempted
     */
    private String operationId;

    /*
     * Start time in UTC of latest ResourceMove operation attempted. ISO 8601 format.
     */
    private String startTimeUtc;

    /*
     * Completion time in UTC of latest ResourceMove operation attempted. ISO 8601 format.
     */
    private String completionTimeUtc;

    /*
     * ARM resource path of source resource
     */
    private String sourceResourcePath;

    /*
     * ARM resource path of target resource used in latest ResourceMove operation
     */
    private String targetResourcePath;

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

    /**
     * Get the operationId property: CorrelationId of latest ResourceMove operation attempted.
     * 
     * @return the operationId value.
     */
    public String operationId() {
        return this.operationId;
    }

    /**
     * Set the operationId property: CorrelationId of latest ResourceMove operation attempted.
     * 
     * @param operationId the operationId value to set.
     * @return the ResourceMoveDetails object itself.
     */
    public ResourceMoveDetails withOperationId(String operationId) {
        this.operationId = operationId;
        return this;
    }

    /**
     * Get the startTimeUtc property: Start time in UTC of latest ResourceMove operation attempted. ISO 8601 format.
     * 
     * @return the startTimeUtc value.
     */
    public String startTimeUtc() {
        return this.startTimeUtc;
    }

    /**
     * Set the startTimeUtc property: Start time in UTC of latest ResourceMove operation attempted. ISO 8601 format.
     * 
     * @param startTimeUtc the startTimeUtc value to set.
     * @return the ResourceMoveDetails object itself.
     */
    public ResourceMoveDetails withStartTimeUtc(String startTimeUtc) {
        this.startTimeUtc = startTimeUtc;
        return this;
    }

    /**
     * Get the completionTimeUtc property: Completion time in UTC of latest ResourceMove operation attempted. ISO 8601
     * format.
     * 
     * @return the completionTimeUtc value.
     */
    public String completionTimeUtc() {
        return this.completionTimeUtc;
    }

    /**
     * Set the completionTimeUtc property: Completion time in UTC of latest ResourceMove operation attempted. ISO 8601
     * format.
     * 
     * @param completionTimeUtc the completionTimeUtc value to set.
     * @return the ResourceMoveDetails object itself.
     */
    public ResourceMoveDetails withCompletionTimeUtc(String completionTimeUtc) {
        this.completionTimeUtc = completionTimeUtc;
        return this;
    }

    /**
     * Get the sourceResourcePath property: ARM resource path of source resource.
     * 
     * @return the sourceResourcePath value.
     */
    public String sourceResourcePath() {
        return this.sourceResourcePath;
    }

    /**
     * Set the sourceResourcePath property: ARM resource path of source resource.
     * 
     * @param sourceResourcePath the sourceResourcePath value to set.
     * @return the ResourceMoveDetails object itself.
     */
    public ResourceMoveDetails withSourceResourcePath(String sourceResourcePath) {
        this.sourceResourcePath = sourceResourcePath;
        return this;
    }

    /**
     * Get the targetResourcePath property: ARM resource path of target resource used in latest ResourceMove operation.
     * 
     * @return the targetResourcePath value.
     */
    public String targetResourcePath() {
        return this.targetResourcePath;
    }

    /**
     * Set the targetResourcePath property: ARM resource path of target resource used in latest ResourceMove operation.
     * 
     * @param targetResourcePath the targetResourcePath value to set.
     * @return the ResourceMoveDetails object itself.
     */
    public ResourceMoveDetails withTargetResourcePath(String targetResourcePath) {
        this.targetResourcePath = targetResourcePath;
        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("operationId", this.operationId);
        jsonWriter.writeStringField("startTimeUtc", this.startTimeUtc);
        jsonWriter.writeStringField("completionTimeUtc", this.completionTimeUtc);
        jsonWriter.writeStringField("sourceResourcePath", this.sourceResourcePath);
        jsonWriter.writeStringField("targetResourcePath", this.targetResourcePath);
        return jsonWriter.writeEndObject();
    }

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

                if ("operationId".equals(fieldName)) {
                    deserializedResourceMoveDetails.operationId = reader.getString();
                } else if ("startTimeUtc".equals(fieldName)) {
                    deserializedResourceMoveDetails.startTimeUtc = reader.getString();
                } else if ("completionTimeUtc".equals(fieldName)) {
                    deserializedResourceMoveDetails.completionTimeUtc = reader.getString();
                } else if ("sourceResourcePath".equals(fieldName)) {
                    deserializedResourceMoveDetails.sourceResourcePath = reader.getString();
                } else if ("targetResourcePath".equals(fieldName)) {
                    deserializedResourceMoveDetails.targetResourcePath = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedResourceMoveDetails;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy