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

package com.azure.resourcemanager.servicefabric.models;

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

/** Describes the client certificate details using thumbprint. */
@Fluent
public final class ClientCertificateThumbprint {
    /*
     * Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read
     * only operations on the cluster.
     */
    @JsonProperty(value = "isAdmin", required = true)
    private boolean isAdmin;

    /*
     * The thumbprint of the client certificate.
     */
    @JsonProperty(value = "certificateThumbprint", required = true)
    private String certificateThumbprint;

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

    /**
     * Get the isAdmin property: Indicates if the client certificate has admin access to the cluster. Non admin clients
     * can perform only read only operations on the cluster.
     *
     * @return the isAdmin value.
     */
    public boolean isAdmin() {
        return this.isAdmin;
    }

    /**
     * Set the isAdmin property: Indicates if the client certificate has admin access to the cluster. Non admin clients
     * can perform only read only operations on the cluster.
     *
     * @param isAdmin the isAdmin value to set.
     * @return the ClientCertificateThumbprint object itself.
     */
    public ClientCertificateThumbprint withIsAdmin(boolean isAdmin) {
        this.isAdmin = isAdmin;
        return this;
    }

    /**
     * Get the certificateThumbprint property: The thumbprint of the client certificate.
     *
     * @return the certificateThumbprint value.
     */
    public String certificateThumbprint() {
        return this.certificateThumbprint;
    }

    /**
     * Set the certificateThumbprint property: The thumbprint of the client certificate.
     *
     * @param certificateThumbprint the certificateThumbprint value to set.
     * @return the ClientCertificateThumbprint object itself.
     */
    public ClientCertificateThumbprint withCertificateThumbprint(String certificateThumbprint) {
        this.certificateThumbprint = certificateThumbprint;
        return this;
    }

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

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