// 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.fasterxml.jackson.annotation.JsonProperty;

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

    /*
     * The ID of a Virtual Network where this Databricks Cluster should be created
     */
    @JsonProperty(value = "customVirtualNetworkId")
    private WorkspaceCustomStringParameter customVirtualNetworkId;

    /*
     * The name of a Public Subnet within the Virtual Network
     */
    @JsonProperty(value = "customPublicSubnetName")
    private WorkspaceCustomStringParameter customPublicSubnetName;

    /*
     * The name of the Private Subnet within the Virtual Network
     */
    @JsonProperty(value = "customPrivateSubnetName")
    private WorkspaceCustomStringParameter customPrivateSubnetName;

    /*
     * Should the Public IP be Disabled?
     */
    @JsonProperty(value = "enableNoPublicIp")
    private WorkspaceCustomBooleanParameter enableNoPublicIp;

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

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

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

    /*
     * Name of the Public IP for No Public IP workspace with managed vNet.
     */
    @JsonProperty(value = "publicIpName")
    private WorkspaceCustomStringParameter publicIpName;

    /*
     * Prepare the workspace for encryption. Enables the Managed Identity for managed storage account.
     */
    @JsonProperty(value = "prepareEncryption")
    private WorkspaceCustomBooleanParameter prepareEncryption;

    /*
     * Contains the encryption details for Customer-Managed Key (CMK) enabled workspace.
     */
    @JsonProperty(value = "encryption")
    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.
     */
    @JsonProperty(value = "requireInfrastructureEncryption")
    private WorkspaceCustomBooleanParameter requireInfrastructureEncryption;

    /*
     * Default DBFS storage account name.
     */
    @JsonProperty(value = "storageAccountName")
    private WorkspaceCustomStringParameter storageAccountName;

    /*
     * Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer https://aka.ms/storageskus for valid inputs.
     */
    @JsonProperty(value = "storageAccountSkuName")
    private WorkspaceCustomStringParameter storageAccountSkuName;

    /*
     * Address prefix for Managed virtual network. Default value for this input is 10.139.
     */
    @JsonProperty(value = "vnetAddressPrefix")
    private WorkspaceCustomStringParameter vnetAddressPrefix;

    /*
     * Tags applied to resources under Managed resource group. These can be updated by updating tags at workspace
     * level.
     */
    @JsonProperty(value = "resourceTags", access = JsonProperty.Access.WRITE_ONLY)
    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();
        }
    }
}
