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

com.azure.resourcemanager.databricks.models.WorkspaceCustomParameters 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.databricks.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;

/**
 * Custom Parameters used for Cluster Creation.
 */
@Fluent
public final class WorkspaceCustomParameters implements JsonSerializable {
    /*
     * The ID of a Azure Machine Learning workspace to link with Databricks workspace
     */
    private WorkspaceCustomStringParameter amlWorkspaceId;

    /*
     * The ID of a Virtual Network where this Databricks Cluster should be created
     */
    private WorkspaceCustomStringParameter customVirtualNetworkId;

    /*
     * The name of a Public Subnet within the Virtual Network
     */
    private WorkspaceCustomStringParameter customPublicSubnetName;

    /*
     * The name of the Private Subnet within the Virtual Network
     */
    private WorkspaceCustomStringParameter customPrivateSubnetName;

    /*
     * Should the Public IP be Disabled?
     */
    private WorkspaceCustomBooleanParameter enableNoPublicIp;

    /*
     * Name of the outbound Load Balancer Backend Pool for Secure Cluster Connectivity (No Public IP).
     */
    private WorkspaceCustomStringParameter loadBalancerBackendPoolName;

    /*
     * Resource URI of Outbound Load balancer for Secure Cluster Connectivity (No Public IP) workspace.
     */
    private WorkspaceCustomStringParameter loadBalancerId;

    /*
     * Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) workspace subnets.
     */
    private WorkspaceCustomStringParameter natGatewayName;

    /*
     * Name of the Public IP for No Public IP workspace with managed vNet.
     */
    private WorkspaceCustomStringParameter publicIpName;

    /*
     * Prepare the workspace for encryption. Enables the Managed Identity for managed storage account.
     */
    private WorkspaceCustomBooleanParameter prepareEncryption;

    /*
     * Contains the encryption details for Customer-Managed Key (CMK) enabled workspace.
     */
    private WorkspaceEncryptionParameter encryption;

    /*
     * A boolean indicating whether or not the DBFS root file system will be enabled with secondary layer of encryption
     * with platform managed keys for data at rest.
     */
    private WorkspaceCustomBooleanParameter requireInfrastructureEncryption;

    /*
     * Default DBFS storage account name.
     */
    private WorkspaceCustomStringParameter storageAccountName;

    /*
     * Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer https://aka.ms/storageskus for valid inputs.
     */
    private WorkspaceCustomStringParameter storageAccountSkuName;

    /*
     * Address prefix for Managed virtual network. Default value for this input is 10.139.
     */
    private WorkspaceCustomStringParameter vnetAddressPrefix;

    /*
     * Tags applied to resources under Managed resource group. These can be updated by updating tags at workspace level.
     */
    private WorkspaceCustomObjectParameter resourceTags;

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

    /**
     * Get the amlWorkspaceId property: The ID of a Azure Machine Learning workspace to link with Databricks workspace.
     * 
     * @return the amlWorkspaceId value.
     */
    public WorkspaceCustomStringParameter amlWorkspaceId() {
        return this.amlWorkspaceId;
    }

    /**
     * Set the amlWorkspaceId property: The ID of a Azure Machine Learning workspace to link with Databricks workspace.
     * 
     * @param amlWorkspaceId the amlWorkspaceId value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withAmlWorkspaceId(WorkspaceCustomStringParameter amlWorkspaceId) {
        this.amlWorkspaceId = amlWorkspaceId;
        return this;
    }

    /**
     * Get the customVirtualNetworkId property: The ID of a Virtual Network where this Databricks Cluster should be
     * created.
     * 
     * @return the customVirtualNetworkId value.
     */
    public WorkspaceCustomStringParameter customVirtualNetworkId() {
        return this.customVirtualNetworkId;
    }

    /**
     * Set the customVirtualNetworkId property: The ID of a Virtual Network where this Databricks Cluster should be
     * created.
     * 
     * @param customVirtualNetworkId the customVirtualNetworkId value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withCustomVirtualNetworkId(WorkspaceCustomStringParameter customVirtualNetworkId) {
        this.customVirtualNetworkId = customVirtualNetworkId;
        return this;
    }

    /**
     * Get the customPublicSubnetName property: The name of a Public Subnet within the Virtual Network.
     * 
     * @return the customPublicSubnetName value.
     */
    public WorkspaceCustomStringParameter customPublicSubnetName() {
        return this.customPublicSubnetName;
    }

    /**
     * Set the customPublicSubnetName property: The name of a Public Subnet within the Virtual Network.
     * 
     * @param customPublicSubnetName the customPublicSubnetName value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withCustomPublicSubnetName(WorkspaceCustomStringParameter customPublicSubnetName) {
        this.customPublicSubnetName = customPublicSubnetName;
        return this;
    }

    /**
     * Get the customPrivateSubnetName property: The name of the Private Subnet within the Virtual Network.
     * 
     * @return the customPrivateSubnetName value.
     */
    public WorkspaceCustomStringParameter customPrivateSubnetName() {
        return this.customPrivateSubnetName;
    }

    /**
     * Set the customPrivateSubnetName property: The name of the Private Subnet within the Virtual Network.
     * 
     * @param customPrivateSubnetName the customPrivateSubnetName value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters
        withCustomPrivateSubnetName(WorkspaceCustomStringParameter customPrivateSubnetName) {
        this.customPrivateSubnetName = customPrivateSubnetName;
        return this;
    }

    /**
     * Get the enableNoPublicIp property: Should the Public IP be Disabled?.
     * 
     * @return the enableNoPublicIp value.
     */
    public WorkspaceCustomBooleanParameter enableNoPublicIp() {
        return this.enableNoPublicIp;
    }

    /**
     * Set the enableNoPublicIp property: Should the Public IP be Disabled?.
     * 
     * @param enableNoPublicIp the enableNoPublicIp value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withEnableNoPublicIp(WorkspaceCustomBooleanParameter enableNoPublicIp) {
        this.enableNoPublicIp = enableNoPublicIp;
        return this;
    }

    /**
     * Get the loadBalancerBackendPoolName property: Name of the outbound Load Balancer Backend Pool for Secure Cluster
     * Connectivity (No Public IP).
     * 
     * @return the loadBalancerBackendPoolName value.
     */
    public WorkspaceCustomStringParameter loadBalancerBackendPoolName() {
        return this.loadBalancerBackendPoolName;
    }

    /**
     * Set the loadBalancerBackendPoolName property: Name of the outbound Load Balancer Backend Pool for Secure Cluster
     * Connectivity (No Public IP).
     * 
     * @param loadBalancerBackendPoolName the loadBalancerBackendPoolName value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters
        withLoadBalancerBackendPoolName(WorkspaceCustomStringParameter loadBalancerBackendPoolName) {
        this.loadBalancerBackendPoolName = loadBalancerBackendPoolName;
        return this;
    }

    /**
     * Get the loadBalancerId property: Resource URI of Outbound Load balancer for Secure Cluster Connectivity (No
     * Public IP) workspace.
     * 
     * @return the loadBalancerId value.
     */
    public WorkspaceCustomStringParameter loadBalancerId() {
        return this.loadBalancerId;
    }

    /**
     * Set the loadBalancerId property: Resource URI of Outbound Load balancer for Secure Cluster Connectivity (No
     * Public IP) workspace.
     * 
     * @param loadBalancerId the loadBalancerId value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withLoadBalancerId(WorkspaceCustomStringParameter loadBalancerId) {
        this.loadBalancerId = loadBalancerId;
        return this;
    }

    /**
     * Get the natGatewayName property: Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) workspace
     * subnets.
     * 
     * @return the natGatewayName value.
     */
    public WorkspaceCustomStringParameter natGatewayName() {
        return this.natGatewayName;
    }

    /**
     * Set the natGatewayName property: Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) workspace
     * subnets.
     * 
     * @param natGatewayName the natGatewayName value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withNatGatewayName(WorkspaceCustomStringParameter natGatewayName) {
        this.natGatewayName = natGatewayName;
        return this;
    }

    /**
     * Get the publicIpName property: Name of the Public IP for No Public IP workspace with managed vNet.
     * 
     * @return the publicIpName value.
     */
    public WorkspaceCustomStringParameter publicIpName() {
        return this.publicIpName;
    }

    /**
     * Set the publicIpName property: Name of the Public IP for No Public IP workspace with managed vNet.
     * 
     * @param publicIpName the publicIpName value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withPublicIpName(WorkspaceCustomStringParameter publicIpName) {
        this.publicIpName = publicIpName;
        return this;
    }

    /**
     * Get the prepareEncryption property: Prepare the workspace for encryption. Enables the Managed Identity for
     * managed storage account.
     * 
     * @return the prepareEncryption value.
     */
    public WorkspaceCustomBooleanParameter prepareEncryption() {
        return this.prepareEncryption;
    }

    /**
     * Set the prepareEncryption property: Prepare the workspace for encryption. Enables the Managed Identity for
     * managed storage account.
     * 
     * @param prepareEncryption the prepareEncryption value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withPrepareEncryption(WorkspaceCustomBooleanParameter prepareEncryption) {
        this.prepareEncryption = prepareEncryption;
        return this;
    }

    /**
     * Get the encryption property: Contains the encryption details for Customer-Managed Key (CMK) enabled workspace.
     * 
     * @return the encryption value.
     */
    public WorkspaceEncryptionParameter encryption() {
        return this.encryption;
    }

    /**
     * Set the encryption property: Contains the encryption details for Customer-Managed Key (CMK) enabled workspace.
     * 
     * @param encryption the encryption value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withEncryption(WorkspaceEncryptionParameter encryption) {
        this.encryption = encryption;
        return this;
    }

    /**
     * Get the requireInfrastructureEncryption property: A boolean indicating whether or not the DBFS root file system
     * will be enabled with secondary layer of encryption with platform managed keys for data at rest.
     * 
     * @return the requireInfrastructureEncryption value.
     */
    public WorkspaceCustomBooleanParameter requireInfrastructureEncryption() {
        return this.requireInfrastructureEncryption;
    }

    /**
     * Set the requireInfrastructureEncryption property: A boolean indicating whether or not the DBFS root file system
     * will be enabled with secondary layer of encryption with platform managed keys for data at rest.
     * 
     * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters
        withRequireInfrastructureEncryption(WorkspaceCustomBooleanParameter requireInfrastructureEncryption) {
        this.requireInfrastructureEncryption = requireInfrastructureEncryption;
        return this;
    }

    /**
     * Get the storageAccountName property: Default DBFS storage account name.
     * 
     * @return the storageAccountName value.
     */
    public WorkspaceCustomStringParameter storageAccountName() {
        return this.storageAccountName;
    }

    /**
     * Set the storageAccountName property: Default DBFS storage account name.
     * 
     * @param storageAccountName the storageAccountName value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withStorageAccountName(WorkspaceCustomStringParameter storageAccountName) {
        this.storageAccountName = storageAccountName;
        return this;
    }

    /**
     * Get the storageAccountSkuName property: Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer
     * https://aka.ms/storageskus for valid inputs.
     * 
     * @return the storageAccountSkuName value.
     */
    public WorkspaceCustomStringParameter storageAccountSkuName() {
        return this.storageAccountSkuName;
    }

    /**
     * Set the storageAccountSkuName property: Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer
     * https://aka.ms/storageskus for valid inputs.
     * 
     * @param storageAccountSkuName the storageAccountSkuName value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withStorageAccountSkuName(WorkspaceCustomStringParameter storageAccountSkuName) {
        this.storageAccountSkuName = storageAccountSkuName;
        return this;
    }

    /**
     * Get the vnetAddressPrefix property: Address prefix for Managed virtual network. Default value for this input is
     * 10.139.
     * 
     * @return the vnetAddressPrefix value.
     */
    public WorkspaceCustomStringParameter vnetAddressPrefix() {
        return this.vnetAddressPrefix;
    }

    /**
     * Set the vnetAddressPrefix property: Address prefix for Managed virtual network. Default value for this input is
     * 10.139.
     * 
     * @param vnetAddressPrefix the vnetAddressPrefix value to set.
     * @return the WorkspaceCustomParameters object itself.
     */
    public WorkspaceCustomParameters withVnetAddressPrefix(WorkspaceCustomStringParameter vnetAddressPrefix) {
        this.vnetAddressPrefix = vnetAddressPrefix;
        return this;
    }

    /**
     * Get the resourceTags property: Tags applied to resources under Managed resource group. These can be updated by
     * updating tags at workspace level.
     * 
     * @return the resourceTags value.
     */
    public WorkspaceCustomObjectParameter resourceTags() {
        return this.resourceTags;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (amlWorkspaceId() != null) {
            amlWorkspaceId().validate();
        }
        if (customVirtualNetworkId() != null) {
            customVirtualNetworkId().validate();
        }
        if (customPublicSubnetName() != null) {
            customPublicSubnetName().validate();
        }
        if (customPrivateSubnetName() != null) {
            customPrivateSubnetName().validate();
        }
        if (enableNoPublicIp() != null) {
            enableNoPublicIp().validate();
        }
        if (loadBalancerBackendPoolName() != null) {
            loadBalancerBackendPoolName().validate();
        }
        if (loadBalancerId() != null) {
            loadBalancerId().validate();
        }
        if (natGatewayName() != null) {
            natGatewayName().validate();
        }
        if (publicIpName() != null) {
            publicIpName().validate();
        }
        if (prepareEncryption() != null) {
            prepareEncryption().validate();
        }
        if (encryption() != null) {
            encryption().validate();
        }
        if (requireInfrastructureEncryption() != null) {
            requireInfrastructureEncryption().validate();
        }
        if (storageAccountName() != null) {
            storageAccountName().validate();
        }
        if (storageAccountSkuName() != null) {
            storageAccountSkuName().validate();
        }
        if (vnetAddressPrefix() != null) {
            vnetAddressPrefix().validate();
        }
        if (resourceTags() != null) {
            resourceTags().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("amlWorkspaceId", this.amlWorkspaceId);
        jsonWriter.writeJsonField("customVirtualNetworkId", this.customVirtualNetworkId);
        jsonWriter.writeJsonField("customPublicSubnetName", this.customPublicSubnetName);
        jsonWriter.writeJsonField("customPrivateSubnetName", this.customPrivateSubnetName);
        jsonWriter.writeJsonField("enableNoPublicIp", this.enableNoPublicIp);
        jsonWriter.writeJsonField("loadBalancerBackendPoolName", this.loadBalancerBackendPoolName);
        jsonWriter.writeJsonField("loadBalancerId", this.loadBalancerId);
        jsonWriter.writeJsonField("natGatewayName", this.natGatewayName);
        jsonWriter.writeJsonField("publicIpName", this.publicIpName);
        jsonWriter.writeJsonField("prepareEncryption", this.prepareEncryption);
        jsonWriter.writeJsonField("encryption", this.encryption);
        jsonWriter.writeJsonField("requireInfrastructureEncryption", this.requireInfrastructureEncryption);
        jsonWriter.writeJsonField("storageAccountName", this.storageAccountName);
        jsonWriter.writeJsonField("storageAccountSkuName", this.storageAccountSkuName);
        jsonWriter.writeJsonField("vnetAddressPrefix", this.vnetAddressPrefix);
        return jsonWriter.writeEndObject();
    }

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

                if ("amlWorkspaceId".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.amlWorkspaceId
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("customVirtualNetworkId".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.customVirtualNetworkId
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("customPublicSubnetName".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.customPublicSubnetName
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("customPrivateSubnetName".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.customPrivateSubnetName
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("enableNoPublicIp".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.enableNoPublicIp
                        = WorkspaceCustomBooleanParameter.fromJson(reader);
                } else if ("loadBalancerBackendPoolName".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.loadBalancerBackendPoolName
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("loadBalancerId".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.loadBalancerId
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("natGatewayName".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.natGatewayName
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("publicIpName".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.publicIpName
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("prepareEncryption".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.prepareEncryption
                        = WorkspaceCustomBooleanParameter.fromJson(reader);
                } else if ("encryption".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.encryption = WorkspaceEncryptionParameter.fromJson(reader);
                } else if ("requireInfrastructureEncryption".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.requireInfrastructureEncryption
                        = WorkspaceCustomBooleanParameter.fromJson(reader);
                } else if ("storageAccountName".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.storageAccountName
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("storageAccountSkuName".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.storageAccountSkuName
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("vnetAddressPrefix".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.vnetAddressPrefix
                        = WorkspaceCustomStringParameter.fromJson(reader);
                } else if ("resourceTags".equals(fieldName)) {
                    deserializedWorkspaceCustomParameters.resourceTags
                        = WorkspaceCustomObjectParameter.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedWorkspaceCustomParameters;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy