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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.azurestackhci.models.ClusterDesiredProperties;
import com.azure.resourcemanager.azurestackhci.models.ClusterReportedProperties;
import com.azure.resourcemanager.azurestackhci.models.ProvisioningState;
import com.azure.resourcemanager.azurestackhci.models.Status;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Cluster properties. */
@Fluent
public final class ClusterProperties {
    /*
     * Provisioning state.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * Status of the cluster agent.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private Status status;

    /*
     * Unique, immutable resource id.
     */
    @JsonProperty(value = "cloudId", access = JsonProperty.Access.WRITE_ONLY)
    private String cloudId;

    /*
     * Endpoint configured for management from the Azure portal.
     */
    @JsonProperty(value = "cloudManagementEndpoint")
    private String cloudManagementEndpoint;

    /*
     * App id of cluster AAD identity.
     */
    @JsonProperty(value = "aadClientId")
    private String aadClientId;

    /*
     * Tenant id of cluster AAD identity.
     */
    @JsonProperty(value = "aadTenantId")
    private String aadTenantId;

    /*
     * Object id of cluster AAD identity.
     */
    @JsonProperty(value = "aadApplicationObjectId")
    private String aadApplicationObjectId;

    /*
     * Id of cluster identity service principal.
     */
    @JsonProperty(value = "aadServicePrincipalObjectId")
    private String aadServicePrincipalObjectId;

    /*
     * Desired properties of the cluster.
     */
    @JsonProperty(value = "desiredProperties")
    private ClusterDesiredProperties desiredProperties;

    /*
     * Properties reported by cluster agent.
     */
    @JsonProperty(value = "reportedProperties", access = JsonProperty.Access.WRITE_ONLY)
    private ClusterReportedProperties reportedProperties;

    /*
     * Number of days remaining in the trial period.
     */
    @JsonProperty(value = "trialDaysRemaining", access = JsonProperty.Access.WRITE_ONLY)
    private Float trialDaysRemaining;

    /*
     * Type of billing applied to the resource.
     */
    @JsonProperty(value = "billingModel", access = JsonProperty.Access.WRITE_ONLY)
    private String billingModel;

    /*
     * First cluster sync timestamp.
     */
    @JsonProperty(value = "registrationTimestamp", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime registrationTimestamp;

    /*
     * Most recent cluster sync timestamp.
     */
    @JsonProperty(value = "lastSyncTimestamp", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastSyncTimestamp;

    /*
     * Most recent billing meter timestamp.
     */
    @JsonProperty(value = "lastBillingTimestamp", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastBillingTimestamp;

    /*
     * Region specific DataPath Endpoint of the cluster.
     */
    @JsonProperty(value = "serviceEndpoint", access = JsonProperty.Access.WRITE_ONLY)
    private String serviceEndpoint;

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

    /**
     * Get the status property: Status of the cluster agent.
     *
     * @return the status value.
     */
    public Status status() {
        return this.status;
    }

    /**
     * Get the cloudId property: Unique, immutable resource id.
     *
     * @return the cloudId value.
     */
    public String cloudId() {
        return this.cloudId;
    }

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

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

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

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

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

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

    /**
     * Get the aadApplicationObjectId property: Object id of cluster AAD identity.
     *
     * @return the aadApplicationObjectId value.
     */
    public String aadApplicationObjectId() {
        return this.aadApplicationObjectId;
    }

    /**
     * Set the aadApplicationObjectId property: Object id of cluster AAD identity.
     *
     * @param aadApplicationObjectId the aadApplicationObjectId value to set.
     * @return the ClusterProperties object itself.
     */
    public ClusterProperties withAadApplicationObjectId(String aadApplicationObjectId) {
        this.aadApplicationObjectId = aadApplicationObjectId;
        return this;
    }

    /**
     * Get the aadServicePrincipalObjectId property: Id of cluster identity service principal.
     *
     * @return the aadServicePrincipalObjectId value.
     */
    public String aadServicePrincipalObjectId() {
        return this.aadServicePrincipalObjectId;
    }

    /**
     * Set the aadServicePrincipalObjectId property: Id of cluster identity service principal.
     *
     * @param aadServicePrincipalObjectId the aadServicePrincipalObjectId value to set.
     * @return the ClusterProperties object itself.
     */
    public ClusterProperties withAadServicePrincipalObjectId(String aadServicePrincipalObjectId) {
        this.aadServicePrincipalObjectId = aadServicePrincipalObjectId;
        return this;
    }

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

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

    /**
     * Get the reportedProperties property: Properties reported by cluster agent.
     *
     * @return the reportedProperties value.
     */
    public ClusterReportedProperties reportedProperties() {
        return this.reportedProperties;
    }

    /**
     * Get the trialDaysRemaining property: Number of days remaining in the trial period.
     *
     * @return the trialDaysRemaining value.
     */
    public Float trialDaysRemaining() {
        return this.trialDaysRemaining;
    }

    /**
     * Get the billingModel property: Type of billing applied to the resource.
     *
     * @return the billingModel value.
     */
    public String billingModel() {
        return this.billingModel;
    }

    /**
     * Get the registrationTimestamp property: First cluster sync timestamp.
     *
     * @return the registrationTimestamp value.
     */
    public OffsetDateTime registrationTimestamp() {
        return this.registrationTimestamp;
    }

    /**
     * Get the lastSyncTimestamp property: Most recent cluster sync timestamp.
     *
     * @return the lastSyncTimestamp value.
     */
    public OffsetDateTime lastSyncTimestamp() {
        return this.lastSyncTimestamp;
    }

    /**
     * Get the lastBillingTimestamp property: Most recent billing meter timestamp.
     *
     * @return the lastBillingTimestamp value.
     */
    public OffsetDateTime lastBillingTimestamp() {
        return this.lastBillingTimestamp;
    }

    /**
     * Get the serviceEndpoint property: Region specific DataPath Endpoint of the cluster.
     *
     * @return the serviceEndpoint value.
     */
    public String serviceEndpoint() {
        return this.serviceEndpoint;
    }

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