// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The SynapseSparkProperties model. */
@Fluent
public final class SynapseSparkProperties {
    /*
     * Auto scale properties.
     */
    @JsonProperty(value = "autoScaleProperties")
    private AutoScaleProperties autoScaleProperties;

    /*
     * Auto pause properties.
     */
    @JsonProperty(value = "autoPauseProperties")
    private AutoPauseProperties autoPauseProperties;

    /*
     * Spark version.
     */
    @JsonProperty(value = "sparkVersion")
    private String sparkVersion;

    /*
     * The number of compute nodes currently assigned to the compute.
     */
    @JsonProperty(value = "nodeCount")
    private Integer nodeCount;

    /*
     * Node size.
     */
    @JsonProperty(value = "nodeSize")
    private String nodeSize;

    /*
     * Node size family.
     */
    @JsonProperty(value = "nodeSizeFamily")
    private String nodeSizeFamily;

    /*
     * Azure subscription identifier.
     */
    @JsonProperty(value = "subscriptionId")
    private String subscriptionId;

    /*
     * Name of the resource group in which workspace is located.
     */
    @JsonProperty(value = "resourceGroup")
    private String resourceGroup;

    /*
     * Name of Azure Machine Learning workspace.
     */
    @JsonProperty(value = "workspaceName")
    private String workspaceName;

    /*
     * Pool name.
     */
    @JsonProperty(value = "poolName")
    private String poolName;

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

    /**
     * Get the autoScaleProperties property: Auto scale properties.
     *
     * @return the autoScaleProperties value.
     */
    public AutoScaleProperties autoScaleProperties() {
        return this.autoScaleProperties;
    }

    /**
     * Set the autoScaleProperties property: Auto scale properties.
     *
     * @param autoScaleProperties the autoScaleProperties value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withAutoScaleProperties(AutoScaleProperties autoScaleProperties) {
        this.autoScaleProperties = autoScaleProperties;
        return this;
    }

    /**
     * Get the autoPauseProperties property: Auto pause properties.
     *
     * @return the autoPauseProperties value.
     */
    public AutoPauseProperties autoPauseProperties() {
        return this.autoPauseProperties;
    }

    /**
     * Set the autoPauseProperties property: Auto pause properties.
     *
     * @param autoPauseProperties the autoPauseProperties value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withAutoPauseProperties(AutoPauseProperties autoPauseProperties) {
        this.autoPauseProperties = autoPauseProperties;
        return this;
    }

    /**
     * Get the sparkVersion property: Spark version.
     *
     * @return the sparkVersion value.
     */
    public String sparkVersion() {
        return this.sparkVersion;
    }

    /**
     * Set the sparkVersion property: Spark version.
     *
     * @param sparkVersion the sparkVersion value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withSparkVersion(String sparkVersion) {
        this.sparkVersion = sparkVersion;
        return this;
    }

    /**
     * Get the nodeCount property: The number of compute nodes currently assigned to the compute.
     *
     * @return the nodeCount value.
     */
    public Integer nodeCount() {
        return this.nodeCount;
    }

    /**
     * Set the nodeCount property: The number of compute nodes currently assigned to the compute.
     *
     * @param nodeCount the nodeCount value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withNodeCount(Integer nodeCount) {
        this.nodeCount = nodeCount;
        return this;
    }

    /**
     * Get the nodeSize property: Node size.
     *
     * @return the nodeSize value.
     */
    public String nodeSize() {
        return this.nodeSize;
    }

    /**
     * Set the nodeSize property: Node size.
     *
     * @param nodeSize the nodeSize value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withNodeSize(String nodeSize) {
        this.nodeSize = nodeSize;
        return this;
    }

    /**
     * Get the nodeSizeFamily property: Node size family.
     *
     * @return the nodeSizeFamily value.
     */
    public String nodeSizeFamily() {
        return this.nodeSizeFamily;
    }

    /**
     * Set the nodeSizeFamily property: Node size family.
     *
     * @param nodeSizeFamily the nodeSizeFamily value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withNodeSizeFamily(String nodeSizeFamily) {
        this.nodeSizeFamily = nodeSizeFamily;
        return this;
    }

    /**
     * Get the subscriptionId property: Azure subscription identifier.
     *
     * @return the subscriptionId value.
     */
    public String subscriptionId() {
        return this.subscriptionId;
    }

    /**
     * Set the subscriptionId property: Azure subscription identifier.
     *
     * @param subscriptionId the subscriptionId value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withSubscriptionId(String subscriptionId) {
        this.subscriptionId = subscriptionId;
        return this;
    }

    /**
     * Get the resourceGroup property: Name of the resource group in which workspace is located.
     *
     * @return the resourceGroup value.
     */
    public String resourceGroup() {
        return this.resourceGroup;
    }

    /**
     * Set the resourceGroup property: Name of the resource group in which workspace is located.
     *
     * @param resourceGroup the resourceGroup value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withResourceGroup(String resourceGroup) {
        this.resourceGroup = resourceGroup;
        return this;
    }

    /**
     * Get the workspaceName property: Name of Azure Machine Learning workspace.
     *
     * @return the workspaceName value.
     */
    public String workspaceName() {
        return this.workspaceName;
    }

    /**
     * Set the workspaceName property: Name of Azure Machine Learning workspace.
     *
     * @param workspaceName the workspaceName value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withWorkspaceName(String workspaceName) {
        this.workspaceName = workspaceName;
        return this;
    }

    /**
     * Get the poolName property: Pool name.
     *
     * @return the poolName value.
     */
    public String poolName() {
        return this.poolName;
    }

    /**
     * Set the poolName property: Pool name.
     *
     * @param poolName the poolName value to set.
     * @return the SynapseSparkProperties object itself.
     */
    public SynapseSparkProperties withPoolName(String poolName) {
        this.poolName = poolName;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (autoScaleProperties() != null) {
            autoScaleProperties().validate();
        }
        if (autoPauseProperties() != null) {
            autoPauseProperties().validate();
        }
    }
}
