![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.automation.models.DeletedAutomationAccount Maven / Gradle / Ivy
// 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.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 com.azure.resourcemanager.automation.fluent.models.DeletedAutomationAccountProperties;
import java.io.IOException;
import java.time.OffsetDateTime;
/**
* Definition of the deleted automation account type.
*/
@Fluent
public final class DeletedAutomationAccount implements JsonSerializable {
/*
* Gets or sets the automation account properties.
*/
private DeletedAutomationAccountProperties innerProperties;
/*
* The resource id.
*/
private String id;
/*
* Gets or sets name of the resource.
*/
private String name;
/*
* The resource type.
*/
private String type;
/*
* Gets or sets the location of the resource.
*/
private String location;
/**
* Creates an instance of DeletedAutomationAccount class.
*/
public DeletedAutomationAccount() {
}
/**
* Get the innerProperties property: Gets or sets the automation account properties.
*
* @return the innerProperties value.
*/
private DeletedAutomationAccountProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the id property: The resource id.
*
* @return the id value.
*/
public String id() {
return this.id;
}
/**
* Set the id property: The resource id.
*
* @param id the id value to set.
* @return the DeletedAutomationAccount object itself.
*/
public DeletedAutomationAccount withId(String id) {
this.id = id;
return this;
}
/**
* Get the name property: Gets or sets name of the resource.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Gets or sets name of the resource.
*
* @param name the name value to set.
* @return the DeletedAutomationAccount object itself.
*/
public DeletedAutomationAccount withName(String name) {
this.name = name;
return this;
}
/**
* Get the type property: The resource type.
*
* @return the type value.
*/
public String type() {
return this.type;
}
/**
* Set the type property: The resource type.
*
* @param type the type value to set.
* @return the DeletedAutomationAccount object itself.
*/
public DeletedAutomationAccount withType(String type) {
this.type = type;
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 DeletedAutomationAccount object itself.
*/
public DeletedAutomationAccount withLocation(String location) {
this.location = location;
return this;
}
/**
* Get the automationAccountResourceId property: Gets or sets the Automation Account Resource Id.
*
* @return the automationAccountResourceId value.
*/
public String automationAccountResourceId() {
return this.innerProperties() == null ? null : this.innerProperties().automationAccountResourceId();
}
/**
* Set the automationAccountResourceId property: Gets or sets the Automation Account Resource Id.
*
* @param automationAccountResourceId the automationAccountResourceId value to set.
* @return the DeletedAutomationAccount object itself.
*/
public DeletedAutomationAccount withAutomationAccountResourceId(String automationAccountResourceId) {
if (this.innerProperties() == null) {
this.innerProperties = new DeletedAutomationAccountProperties();
}
this.innerProperties().withAutomationAccountResourceId(automationAccountResourceId);
return this;
}
/**
* Get the automationAccountId property: Gets or sets the Automation Account Id.
*
* @return the automationAccountId value.
*/
public String automationAccountId() {
return this.innerProperties() == null ? null : this.innerProperties().automationAccountId();
}
/**
* Set the automationAccountId property: Gets or sets the Automation Account Id.
*
* @param automationAccountId the automationAccountId value to set.
* @return the DeletedAutomationAccount object itself.
*/
public DeletedAutomationAccount withAutomationAccountId(String automationAccountId) {
if (this.innerProperties() == null) {
this.innerProperties = new DeletedAutomationAccountProperties();
}
this.innerProperties().withAutomationAccountId(automationAccountId);
return this;
}
/**
* Get the location property: Gets or sets the location of the resource.
*
* @return the location value.
*/
public String locationPropertiesLocation() {
return this.innerProperties() == null ? null : this.innerProperties().location();
}
/**
* Set the location property: Gets or sets the location of the resource.
*
* @param location the location value to set.
* @return the DeletedAutomationAccount object itself.
*/
public DeletedAutomationAccount withLocationPropertiesLocation(String location) {
if (this.innerProperties() == null) {
this.innerProperties = new DeletedAutomationAccountProperties();
}
this.innerProperties().withLocation(location);
return this;
}
/**
* Get the deletionTime property: Gets the deletion time.
*
* @return the deletionTime value.
*/
public OffsetDateTime deletionTime() {
return this.innerProperties() == null ? null : this.innerProperties().deletionTime();
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("properties", this.innerProperties);
jsonWriter.writeStringField("id", this.id);
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeStringField("type", this.type);
jsonWriter.writeStringField("location", this.location);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DeletedAutomationAccount from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DeletedAutomationAccount 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 DeletedAutomationAccount.
*/
public static DeletedAutomationAccount fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DeletedAutomationAccount deserializedDeletedAutomationAccount = new DeletedAutomationAccount();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("properties".equals(fieldName)) {
deserializedDeletedAutomationAccount.innerProperties
= DeletedAutomationAccountProperties.fromJson(reader);
} else if ("id".equals(fieldName)) {
deserializedDeletedAutomationAccount.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedDeletedAutomationAccount.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedDeletedAutomationAccount.type = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedDeletedAutomationAccount.location = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedDeletedAutomationAccount;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy