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

com.azure.resourcemanager.automation.fluent.models.AutomationAccountCreateOrUpdateProperties 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.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.automation.models.EncryptionProperties;
import com.azure.resourcemanager.automation.models.Sku;
import java.io.IOException;

/**
 * The parameters supplied to the create or update account properties.
 */
@Fluent
public final class AutomationAccountCreateOrUpdateProperties
    implements JsonSerializable {
    /*
     * Gets or sets account SKU.
     */
    private Sku sku;

    /*
     * Set the encryption properties for the automation account
     */
    private EncryptionProperties encryption;

    /*
     * 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;

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

    /**
     * Get the sku property: Gets or sets account SKU.
     * 
     * @return the sku value.
     */
    public Sku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: Gets or sets account SKU.
     * 
     * @param sku the sku value to set.
     * @return the AutomationAccountCreateOrUpdateProperties object itself.
     */
    public AutomationAccountCreateOrUpdateProperties withSku(Sku sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the encryption property: Set the encryption properties for the automation account.
     * 
     * @return the encryption value.
     */
    public EncryptionProperties encryption() {
        return this.encryption;
    }

    /**
     * Set the encryption property: Set the encryption properties for the automation account.
     * 
     * @param encryption the encryption value to set.
     * @return the AutomationAccountCreateOrUpdateProperties object itself.
     */
    public AutomationAccountCreateOrUpdateProperties withEncryption(EncryptionProperties encryption) {
        this.encryption = encryption;
        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 AutomationAccountCreateOrUpdateProperties object itself.
     */
    public AutomationAccountCreateOrUpdateProperties 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 AutomationAccountCreateOrUpdateProperties object itself.
     */
    public AutomationAccountCreateOrUpdateProperties withDisableLocalAuth(Boolean disableLocalAuth) {
        this.disableLocalAuth = disableLocalAuth;
        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();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("sku", this.sku);
        jsonWriter.writeJsonField("encryption", this.encryption);
        jsonWriter.writeBooleanField("publicNetworkAccess", this.publicNetworkAccess);
        jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth);
        return jsonWriter.writeEndObject();
    }

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

                if ("sku".equals(fieldName)) {
                    deserializedAutomationAccountCreateOrUpdateProperties.sku = Sku.fromJson(reader);
                } else if ("encryption".equals(fieldName)) {
                    deserializedAutomationAccountCreateOrUpdateProperties.encryption
                        = EncryptionProperties.fromJson(reader);
                } else if ("publicNetworkAccess".equals(fieldName)) {
                    deserializedAutomationAccountCreateOrUpdateProperties.publicNetworkAccess
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("disableLocalAuth".equals(fieldName)) {
                    deserializedAutomationAccountCreateOrUpdateProperties.disableLocalAuth
                        = reader.getNullable(JsonReader::getBoolean);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAutomationAccountCreateOrUpdateProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy