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

package com.azure.resourcemanager.azurearcdata.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.UUID;

/** Properties from the Kubernetes data controller. */
@Fluent
public final class OnPremiseProperty {
    /*
     * A globally unique ID identifying the associated Kubernetes cluster
     */
    @JsonProperty(value = "id", required = true)
    private UUID id;

    /*
     * Certificate that contains the Kubernetes cluster public key used to verify signing
     */
    @JsonProperty(value = "publicSigningKey", required = true)
    private String publicSigningKey;

    /*
     * Unique thumbprint returned to customer to verify the certificate being uploaded
     */
    @JsonProperty(value = "signingCertificateThumbprint")
    private String signingCertificateThumbprint;

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

    /**
     * Get the id property: A globally unique ID identifying the associated Kubernetes cluster.
     *
     * @return the id value.
     */
    public UUID id() {
        return this.id;
    }

    /**
     * Set the id property: A globally unique ID identifying the associated Kubernetes cluster.
     *
     * @param id the id value to set.
     * @return the OnPremiseProperty object itself.
     */
    public OnPremiseProperty withId(UUID id) {
        this.id = id;
        return this;
    }

    /**
     * Get the publicSigningKey property: Certificate that contains the Kubernetes cluster public key used to verify
     * signing.
     *
     * @return the publicSigningKey value.
     */
    public String publicSigningKey() {
        return this.publicSigningKey;
    }

    /**
     * Set the publicSigningKey property: Certificate that contains the Kubernetes cluster public key used to verify
     * signing.
     *
     * @param publicSigningKey the publicSigningKey value to set.
     * @return the OnPremiseProperty object itself.
     */
    public OnPremiseProperty withPublicSigningKey(String publicSigningKey) {
        this.publicSigningKey = publicSigningKey;
        return this;
    }

    /**
     * Get the signingCertificateThumbprint property: Unique thumbprint returned to customer to verify the certificate
     * being uploaded.
     *
     * @return the signingCertificateThumbprint value.
     */
    public String signingCertificateThumbprint() {
        return this.signingCertificateThumbprint;
    }

    /**
     * Set the signingCertificateThumbprint property: Unique thumbprint returned to customer to verify the certificate
     * being uploaded.
     *
     * @param signingCertificateThumbprint the signingCertificateThumbprint value to set.
     * @return the OnPremiseProperty object itself.
     */
    public OnPremiseProperty withSigningCertificateThumbprint(String signingCertificateThumbprint) {
        this.signingCertificateThumbprint = signingCertificateThumbprint;
        return this;
    }

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

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