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

package com.azure.resourcemanager.hdinsight.containers.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Cluster resource patch properties. */
@Fluent
public final class UpdatableClusterProfile {
    /*
     * The service configs profiles.
     */
    @JsonProperty(value = "serviceConfigsProfiles")
    private List<ClusterServiceConfigsProfile> serviceConfigsProfiles;

    /*
     * Ssh profile for the cluster.
     */
    @JsonProperty(value = "sshProfile")
    private SshProfile sshProfile;

    /*
     * This is the Autoscale profile for the cluster. This will allow customer to create cluster enabled with
     * Autoscale.
     */
    @JsonProperty(value = "autoscaleProfile")
    private AutoscaleProfile autoscaleProfile;

    /*
     * Authorization profile with details of AAD user Ids and group Ids authorized for data plane access.
     */
    @JsonProperty(value = "authorizationProfile")
    private AuthorizationProfile authorizationProfile;

    /*
     * Cluster log analytics profile to enable or disable OMS agent for cluster.
     */
    @JsonProperty(value = "logAnalyticsProfile")
    private ClusterLogAnalyticsProfile logAnalyticsProfile;

    /*
     * Cluster Prometheus profile.
     */
    @JsonProperty(value = "prometheusProfile")
    private ClusterPrometheusProfile prometheusProfile;

    /*
     * The script action profile list.
     */
    @JsonProperty(value = "scriptActionProfiles")
    private List<ScriptActionProfile> scriptActionProfiles;

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

    /**
     * Get the serviceConfigsProfiles property: The service configs profiles.
     *
     * @return the serviceConfigsProfiles value.
     */
    public List<ClusterServiceConfigsProfile> serviceConfigsProfiles() {
        return this.serviceConfigsProfiles;
    }

    /**
     * Set the serviceConfigsProfiles property: The service configs profiles.
     *
     * @param serviceConfigsProfiles the serviceConfigsProfiles value to set.
     * @return the UpdatableClusterProfile object itself.
     */
    public UpdatableClusterProfile withServiceConfigsProfiles(
        List<ClusterServiceConfigsProfile> serviceConfigsProfiles) {
        this.serviceConfigsProfiles = serviceConfigsProfiles;
        return this;
    }

    /**
     * Get the sshProfile property: Ssh profile for the cluster.
     *
     * @return the sshProfile value.
     */
    public SshProfile sshProfile() {
        return this.sshProfile;
    }

    /**
     * Set the sshProfile property: Ssh profile for the cluster.
     *
     * @param sshProfile the sshProfile value to set.
     * @return the UpdatableClusterProfile object itself.
     */
    public UpdatableClusterProfile withSshProfile(SshProfile sshProfile) {
        this.sshProfile = sshProfile;
        return this;
    }

    /**
     * Get the autoscaleProfile property: This is the Autoscale profile for the cluster. This will allow customer to
     * create cluster enabled with Autoscale.
     *
     * @return the autoscaleProfile value.
     */
    public AutoscaleProfile autoscaleProfile() {
        return this.autoscaleProfile;
    }

    /**
     * Set the autoscaleProfile property: This is the Autoscale profile for the cluster. This will allow customer to
     * create cluster enabled with Autoscale.
     *
     * @param autoscaleProfile the autoscaleProfile value to set.
     * @return the UpdatableClusterProfile object itself.
     */
    public UpdatableClusterProfile withAutoscaleProfile(AutoscaleProfile autoscaleProfile) {
        this.autoscaleProfile = autoscaleProfile;
        return this;
    }

    /**
     * Get the authorizationProfile property: Authorization profile with details of AAD user Ids and group Ids
     * authorized for data plane access.
     *
     * @return the authorizationProfile value.
     */
    public AuthorizationProfile authorizationProfile() {
        return this.authorizationProfile;
    }

    /**
     * Set the authorizationProfile property: Authorization profile with details of AAD user Ids and group Ids
     * authorized for data plane access.
     *
     * @param authorizationProfile the authorizationProfile value to set.
     * @return the UpdatableClusterProfile object itself.
     */
    public UpdatableClusterProfile withAuthorizationProfile(AuthorizationProfile authorizationProfile) {
        this.authorizationProfile = authorizationProfile;
        return this;
    }

    /**
     * Get the logAnalyticsProfile property: Cluster log analytics profile to enable or disable OMS agent for cluster.
     *
     * @return the logAnalyticsProfile value.
     */
    public ClusterLogAnalyticsProfile logAnalyticsProfile() {
        return this.logAnalyticsProfile;
    }

    /**
     * Set the logAnalyticsProfile property: Cluster log analytics profile to enable or disable OMS agent for cluster.
     *
     * @param logAnalyticsProfile the logAnalyticsProfile value to set.
     * @return the UpdatableClusterProfile object itself.
     */
    public UpdatableClusterProfile withLogAnalyticsProfile(ClusterLogAnalyticsProfile logAnalyticsProfile) {
        this.logAnalyticsProfile = logAnalyticsProfile;
        return this;
    }

    /**
     * Get the prometheusProfile property: Cluster Prometheus profile.
     *
     * @return the prometheusProfile value.
     */
    public ClusterPrometheusProfile prometheusProfile() {
        return this.prometheusProfile;
    }

    /**
     * Set the prometheusProfile property: Cluster Prometheus profile.
     *
     * @param prometheusProfile the prometheusProfile value to set.
     * @return the UpdatableClusterProfile object itself.
     */
    public UpdatableClusterProfile withPrometheusProfile(ClusterPrometheusProfile prometheusProfile) {
        this.prometheusProfile = prometheusProfile;
        return this;
    }

    /**
     * Get the scriptActionProfiles property: The script action profile list.
     *
     * @return the scriptActionProfiles value.
     */
    public List<ScriptActionProfile> scriptActionProfiles() {
        return this.scriptActionProfiles;
    }

    /**
     * Set the scriptActionProfiles property: The script action profile list.
     *
     * @param scriptActionProfiles the scriptActionProfiles value to set.
     * @return the UpdatableClusterProfile object itself.
     */
    public UpdatableClusterProfile withScriptActionProfiles(List<ScriptActionProfile> scriptActionProfiles) {
        this.scriptActionProfiles = scriptActionProfiles;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (serviceConfigsProfiles() != null) {
            serviceConfigsProfiles().forEach(e -> e.validate());
        }
        if (sshProfile() != null) {
            sshProfile().validate();
        }
        if (autoscaleProfile() != null) {
            autoscaleProfile().validate();
        }
        if (authorizationProfile() != null) {
            authorizationProfile().validate();
        }
        if (logAnalyticsProfile() != null) {
            logAnalyticsProfile().validate();
        }
        if (prometheusProfile() != null) {
            prometheusProfile().validate();
        }
        if (scriptActionProfiles() != null) {
            scriptActionProfiles().forEach(e -> e.validate());
        }
    }
}
