// 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 Radius Server root certificate of P2SVpnServerConfiguration. */
@Fluent
public final class P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat {
    @JsonIgnore
    private final ClientLogger logger =
        new ClientLogger(P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat.class);

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

    /*
     * The provisioning state of the P2SVpnServerConfiguration Radius Server
     * 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 P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat object itself.
     */
    public P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat withPublicCertData(String publicCertData) {
        this.publicCertData = publicCertData;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state of the P2SVpnServerConfiguration Radius Server 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"
                            + " P2SVpnServerConfigRadiusServerRootCertificatePropertiesFormat"));
        }
    }
}
