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

package com.azure.resourcemanager.hybridcontainerservice.models;

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

/** All properties of the provisioned cluster. */
@Fluent
public final class ProvisionedClustersAllProperties extends ProvisionedClustersPropertiesWithSecrets {
    /*
     * EnableRBAC - Whether to enable Kubernetes Role-Based Access Control.
     */
    @JsonProperty(value = "enableRbac")
    private Boolean enableRbac;

    /*
     * LinuxProfile - The profile for Linux VMs in the Provisioned Cluster.
     */
    @JsonProperty(value = "linuxProfile")
    private LinuxProfileProperties linuxProfile;

    /*
     * Additional features specs like Arc Agent Onboarding.
     */
    @JsonProperty(value = "features")
    private ProvisionedClustersCommonPropertiesFeatures features;

    /*
     * AddonProfiles - Profile of managed cluster add-on.
     */
    @JsonProperty(value = "addonProfiles")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, AddonProfiles> addonProfiles;

    /*
     * ControlPlane - ControlPlane Configuration
     */
    @JsonProperty(value = "controlPlane")
    private ControlPlaneProfile controlPlane;

    /*
     * KubernetesVersion - Version of Kubernetes specified when creating the managed cluster.
     */
    @JsonProperty(value = "kubernetesVersion")
    private String kubernetesVersion;

    /*
     * NetworkProfile - Profile of network configuration.
     */
    @JsonProperty(value = "networkProfile")
    private NetworkProfile networkProfile;

    /*
     * NodeResourceGroup - Name of the resource group containing agent pool nodes.
     */
    @JsonProperty(value = "nodeResourceGroup")
    private String nodeResourceGroup;

    /*
     * The agent pools of the cluster.
     */
    @JsonProperty(value = "agentPoolProfiles")
    private List<NamedAgentPoolProfile> agentPoolProfiles;

    /*
     * The underlying cloud infra provider properties.
     */
    @JsonProperty(value = "cloudProviderProfile")
    private CloudProviderProfile cloudProviderProfile;

    /*
     * The provisioningState property.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * HybridAKSClusterStatus defines the observed state of HybridAKSCluster
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisionedClustersCommonPropertiesStatus status;

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

    /**
     * Get the enableRbac property: EnableRBAC - Whether to enable Kubernetes Role-Based Access Control.
     *
     * @return the enableRbac value.
     */
    public Boolean enableRbac() {
        return this.enableRbac;
    }

    /**
     * Set the enableRbac property: EnableRBAC - Whether to enable Kubernetes Role-Based Access Control.
     *
     * @param enableRbac the enableRbac value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withEnableRbac(Boolean enableRbac) {
        this.enableRbac = enableRbac;
        return this;
    }

    /**
     * Get the linuxProfile property: LinuxProfile - The profile for Linux VMs in the Provisioned Cluster.
     *
     * @return the linuxProfile value.
     */
    public LinuxProfileProperties linuxProfile() {
        return this.linuxProfile;
    }

    /**
     * Set the linuxProfile property: LinuxProfile - The profile for Linux VMs in the Provisioned Cluster.
     *
     * @param linuxProfile the linuxProfile value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withLinuxProfile(LinuxProfileProperties linuxProfile) {
        this.linuxProfile = linuxProfile;
        return this;
    }

    /**
     * Get the features property: Additional features specs like Arc Agent Onboarding.
     *
     * @return the features value.
     */
    public ProvisionedClustersCommonPropertiesFeatures features() {
        return this.features;
    }

    /**
     * Set the features property: Additional features specs like Arc Agent Onboarding.
     *
     * @param features the features value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withFeatures(ProvisionedClustersCommonPropertiesFeatures features) {
        this.features = features;
        return this;
    }

    /**
     * Get the addonProfiles property: AddonProfiles - Profile of managed cluster add-on.
     *
     * @return the addonProfiles value.
     */
    public Map<String, AddonProfiles> addonProfiles() {
        return this.addonProfiles;
    }

    /**
     * Set the addonProfiles property: AddonProfiles - Profile of managed cluster add-on.
     *
     * @param addonProfiles the addonProfiles value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withAddonProfiles(Map<String, AddonProfiles> addonProfiles) {
        this.addonProfiles = addonProfiles;
        return this;
    }

    /**
     * Get the controlPlane property: ControlPlane - ControlPlane Configuration.
     *
     * @return the controlPlane value.
     */
    public ControlPlaneProfile controlPlane() {
        return this.controlPlane;
    }

    /**
     * Set the controlPlane property: ControlPlane - ControlPlane Configuration.
     *
     * @param controlPlane the controlPlane value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withControlPlane(ControlPlaneProfile controlPlane) {
        this.controlPlane = controlPlane;
        return this;
    }

    /**
     * Get the kubernetesVersion property: KubernetesVersion - Version of Kubernetes specified when creating the managed
     * cluster.
     *
     * @return the kubernetesVersion value.
     */
    public String kubernetesVersion() {
        return this.kubernetesVersion;
    }

    /**
     * Set the kubernetesVersion property: KubernetesVersion - Version of Kubernetes specified when creating the managed
     * cluster.
     *
     * @param kubernetesVersion the kubernetesVersion value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withKubernetesVersion(String kubernetesVersion) {
        this.kubernetesVersion = kubernetesVersion;
        return this;
    }

    /**
     * Get the networkProfile property: NetworkProfile - Profile of network configuration.
     *
     * @return the networkProfile value.
     */
    public NetworkProfile networkProfile() {
        return this.networkProfile;
    }

    /**
     * Set the networkProfile property: NetworkProfile - Profile of network configuration.
     *
     * @param networkProfile the networkProfile value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withNetworkProfile(NetworkProfile networkProfile) {
        this.networkProfile = networkProfile;
        return this;
    }

    /**
     * Get the nodeResourceGroup property: NodeResourceGroup - Name of the resource group containing agent pool nodes.
     *
     * @return the nodeResourceGroup value.
     */
    public String nodeResourceGroup() {
        return this.nodeResourceGroup;
    }

    /**
     * Set the nodeResourceGroup property: NodeResourceGroup - Name of the resource group containing agent pool nodes.
     *
     * @param nodeResourceGroup the nodeResourceGroup value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withNodeResourceGroup(String nodeResourceGroup) {
        this.nodeResourceGroup = nodeResourceGroup;
        return this;
    }

    /**
     * Get the agentPoolProfiles property: The agent pools of the cluster.
     *
     * @return the agentPoolProfiles value.
     */
    public List<NamedAgentPoolProfile> agentPoolProfiles() {
        return this.agentPoolProfiles;
    }

    /**
     * Set the agentPoolProfiles property: The agent pools of the cluster.
     *
     * @param agentPoolProfiles the agentPoolProfiles value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withAgentPoolProfiles(List<NamedAgentPoolProfile> agentPoolProfiles) {
        this.agentPoolProfiles = agentPoolProfiles;
        return this;
    }

    /**
     * Get the cloudProviderProfile property: The underlying cloud infra provider properties.
     *
     * @return the cloudProviderProfile value.
     */
    public CloudProviderProfile cloudProviderProfile() {
        return this.cloudProviderProfile;
    }

    /**
     * Set the cloudProviderProfile property: The underlying cloud infra provider properties.
     *
     * @param cloudProviderProfile the cloudProviderProfile value to set.
     * @return the ProvisionedClustersAllProperties object itself.
     */
    public ProvisionedClustersAllProperties withCloudProviderProfile(CloudProviderProfile cloudProviderProfile) {
        this.cloudProviderProfile = cloudProviderProfile;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioningState property.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the status property: HybridAKSClusterStatus defines the observed state of HybridAKSCluster.
     *
     * @return the status value.
     */
    public ProvisionedClustersCommonPropertiesStatus status() {
        return this.status;
    }

    /** {@inheritDoc} */
    @Override
    public ProvisionedClustersAllProperties withAadProfile(AadProfile aadProfile) {
        super.withAadProfile(aadProfile);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ProvisionedClustersAllProperties withWindowsProfile(WindowsProfile windowsProfile) {
        super.withWindowsProfile(windowsProfile);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ProvisionedClustersAllProperties withHttpProxyConfig(HttpProxyConfig httpProxyConfig) {
        super.withHttpProxyConfig(httpProxyConfig);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (linuxProfile() != null) {
            linuxProfile().validate();
        }
        if (features() != null) {
            features().validate();
        }
        if (addonProfiles() != null) {
            addonProfiles()
                .values()
                .forEach(
                    e -> {
                        if (e != null) {
                            e.validate();
                        }
                    });
        }
        if (controlPlane() != null) {
            controlPlane().validate();
        }
        if (networkProfile() != null) {
            networkProfile().validate();
        }
        if (agentPoolProfiles() != null) {
            agentPoolProfiles().forEach(e -> e.validate());
        }
        if (cloudProviderProfile() != null) {
            cloudProviderProfile().validate();
        }
        if (status() != null) {
            status().validate();
        }
    }
}
