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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.hybridcontainerservice.models.ProvisionedClusterIdentity;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Defines the hybridIdentityMetadata. */
@Fluent
public final class HybridIdentityMetadataInner extends ProxyResource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private HybridIdentityMetadataProperties innerProperties = new HybridIdentityMetadataProperties();

    /*
     * The system data.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

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

    /**
     * Get the systemData property: The system data.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the resourceUid property: Unique id of the parent provisioned cluster resource.
     *
     * @return the resourceUid value.
     */
    public String resourceUid() {
        return this.innerProperties() == null ? null : this.innerProperties().resourceUid();
    }

    /**
     * Set the resourceUid property: Unique id of the parent provisioned cluster resource.
     *
     * @param resourceUid the resourceUid value to set.
     * @return the HybridIdentityMetadataInner object itself.
     */
    public HybridIdentityMetadataInner withResourceUid(String resourceUid) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridIdentityMetadataProperties();
        }
        this.innerProperties().withResourceUid(resourceUid);
        return this;
    }

    /**
     * Get the publicKey property: Onboarding public key for provisioning the Managed identity for the HybridAKS
     * cluster.
     *
     * @return the publicKey value.
     */
    public String publicKey() {
        return this.innerProperties() == null ? null : this.innerProperties().publicKey();
    }

    /**
     * Set the publicKey property: Onboarding public key for provisioning the Managed identity for the HybridAKS
     * cluster.
     *
     * @param publicKey the publicKey value to set.
     * @return the HybridIdentityMetadataInner object itself.
     */
    public HybridIdentityMetadataInner withPublicKey(String publicKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridIdentityMetadataProperties();
        }
        this.innerProperties().withPublicKey(publicKey);
        return this;
    }

    /**
     * Get the identity property: The identity of the provisioned cluster.
     *
     * @return the identity value.
     */
    public ProvisionedClusterIdentity identity() {
        return this.innerProperties() == null ? null : this.innerProperties().identity();
    }

    /**
     * Set the identity property: The identity of the provisioned cluster.
     *
     * @param identity the identity value to set.
     * @return the HybridIdentityMetadataInner object itself.
     */
    public HybridIdentityMetadataInner withIdentity(ProvisionedClusterIdentity identity) {
        if (this.innerProperties() == null) {
            this.innerProperties = new HybridIdentityMetadataProperties();
        }
        this.innerProperties().withIdentity(identity);
        return this;
    }

    /**
     * Get the provisioningState property: provisioning state of the hybridIdentityMetadata resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property innerProperties in model HybridIdentityMetadataInner"));
        } else {
            innerProperties().validate();
        }
    }

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