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

package com.azure.resourcemanager.networkcloud.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.networkcloud.fluent.models.ClusterPatchProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** ClusterPatchParameters represents the body of the request to patch the cluster properties. */
@Fluent
public final class ClusterPatchParameters {
    /*
     * ClusterPatchProperties represents the properties of the cluster for patching.
     *
     * The list of the resource properties.
     */
    @JsonProperty(value = "properties")
    private ClusterPatchProperties innerProperties;

    /*
     * The Azure resource tags that will replace the existing ones.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

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

    /**
     * Get the innerProperties property: ClusterPatchProperties represents the properties of the cluster for patching.
     *
     * <p>The list of the resource properties.
     *
     * @return the innerProperties value.
     */
    private ClusterPatchProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tags property: The Azure resource tags that will replace the existing ones.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: The Azure resource tags that will replace the existing ones.
     *
     * @param tags the tags value to set.
     * @return the ClusterPatchParameters object itself.
     */
    public ClusterPatchParameters withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack.
     *
     * <p>The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator
     * rack in a multi-rack cluster.
     *
     * @return the aggregatorOrSingleRackDefinition value.
     */
    public RackDefinition aggregatorOrSingleRackDefinition() {
        return this.innerProperties() == null ? null : this.innerProperties().aggregatorOrSingleRackDefinition();
    }

    /**
     * Set the aggregatorOrSingleRackDefinition property: RackDefinition represents details regarding the rack.
     *
     * <p>The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator
     * rack in a multi-rack cluster.
     *
     * @param aggregatorOrSingleRackDefinition the aggregatorOrSingleRackDefinition value to set.
     * @return the ClusterPatchParameters object itself.
     */
    public ClusterPatchParameters withAggregatorOrSingleRackDefinition(
        RackDefinition aggregatorOrSingleRackDefinition) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withAggregatorOrSingleRackDefinition(aggregatorOrSingleRackDefinition);
        return this;
    }

    /**
     * Get the clusterLocation property: The customer-provided location information to identify where the cluster
     * resides.
     *
     * @return the clusterLocation value.
     */
    public String clusterLocation() {
        return this.innerProperties() == null ? null : this.innerProperties().clusterLocation();
    }

    /**
     * Set the clusterLocation property: The customer-provided location information to identify where the cluster
     * resides.
     *
     * @param clusterLocation the clusterLocation value to set.
     * @return the ClusterPatchParameters object itself.
     */
    public ClusterPatchParameters withClusterLocation(String clusterLocation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withClusterLocation(clusterLocation);
        return this;
    }

    /**
     * Get the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service
     * principal to be used by the cluster during Arc Appliance installation.
     *
     * <p>The service principal to be used by the cluster during Arc Appliance installation.
     *
     * @return the clusterServicePrincipal value.
     */
    public ServicePrincipalInformation clusterServicePrincipal() {
        return this.innerProperties() == null ? null : this.innerProperties().clusterServicePrincipal();
    }

    /**
     * Set the clusterServicePrincipal property: ServicePrincipalInformation represents the details of the service
     * principal to be used by the cluster during Arc Appliance installation.
     *
     * <p>The service principal to be used by the cluster during Arc Appliance installation.
     *
     * @param clusterServicePrincipal the clusterServicePrincipal value to set.
     * @return the ClusterPatchParameters object itself.
     */
    public ClusterPatchParameters withClusterServicePrincipal(ServicePrincipalInformation clusterServicePrincipal) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withClusterServicePrincipal(clusterServicePrincipal);
        return this;
    }

    /**
     * Get the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and
     * deployment failures.
     *
     * <p>The validation threshold indicating the allowable failures of compute machines during environment validation
     * and deployment.
     *
     * @return the computeDeploymentThreshold value.
     */
    public ValidationThreshold computeDeploymentThreshold() {
        return this.innerProperties() == null ? null : this.innerProperties().computeDeploymentThreshold();
    }

    /**
     * Set the computeDeploymentThreshold property: ValidationThreshold indicates allowed machine and node hardware and
     * deployment failures.
     *
     * <p>The validation threshold indicating the allowable failures of compute machines during environment validation
     * and deployment.
     *
     * @param computeDeploymentThreshold the computeDeploymentThreshold value to set.
     * @return the ClusterPatchParameters object itself.
     */
    public ClusterPatchParameters withComputeDeploymentThreshold(ValidationThreshold computeDeploymentThreshold) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withComputeDeploymentThreshold(computeDeploymentThreshold);
        return this;
    }

    /**
     * Get the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack
     * cluster, or an empty list in a single-rack cluster.
     *
     * @return the computeRackDefinitions value.
     */
    public List<RackDefinition> computeRackDefinitions() {
        return this.innerProperties() == null ? null : this.innerProperties().computeRackDefinitions();
    }

    /**
     * Set the computeRackDefinitions property: The list of rack definitions for the compute racks in a multi-rack
     * cluster, or an empty list in a single-rack cluster.
     *
     * @param computeRackDefinitions the computeRackDefinitions value to set.
     * @return the ClusterPatchParameters object itself.
     */
    public ClusterPatchParameters withComputeRackDefinitions(List<RackDefinition> computeRackDefinitions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withComputeRackDefinitions(computeRackDefinitions);
        return this;
    }

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