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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.avs.models.GlobalReachConnectionProvisioningState;
import com.azure.resourcemanager.avs.models.GlobalReachConnectionStatus;
import com.fasterxml.jackson.annotation.JsonProperty;

/** A global reach connection resource. */
@Fluent
public final class GlobalReachConnectionInner extends ProxyResource {
    /*
     * The properties of a global reach connection resource
     */
    @JsonProperty(value = "properties")
    private GlobalReachConnectionProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties of a global reach connection resource.
     *
     * @return the innerProperties value.
     */
    private GlobalReachConnectionProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the provisioningState property: The state of the ExpressRoute Circuit Authorization provisioning.
     *
     * @return the provisioningState value.
     */
    public GlobalReachConnectionProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the addressPrefix property: The network used for global reach carved out from the original network block
     * provided for the private cloud.
     *
     * @return the addressPrefix value.
     */
    public String addressPrefix() {
        return this.innerProperties() == null ? null : this.innerProperties().addressPrefix();
    }

    /**
     * Get the authorizationKey property: Authorization key from the peer express route used for the global reach
     * connection.
     *
     * @return the authorizationKey value.
     */
    public String authorizationKey() {
        return this.innerProperties() == null ? null : this.innerProperties().authorizationKey();
    }

    /**
     * Set the authorizationKey property: Authorization key from the peer express route used for the global reach
     * connection.
     *
     * @param authorizationKey the authorizationKey value to set.
     * @return the GlobalReachConnectionInner object itself.
     */
    public GlobalReachConnectionInner withAuthorizationKey(String authorizationKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GlobalReachConnectionProperties();
        }
        this.innerProperties().withAuthorizationKey(authorizationKey);
        return this;
    }

    /**
     * Get the circuitConnectionStatus property: The connection status of the global reach connection.
     *
     * @return the circuitConnectionStatus value.
     */
    public GlobalReachConnectionStatus circuitConnectionStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().circuitConnectionStatus();
    }

    /**
     * Get the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global reach
     * connection.
     *
     * @return the peerExpressRouteCircuit value.
     */
    public String peerExpressRouteCircuit() {
        return this.innerProperties() == null ? null : this.innerProperties().peerExpressRouteCircuit();
    }

    /**
     * Set the peerExpressRouteCircuit property: Identifier of the ExpressRoute Circuit to peer with in the global reach
     * connection.
     *
     * @param peerExpressRouteCircuit the peerExpressRouteCircuit value to set.
     * @return the GlobalReachConnectionInner object itself.
     */
    public GlobalReachConnectionInner withPeerExpressRouteCircuit(String peerExpressRouteCircuit) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GlobalReachConnectionProperties();
        }
        this.innerProperties().withPeerExpressRouteCircuit(peerExpressRouteCircuit);
        return this;
    }

    /**
     * Get the expressRouteId property: The ID of the Private Cloud's ExpressRoute Circuit that is participating in the
     * global reach connection.
     *
     * @return the expressRouteId value.
     */
    public String expressRouteId() {
        return this.innerProperties() == null ? null : this.innerProperties().expressRouteId();
    }

    /**
     * Set the expressRouteId property: The ID of the Private Cloud's ExpressRoute Circuit that is participating in the
     * global reach connection.
     *
     * @param expressRouteId the expressRouteId value to set.
     * @return the GlobalReachConnectionInner object itself.
     */
    public GlobalReachConnectionInner withExpressRouteId(String expressRouteId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GlobalReachConnectionProperties();
        }
        this.innerProperties().withExpressRouteId(expressRouteId);
        return this;
    }

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