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

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

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

/** Properties of VPN client root certificate of P2SVpnServerConfiguration. */
@Fluent
public final class P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat {
    @JsonIgnore
    private final ClientLogger logger =
        new ClientLogger(P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat.class);

    /*
     * The certificate public data.
     */
    @JsonProperty(value = "publicCertData", required = true)
    private String publicCertData;

    /*
     * The provisioning state of the P2SVpnServerConfiguration VPN client root
     * certificate resource. Possible values are: 'Updating', 'Deleting', and
     * 'Failed'.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

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

    /**
     * Set the publicCertData property: The certificate public data.
     *
     * @param publicCertData the publicCertData value to set.
     * @return the P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat object itself.
     */
    public P2SVpnServerConfigVpnClientRootCertificatePropertiesFormat withPublicCertData(String publicCertData) {
        this.publicCertData = publicCertData;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state of the P2SVpnServerConfiguration VPN client root
     * certificate resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

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