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

package com.azure.resourcemanager.eventgrid.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The Authentication properties for the client. */
@Fluent
public final class ClientAuthentication {
    /*
     * The self signed certificate's thumbprints data used for authentication.
     */
    @JsonProperty(value = "certificateThumbprint")
    private ClientCertificateThumbprint certificateThumbprint;

    /*
     * The CA certificate subject name used for authentication.
     */
    @JsonProperty(value = "certificateSubject")
    private ClientCertificateSubjectDistinguishedName certificateSubject;

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

    /**
     * Get the certificateThumbprint property: The self signed certificate's thumbprints data used for authentication.
     *
     * @return the certificateThumbprint value.
     */
    public ClientCertificateThumbprint certificateThumbprint() {
        return this.certificateThumbprint;
    }

    /**
     * Set the certificateThumbprint property: The self signed certificate's thumbprints data used for authentication.
     *
     * @param certificateThumbprint the certificateThumbprint value to set.
     * @return the ClientAuthentication object itself.
     */
    public ClientAuthentication withCertificateThumbprint(ClientCertificateThumbprint certificateThumbprint) {
        this.certificateThumbprint = certificateThumbprint;
        return this;
    }

    /**
     * Get the certificateSubject property: The CA certificate subject name used for authentication.
     *
     * @return the certificateSubject value.
     */
    public ClientCertificateSubjectDistinguishedName certificateSubject() {
        return this.certificateSubject;
    }

    /**
     * Set the certificateSubject property: The CA certificate subject name used for authentication.
     *
     * @param certificateSubject the certificateSubject value to set.
     * @return the ClientAuthentication object itself.
     */
    public ClientAuthentication withCertificateSubject(ClientCertificateSubjectDistinguishedName certificateSubject) {
        this.certificateSubject = certificateSubject;
        return this;
    }

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