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

package com.azure.resourcemanager.azurestackhci.models;

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

/** Cluster details to update. */
@Fluent
public final class ClusterPatch {
    /*
     * Resource tags.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /*
     * Cluster properties.
     */
    @JsonProperty(value = "properties")
    private ClusterPatchProperties innerProperties;

    /**
     * Get the tags property: Resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Resource tags.
     *
     * @param tags the tags value to set.
     * @return the ClusterPatch object itself.
     */
    public ClusterPatch withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the innerProperties property: Cluster properties.
     *
     * @return the innerProperties value.
     */
    private ClusterPatchProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal.
     *
     * @return the cloudManagementEndpoint value.
     */
    public String cloudManagementEndpoint() {
        return this.innerProperties() == null ? null : this.innerProperties().cloudManagementEndpoint();
    }

    /**
     * Set the cloudManagementEndpoint property: Endpoint configured for management from the Azure portal.
     *
     * @param cloudManagementEndpoint the cloudManagementEndpoint value to set.
     * @return the ClusterPatch object itself.
     */
    public ClusterPatch withCloudManagementEndpoint(String cloudManagementEndpoint) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withCloudManagementEndpoint(cloudManagementEndpoint);
        return this;
    }

    /**
     * Get the aadClientId property: App id of cluster AAD identity.
     *
     * @return the aadClientId value.
     */
    public String aadClientId() {
        return this.innerProperties() == null ? null : this.innerProperties().aadClientId();
    }

    /**
     * Set the aadClientId property: App id of cluster AAD identity.
     *
     * @param aadClientId the aadClientId value to set.
     * @return the ClusterPatch object itself.
     */
    public ClusterPatch withAadClientId(String aadClientId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withAadClientId(aadClientId);
        return this;
    }

    /**
     * Get the aadTenantId property: Tenant id of cluster AAD identity.
     *
     * @return the aadTenantId value.
     */
    public String aadTenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().aadTenantId();
    }

    /**
     * Set the aadTenantId property: Tenant id of cluster AAD identity.
     *
     * @param aadTenantId the aadTenantId value to set.
     * @return the ClusterPatch object itself.
     */
    public ClusterPatch withAadTenantId(String aadTenantId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withAadTenantId(aadTenantId);
        return this;
    }

    /**
     * Get the desiredProperties property: Desired properties of the cluster.
     *
     * @return the desiredProperties value.
     */
    public ClusterDesiredProperties desiredProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().desiredProperties();
    }

    /**
     * Set the desiredProperties property: Desired properties of the cluster.
     *
     * @param desiredProperties the desiredProperties value to set.
     * @return the ClusterPatch object itself.
     */
    public ClusterPatch withDesiredProperties(ClusterDesiredProperties desiredProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPatchProperties();
        }
        this.innerProperties().withDesiredProperties(desiredProperties);
        return this;
    }

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