com.azure.resourcemanager.automation.fluent.models.AutomationAccountProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-automation Show documentation
Show all versions of azure-resourcemanager-automation Show documentation
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 com.azure.resourcemanager.automation.models.AutomationAccountState;
import com.azure.resourcemanager.automation.models.EncryptionProperties;
import com.azure.resourcemanager.automation.models.Sku;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
/**
* Definition of the account property.
*/
@Fluent
public final class AutomationAccountProperties implements JsonSerializable {
/*
* Gets or sets the SKU of account.
*/
private Sku sku;
/*
* Gets or sets the last modified by.
*/
private String lastModifiedBy;
/*
* Gets status of account.
*/
private AutomationAccountState state;
/*
* Gets the creation time.
*/
private OffsetDateTime creationTime;
/*
* Gets the last modified time.
*/
private OffsetDateTime lastModifiedTime;
/*
* Gets or sets the description.
*/
private String description;
/*
* Encryption properties for the automation account
*/
private EncryptionProperties encryption;
/*
* List of Automation operations supported by the Automation resource provider.
*/
private List privateEndpointConnections;
/*
* Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is allowed from the public internet
*/
private Boolean publicNetworkAccess;
/*
* Indicates whether requests using non-AAD authentication are blocked
*/
private Boolean disableLocalAuth;
/*
* URL of automation hybrid service which is used for hybrid worker on-boarding.
*/
private String automationHybridServiceUrl;
/**
* Creates an instance of AutomationAccountProperties class.
*/
public AutomationAccountProperties() {
}
/**
* Get the sku property: Gets or sets the SKU of account.
*
* @return the sku value.
*/
public Sku sku() {
return this.sku;
}
/**
* Set the sku property: Gets or sets the SKU of account.
*
* @param sku the sku value to set.
* @return the AutomationAccountProperties object itself.
*/
public AutomationAccountProperties withSku(Sku sku) {
this.sku = sku;
return this;
}
/**
* Get the lastModifiedBy property: Gets or sets the last modified by.
*
* @return the lastModifiedBy value.
*/
public String lastModifiedBy() {
return this.lastModifiedBy;
}
/**
* Set the lastModifiedBy property: Gets or sets the last modified by.
*
* @param lastModifiedBy the lastModifiedBy value to set.
* @return the AutomationAccountProperties object itself.
*/
public AutomationAccountProperties withLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
return this;
}
/**
* Get the state property: Gets status of account.
*
* @return the state value.
*/
public AutomationAccountState state() {
return this.state;
}
/**
* Get the creationTime property: Gets the creation time.
*
* @return the creationTime value.
*/
public OffsetDateTime creationTime() {
return this.creationTime;
}
/**
* Get the lastModifiedTime property: Gets the last modified time.
*
* @return the lastModifiedTime value.
*/
public OffsetDateTime lastModifiedTime() {
return this.lastModifiedTime;
}
/**
* Get the description property: Gets or sets the description.
*
* @return the description value.
*/
public String description() {
return this.description;
}
/**
* Set the description property: Gets or sets the description.
*
* @param description the description value to set.
* @return the AutomationAccountProperties object itself.
*/
public AutomationAccountProperties withDescription(String description) {
this.description = description;
return this;
}
/**
* Get the encryption property: Encryption properties for the automation account.
*
* @return the encryption value.
*/
public EncryptionProperties encryption() {
return this.encryption;
}
/**
* Set the encryption property: Encryption properties for the automation account.
*
* @param encryption the encryption value to set.
* @return the AutomationAccountProperties object itself.
*/
public AutomationAccountProperties withEncryption(EncryptionProperties encryption) {
this.encryption = encryption;
return this;
}
/**
* Get the privateEndpointConnections property: List of Automation operations supported by the Automation resource
* provider.
*
* @return the privateEndpointConnections value.
*/
public List privateEndpointConnections() {
return this.privateEndpointConnections;
}
/**
* Set the privateEndpointConnections property: List of Automation operations supported by the Automation resource
* provider.
*
* @param privateEndpointConnections the privateEndpointConnections value to set.
* @return the AutomationAccountProperties object itself.
*/
public AutomationAccountProperties
withPrivateEndpointConnections(List privateEndpointConnections) {
this.privateEndpointConnections = privateEndpointConnections;
return this;
}
/**
* Get the publicNetworkAccess property: Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is
* allowed from the public internet.
*
* @return the publicNetworkAccess value.
*/
public Boolean publicNetworkAccess() {
return this.publicNetworkAccess;
}
/**
* Set the publicNetworkAccess property: Indicates whether traffic on the non-ARM endpoint (Webhook/Agent) is
* allowed from the public internet.
*
* @param publicNetworkAccess the publicNetworkAccess value to set.
* @return the AutomationAccountProperties object itself.
*/
public AutomationAccountProperties withPublicNetworkAccess(Boolean publicNetworkAccess) {
this.publicNetworkAccess = publicNetworkAccess;
return this;
}
/**
* Get the disableLocalAuth property: Indicates whether requests using non-AAD authentication are blocked.
*
* @return the disableLocalAuth value.
*/
public Boolean disableLocalAuth() {
return this.disableLocalAuth;
}
/**
* Set the disableLocalAuth property: Indicates whether requests using non-AAD authentication are blocked.
*
* @param disableLocalAuth the disableLocalAuth value to set.
* @return the AutomationAccountProperties object itself.
*/
public AutomationAccountProperties withDisableLocalAuth(Boolean disableLocalAuth) {
this.disableLocalAuth = disableLocalAuth;
return this;
}
/**
* Get the automationHybridServiceUrl property: URL of automation hybrid service which is used for hybrid worker
* on-boarding.
*
* @return the automationHybridServiceUrl value.
*/
public String automationHybridServiceUrl() {
return this.automationHybridServiceUrl;
}
/**
* Set the automationHybridServiceUrl property: URL of automation hybrid service which is used for hybrid worker
* on-boarding.
*
* @param automationHybridServiceUrl the automationHybridServiceUrl value to set.
* @return the AutomationAccountProperties object itself.
*/
public AutomationAccountProperties withAutomationHybridServiceUrl(String automationHybridServiceUrl) {
this.automationHybridServiceUrl = automationHybridServiceUrl;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (sku() != null) {
sku().validate();
}
if (encryption() != null) {
encryption().validate();
}
if (privateEndpointConnections() != null) {
privateEndpointConnections().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("sku", this.sku);
jsonWriter.writeStringField("lastModifiedBy", this.lastModifiedBy);
jsonWriter.writeStringField("description", this.description);
jsonWriter.writeJsonField("encryption", this.encryption);
jsonWriter.writeArrayField("privateEndpointConnections", this.privateEndpointConnections,
(writer, element) -> writer.writeJson(element));
jsonWriter.writeBooleanField("publicNetworkAccess", this.publicNetworkAccess);
jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth);
jsonWriter.writeStringField("automationHybridServiceUrl", this.automationHybridServiceUrl);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AutomationAccountProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AutomationAccountProperties 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 AutomationAccountProperties.
*/
public static AutomationAccountProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AutomationAccountProperties deserializedAutomationAccountProperties = new AutomationAccountProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("sku".equals(fieldName)) {
deserializedAutomationAccountProperties.sku = Sku.fromJson(reader);
} else if ("lastModifiedBy".equals(fieldName)) {
deserializedAutomationAccountProperties.lastModifiedBy = reader.getString();
} else if ("state".equals(fieldName)) {
deserializedAutomationAccountProperties.state
= AutomationAccountState.fromString(reader.getString());
} else if ("creationTime".equals(fieldName)) {
deserializedAutomationAccountProperties.creationTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastModifiedTime".equals(fieldName)) {
deserializedAutomationAccountProperties.lastModifiedTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("description".equals(fieldName)) {
deserializedAutomationAccountProperties.description = reader.getString();
} else if ("encryption".equals(fieldName)) {
deserializedAutomationAccountProperties.encryption = EncryptionProperties.fromJson(reader);
} else if ("privateEndpointConnections".equals(fieldName)) {
List privateEndpointConnections
= reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1));
deserializedAutomationAccountProperties.privateEndpointConnections = privateEndpointConnections;
} else if ("publicNetworkAccess".equals(fieldName)) {
deserializedAutomationAccountProperties.publicNetworkAccess
= reader.getNullable(JsonReader::getBoolean);
} else if ("disableLocalAuth".equals(fieldName)) {
deserializedAutomationAccountProperties.disableLocalAuth
= reader.getNullable(JsonReader::getBoolean);
} else if ("automationHybridServiceUrl".equals(fieldName)) {
deserializedAutomationAccountProperties.automationHybridServiceUrl = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedAutomationAccountProperties;
});
}
}