// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.networkcloud.models.ClusterAvailableVersion;
import com.azure.resourcemanager.networkcloud.models.ClusterManagerDetailedStatus;
import com.azure.resourcemanager.networkcloud.models.ClusterManagerProvisioningState;
import com.azure.resourcemanager.networkcloud.models.ExtendedLocation;
import com.azure.resourcemanager.networkcloud.models.ManagedResourceGroupConfiguration;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** ClusterManagerProperties represents the properties of a cluster manager. */
@Fluent
public final class ClusterManagerProperties {
    /*
     * The resource ID of the Log Analytics workspace that is used for the logs collection.
     */
    @JsonProperty(value = "analyticsWorkspaceId")
    private String analyticsWorkspaceId;

    /*
     * Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed
     * in a future version. The Azure availability zones within the region that will be used to support the cluster
     * manager resource.
     */
    @JsonProperty(value = "availabilityZones")
    private List<String> availabilityZones;

    /*
     * The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a
     * cluster resource.
     */
    @JsonProperty(value = "clusterVersions", access = JsonProperty.Access.WRITE_ONLY)
    private List<ClusterAvailableVersion> clusterVersions;

    /*
     * The detailed status that provides additional information about the cluster manager.
     */
    @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY)
    private ClusterManagerDetailedStatus detailedStatus;

    /*
     * The descriptive message about the current detailed status.
     */
    @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY)
    private String detailedStatusMessage;

    /*
     * The resource ID of the fabric controller that has one to one mapping with the cluster manager.
     */
    @JsonProperty(value = "fabricControllerId", required = true)
    private String fabricControllerId;

    /*
     * ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure.
     *
     * The configuration of the managed resource group associated with the resource.
     */
    @JsonProperty(value = "managedResourceGroupConfiguration")
    private ManagedResourceGroupConfiguration managedResourceGroupConfiguration;

    /*
     * ExtendedLocation represents the Azure custom location where the resource will be created.
     *
     * The extended location (custom location) that represents the cluster manager's control plane location. This
     * extended location is used when creating cluster and rack manifest resources.
     */
    @JsonProperty(value = "managerExtendedLocation", access = JsonProperty.Access.WRITE_ONLY)
    private ExtendedLocation managerExtendedLocation;

    /*
     * The provisioning state of the cluster manager.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ClusterManagerProvisioningState provisioningState;

    /*
     * Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed
     * in a future version. The size of the Azure virtual machines to use for hosting the cluster manager resource.
     */
    @JsonProperty(value = "vmSize")
    private String vmSize;

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

    /**
     * Get the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs
     * collection.
     *
     * @return the analyticsWorkspaceId value.
     */
    public String analyticsWorkspaceId() {
        return this.analyticsWorkspaceId;
    }

    /**
     * Set the analyticsWorkspaceId property: The resource ID of the Log Analytics workspace that is used for the logs
     * collection.
     *
     * @param analyticsWorkspaceId the analyticsWorkspaceId value to set.
     * @return the ClusterManagerProperties object itself.
     */
    public ClusterManagerProperties withAnalyticsWorkspaceId(String analyticsWorkspaceId) {
        this.analyticsWorkspaceId = analyticsWorkspaceId;
        return this;
    }

    /**
     * Get the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager
     * allocation process and will be removed in a future version. The Azure availability zones within the region that
     * will be used to support the cluster manager resource.
     *
     * @return the availabilityZones value.
     */
    public List<String> availabilityZones() {
        return this.availabilityZones;
    }

    /**
     * Set the availabilityZones property: Field deprecated, this value will no longer influence the cluster manager
     * allocation process and will be removed in a future version. The Azure availability zones within the region that
     * will be used to support the cluster manager resource.
     *
     * @param availabilityZones the availabilityZones value to set.
     * @return the ClusterManagerProperties object itself.
     */
    public ClusterManagerProperties withAvailabilityZones(List<String> availabilityZones) {
        this.availabilityZones = availabilityZones;
        return this;
    }

    /**
     * Get the clusterVersions property: The list of the cluster versions the manager supports. It is used as input in
     * clusterVersion property of a cluster resource.
     *
     * @return the clusterVersions value.
     */
    public List<ClusterAvailableVersion> clusterVersions() {
        return this.clusterVersions;
    }

    /**
     * Get the detailedStatus property: The detailed status that provides additional information about the cluster
     * manager.
     *
     * @return the detailedStatus value.
     */
    public ClusterManagerDetailedStatus detailedStatus() {
        return this.detailedStatus;
    }

    /**
     * Get the detailedStatusMessage property: The descriptive message about the current detailed status.
     *
     * @return the detailedStatusMessage value.
     */
    public String detailedStatusMessage() {
        return this.detailedStatusMessage;
    }

    /**
     * Get the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with
     * the cluster manager.
     *
     * @return the fabricControllerId value.
     */
    public String fabricControllerId() {
        return this.fabricControllerId;
    }

    /**
     * Set the fabricControllerId property: The resource ID of the fabric controller that has one to one mapping with
     * the cluster manager.
     *
     * @param fabricControllerId the fabricControllerId value to set.
     * @return the ClusterManagerProperties object itself.
     */
    public ClusterManagerProperties withFabricControllerId(String fabricControllerId) {
        this.fabricControllerId = fabricControllerId;
        return this;
    }

    /**
     * Get the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the
     * configuration of the resource group managed by Azure.
     *
     * <p>The configuration of the managed resource group associated with the resource.
     *
     * @return the managedResourceGroupConfiguration value.
     */
    public ManagedResourceGroupConfiguration managedResourceGroupConfiguration() {
        return this.managedResourceGroupConfiguration;
    }

    /**
     * Set the managedResourceGroupConfiguration property: ManagedResourceGroupConfiguration represents the
     * configuration of the resource group managed by Azure.
     *
     * <p>The configuration of the managed resource group associated with the resource.
     *
     * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set.
     * @return the ClusterManagerProperties object itself.
     */
    public ClusterManagerProperties withManagedResourceGroupConfiguration(
        ManagedResourceGroupConfiguration managedResourceGroupConfiguration) {
        this.managedResourceGroupConfiguration = managedResourceGroupConfiguration;
        return this;
    }

    /**
     * Get the managerExtendedLocation property: ExtendedLocation represents the Azure custom location where the
     * resource will be created.
     *
     * <p>The extended location (custom location) that represents the cluster manager's control plane location. This
     * extended location is used when creating cluster and rack manifest resources.
     *
     * @return the managerExtendedLocation value.
     */
    public ExtendedLocation managerExtendedLocation() {
        return this.managerExtendedLocation;
    }

    /**
     * Get the provisioningState property: The provisioning state of the cluster manager.
     *
     * @return the provisioningState value.
     */
    public ClusterManagerProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation
     * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the
     * cluster manager resource.
     *
     * @return the vmSize value.
     */
    public String vmSize() {
        return this.vmSize;
    }

    /**
     * Set the vmSize property: Field deprecated, this value will no longer influence the cluster manager allocation
     * process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the
     * cluster manager resource.
     *
     * @param vmSize the vmSize value to set.
     * @return the ClusterManagerProperties object itself.
     */
    public ClusterManagerProperties withVmSize(String vmSize) {
        this.vmSize = vmSize;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (clusterVersions() != null) {
            clusterVersions().forEach(e -> e.validate());
        }
        if (fabricControllerId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property fabricControllerId in model ClusterManagerProperties"));
        }
        if (managedResourceGroupConfiguration() != null) {
            managedResourceGroupConfiguration().validate();
        }
        if (managerExtendedLocation() != null) {
            managerExtendedLocation().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ClusterManagerProperties.class);
}
