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

package com.azure.resourcemanager.databoxedge.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.databoxedge.models.AuthenticationType;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Raw Certificate Data. */
@Fluent
public final class RawCertificateData {
    /*
     * The authentication type.
     */
    @JsonProperty(value = "authenticationType")
    private AuthenticationType authenticationType;

    /*
     * The base64 encoded certificate raw data.
     */
    @JsonProperty(value = "certificate", required = true)
    private String certificate;

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

    /**
     * Get the authenticationType property: The authentication type.
     *
     * @return the authenticationType value.
     */
    public AuthenticationType authenticationType() {
        return this.authenticationType;
    }

    /**
     * Set the authenticationType property: The authentication type.
     *
     * @param authenticationType the authenticationType value to set.
     * @return the RawCertificateData object itself.
     */
    public RawCertificateData withAuthenticationType(AuthenticationType authenticationType) {
        this.authenticationType = authenticationType;
        return this;
    }

    /**
     * Get the certificate property: The base64 encoded certificate raw data.
     *
     * @return the certificate value.
     */
    public String certificate() {
        return this.certificate;
    }

    /**
     * Set the certificate property: The base64 encoded certificate raw data.
     *
     * @param certificate the certificate value to set.
     * @return the RawCertificateData object itself.
     */
    public RawCertificateData withCertificate(String certificate) {
        this.certificate = certificate;
        return this;
    }

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

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