// 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.management.SubResource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.network.models.IpsecPolicy;
import com.azure.resourcemanager.network.models.P2SVpnServerConfigRadiusClientRootCertificate;
import com.azure.resourcemanager.network.models.P2SVpnServerConfigRadiusServerRootCertificate;
import com.azure.resourcemanager.network.models.P2SVpnServerConfigVpnClientRevokedCertificate;
import com.azure.resourcemanager.network.models.P2SVpnServerConfigVpnClientRootCertificate;
import com.azure.resourcemanager.network.models.VpnGatewayTunnelingProtocol;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** P2SVpnServerConfiguration Resource. */
@Fluent
public final class P2SVpnServerConfigurationInner extends SubResource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(P2SVpnServerConfigurationInner.class);

    /*
     * Parameters for P2SVpnServerConfiguration
     */
    @JsonProperty(value = "properties")
    private P2SVpnServerConfigurationProperties innerProperties;

    /*
     * The name of the resource that is unique within a resource group. This
     * name can be used to access the resource.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Gets a unique read-only string that changes whenever the resource is
     * updated.
     */
    @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY)
    private String etag;

    /**
     * Get the innerProperties property: Parameters for P2SVpnServerConfiguration.
     *
     * @return the innerProperties value.
     */
    private P2SVpnServerConfigurationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the name property: The name of the resource that is unique within a resource group. This name can be used to
     * access the resource.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: The name of the resource that is unique within a resource group. This name can be used to
     * access the resource.
     *
     * @param name the name value to set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the etag property: Gets a unique read-only string that changes whenever the resource is updated.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /** {@inheritDoc} */
    @Override
    public P2SVpnServerConfigurationInner withId(String id) {
        super.withId(id);
        return this;
    }

    /**
     * Get the name property: The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource
     * group. This name can be used to access the resource along with Paren VirtualWan resource name.
     *
     * @return the name value.
     */
    public String namePropertiesName() {
        return this.innerProperties() == null ? null : this.innerProperties().name();
    }

    /**
     * Set the name property: The name of the P2SVpnServerConfiguration that is unique within a VirtualWan in a resource
     * group. This name can be used to access the resource along with Paren VirtualWan resource name.
     *
     * @param name the name value to set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withNamePropertiesName(String name) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this.innerProperties().withName(name);
        return this;
    }

    /**
     * Get the vpnProtocols property: vpnProtocols for the P2SVpnServerConfiguration.
     *
     * @return the vpnProtocols value.
     */
    public List<VpnGatewayTunnelingProtocol> vpnProtocols() {
        return this.innerProperties() == null ? null : this.innerProperties().vpnProtocols();
    }

    /**
     * Set the vpnProtocols property: vpnProtocols for the P2SVpnServerConfiguration.
     *
     * @param vpnProtocols the vpnProtocols value to set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withVpnProtocols(List<VpnGatewayTunnelingProtocol> vpnProtocols) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this.innerProperties().withVpnProtocols(vpnProtocols);
        return this;
    }

    /**
     * Get the p2SVpnServerConfigVpnClientRootCertificates property: VPN client root certificate of
     * P2SVpnServerConfiguration.
     *
     * @return the p2SVpnServerConfigVpnClientRootCertificates value.
     */
    public List<P2SVpnServerConfigVpnClientRootCertificate> p2SVpnServerConfigVpnClientRootCertificates() {
        return this.innerProperties() == null
            ? null
            : this.innerProperties().p2SVpnServerConfigVpnClientRootCertificates();
    }

    /**
     * Set the p2SVpnServerConfigVpnClientRootCertificates property: VPN client root certificate of
     * P2SVpnServerConfiguration.
     *
     * @param p2SVpnServerConfigVpnClientRootCertificates the p2SVpnServerConfigVpnClientRootCertificates value to set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withP2SVpnServerConfigVpnClientRootCertificates(
        List<P2SVpnServerConfigVpnClientRootCertificate> p2SVpnServerConfigVpnClientRootCertificates) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this
            .innerProperties()
            .withP2SVpnServerConfigVpnClientRootCertificates(p2SVpnServerConfigVpnClientRootCertificates);
        return this;
    }

    /**
     * Get the p2SVpnServerConfigVpnClientRevokedCertificates property: VPN client revoked certificate of
     * P2SVpnServerConfiguration.
     *
     * @return the p2SVpnServerConfigVpnClientRevokedCertificates value.
     */
    public List<P2SVpnServerConfigVpnClientRevokedCertificate> p2SVpnServerConfigVpnClientRevokedCertificates() {
        return this.innerProperties() == null
            ? null
            : this.innerProperties().p2SVpnServerConfigVpnClientRevokedCertificates();
    }

    /**
     * Set the p2SVpnServerConfigVpnClientRevokedCertificates property: VPN client revoked certificate of
     * P2SVpnServerConfiguration.
     *
     * @param p2SVpnServerConfigVpnClientRevokedCertificates the p2SVpnServerConfigVpnClientRevokedCertificates value to
     *     set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withP2SVpnServerConfigVpnClientRevokedCertificates(
        List<P2SVpnServerConfigVpnClientRevokedCertificate> p2SVpnServerConfigVpnClientRevokedCertificates) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this
            .innerProperties()
            .withP2SVpnServerConfigVpnClientRevokedCertificates(p2SVpnServerConfigVpnClientRevokedCertificates);
        return this;
    }

    /**
     * Get the p2SVpnServerConfigRadiusServerRootCertificates property: Radius Server root certificate of
     * P2SVpnServerConfiguration.
     *
     * @return the p2SVpnServerConfigRadiusServerRootCertificates value.
     */
    public List<P2SVpnServerConfigRadiusServerRootCertificate> p2SVpnServerConfigRadiusServerRootCertificates() {
        return this.innerProperties() == null
            ? null
            : this.innerProperties().p2SVpnServerConfigRadiusServerRootCertificates();
    }

    /**
     * Set the p2SVpnServerConfigRadiusServerRootCertificates property: Radius Server root certificate of
     * P2SVpnServerConfiguration.
     *
     * @param p2SVpnServerConfigRadiusServerRootCertificates the p2SVpnServerConfigRadiusServerRootCertificates value to
     *     set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withP2SVpnServerConfigRadiusServerRootCertificates(
        List<P2SVpnServerConfigRadiusServerRootCertificate> p2SVpnServerConfigRadiusServerRootCertificates) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this
            .innerProperties()
            .withP2SVpnServerConfigRadiusServerRootCertificates(p2SVpnServerConfigRadiusServerRootCertificates);
        return this;
    }

    /**
     * Get the p2SVpnServerConfigRadiusClientRootCertificates property: Radius client root certificate of
     * P2SVpnServerConfiguration.
     *
     * @return the p2SVpnServerConfigRadiusClientRootCertificates value.
     */
    public List<P2SVpnServerConfigRadiusClientRootCertificate> p2SVpnServerConfigRadiusClientRootCertificates() {
        return this.innerProperties() == null
            ? null
            : this.innerProperties().p2SVpnServerConfigRadiusClientRootCertificates();
    }

    /**
     * Set the p2SVpnServerConfigRadiusClientRootCertificates property: Radius client root certificate of
     * P2SVpnServerConfiguration.
     *
     * @param p2SVpnServerConfigRadiusClientRootCertificates the p2SVpnServerConfigRadiusClientRootCertificates value to
     *     set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withP2SVpnServerConfigRadiusClientRootCertificates(
        List<P2SVpnServerConfigRadiusClientRootCertificate> p2SVpnServerConfigRadiusClientRootCertificates) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this
            .innerProperties()
            .withP2SVpnServerConfigRadiusClientRootCertificates(p2SVpnServerConfigRadiusClientRootCertificates);
        return this;
    }

    /**
     * Get the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for P2SVpnServerConfiguration.
     *
     * @return the vpnClientIpsecPolicies value.
     */
    public List<IpsecPolicy> vpnClientIpsecPolicies() {
        return this.innerProperties() == null ? null : this.innerProperties().vpnClientIpsecPolicies();
    }

    /**
     * Set the vpnClientIpsecPolicies property: VpnClientIpsecPolicies for P2SVpnServerConfiguration.
     *
     * @param vpnClientIpsecPolicies the vpnClientIpsecPolicies value to set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withVpnClientIpsecPolicies(List<IpsecPolicy> vpnClientIpsecPolicies) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this.innerProperties().withVpnClientIpsecPolicies(vpnClientIpsecPolicies);
        return this;
    }

    /**
     * Get the radiusServerAddress property: The radius server address property of the P2SVpnServerConfiguration
     * resource for point to site client connection.
     *
     * @return the radiusServerAddress value.
     */
    public String radiusServerAddress() {
        return this.innerProperties() == null ? null : this.innerProperties().radiusServerAddress();
    }

    /**
     * Set the radiusServerAddress property: The radius server address property of the P2SVpnServerConfiguration
     * resource for point to site client connection.
     *
     * @param radiusServerAddress the radiusServerAddress value to set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withRadiusServerAddress(String radiusServerAddress) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this.innerProperties().withRadiusServerAddress(radiusServerAddress);
        return this;
    }

    /**
     * Get the radiusServerSecret property: The radius secret property of the P2SVpnServerConfiguration resource for
     * point to site client connection.
     *
     * @return the radiusServerSecret value.
     */
    public String radiusServerSecret() {
        return this.innerProperties() == null ? null : this.innerProperties().radiusServerSecret();
    }

    /**
     * Set the radiusServerSecret property: The radius secret property of the P2SVpnServerConfiguration resource for
     * point to site client connection.
     *
     * @param radiusServerSecret the radiusServerSecret value to set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withRadiusServerSecret(String radiusServerSecret) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this.innerProperties().withRadiusServerSecret(radiusServerSecret);
        return this;
    }

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

    /**
     * Get the p2SVpnGateways property: The p2SVpnGateways property.
     *
     * @return the p2SVpnGateways value.
     */
    public List<SubResource> p2SVpnGateways() {
        return this.innerProperties() == null ? null : this.innerProperties().p2SVpnGateways();
    }

    /**
     * Get the etag property: A unique read-only string that changes whenever the resource is updated.
     *
     * @return the etag value.
     */
    public String etagPropertiesEtag() {
        return this.innerProperties() == null ? null : this.innerProperties().etag();
    }

    /**
     * Set the etag property: A unique read-only string that changes whenever the resource is updated.
     *
     * @param etag the etag value to set.
     * @return the P2SVpnServerConfigurationInner object itself.
     */
    public P2SVpnServerConfigurationInner withEtagPropertiesEtag(String etag) {
        if (this.innerProperties() == null) {
            this.innerProperties = new P2SVpnServerConfigurationProperties();
        }
        this.innerProperties().withEtag(etag);
        return this;
    }

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