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

com.azure.resourcemanager.automation.fluent.models.DeletedAutomationAccountProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Automation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Automation Client. Package tag package-2022-02-22.

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.automation.fluent.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;

/**
 * Definition of the deleted automation account properties.
 */
@Fluent
public final class DeletedAutomationAccountProperties implements JsonSerializable {
    /*
     * Gets or sets the Automation Account Resource Id.
     */
    private String automationAccountResourceId;

    /*
     * Gets or sets the Automation Account Id.
     */
    private String automationAccountId;

    /*
     * Gets or sets the location of the resource.
     */
    private String location;

    /*
     * Gets the deletion time.
     */
    private OffsetDateTime deletionTime;

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

    /**
     * Get the automationAccountResourceId property: Gets or sets the Automation Account Resource Id.
     * 
     * @return the automationAccountResourceId value.
     */
    public String automationAccountResourceId() {
        return this.automationAccountResourceId;
    }

    /**
     * Set the automationAccountResourceId property: Gets or sets the Automation Account Resource Id.
     * 
     * @param automationAccountResourceId the automationAccountResourceId value to set.
     * @return the DeletedAutomationAccountProperties object itself.
     */
    public DeletedAutomationAccountProperties withAutomationAccountResourceId(String automationAccountResourceId) {
        this.automationAccountResourceId = automationAccountResourceId;
        return this;
    }

    /**
     * Get the automationAccountId property: Gets or sets the Automation Account Id.
     * 
     * @return the automationAccountId value.
     */
    public String automationAccountId() {
        return this.automationAccountId;
    }

    /**
     * Set the automationAccountId property: Gets or sets the Automation Account Id.
     * 
     * @param automationAccountId the automationAccountId value to set.
     * @return the DeletedAutomationAccountProperties object itself.
     */
    public DeletedAutomationAccountProperties withAutomationAccountId(String automationAccountId) {
        this.automationAccountId = automationAccountId;
        return this;
    }

    /**
     * Get the location property: Gets or sets the location of the resource.
     * 
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: Gets or sets the location of the resource.
     * 
     * @param location the location value to set.
     * @return the DeletedAutomationAccountProperties object itself.
     */
    public DeletedAutomationAccountProperties withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the deletionTime property: Gets the deletion time.
     * 
     * @return the deletionTime value.
     */
    public OffsetDateTime deletionTime() {
        return this.deletionTime;
    }

    /**
     * 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("automationAccountResourceId", this.automationAccountResourceId);
        jsonWriter.writeStringField("automationAccountId", this.automationAccountId);
        jsonWriter.writeStringField("location", this.location);
        return jsonWriter.writeEndObject();
    }

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

                if ("automationAccountResourceId".equals(fieldName)) {
                    deserializedDeletedAutomationAccountProperties.automationAccountResourceId = reader.getString();
                } else if ("automationAccountId".equals(fieldName)) {
                    deserializedDeletedAutomationAccountProperties.automationAccountId = reader.getString();
                } else if ("location".equals(fieldName)) {
                    deserializedDeletedAutomationAccountProperties.location = reader.getString();
                } else if ("deletionTime".equals(fieldName)) {
                    deserializedDeletedAutomationAccountProperties.deletionTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDeletedAutomationAccountProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy