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

package com.azure.resourcemanager.managednetworkfabric.models;

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

/** The ExpressRoute circuit ID and the Auth Key are required for you to successfully deploy NFC service. */
@Fluent
public final class ExpressRouteConnectionInformation {
    /*
     * The express route circuit Azure resource ID, must be of type Microsoft.Network/expressRouteCircuits/circuitName.
     * The ExpressRoute Circuit is a mandatory attribute.
     */
    @JsonProperty(value = "expressRouteCircuitId", required = true)
    private String expressRouteCircuitId;

    /*
     * Authorization key for the circuit, must be of type Microsoft.Network/expressRouteCircuits/authorizations. The
     * Auth Key is a mandatory attribute.
     */
    @JsonProperty(value = "expressRouteAuthorizationKey", required = true)
    private String expressRouteAuthorizationKey;

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

    /**
     * Get the expressRouteCircuitId property: The express route circuit Azure resource ID, must be of type
     * Microsoft.Network/expressRouteCircuits/circuitName. The ExpressRoute Circuit is a mandatory attribute.
     *
     * @return the expressRouteCircuitId value.
     */
    public String expressRouteCircuitId() {
        return this.expressRouteCircuitId;
    }

    /**
     * Set the expressRouteCircuitId property: The express route circuit Azure resource ID, must be of type
     * Microsoft.Network/expressRouteCircuits/circuitName. The ExpressRoute Circuit is a mandatory attribute.
     *
     * @param expressRouteCircuitId the expressRouteCircuitId value to set.
     * @return the ExpressRouteConnectionInformation object itself.
     */
    public ExpressRouteConnectionInformation withExpressRouteCircuitId(String expressRouteCircuitId) {
        this.expressRouteCircuitId = expressRouteCircuitId;
        return this;
    }

    /**
     * Get the expressRouteAuthorizationKey property: Authorization key for the circuit, must be of type
     * Microsoft.Network/expressRouteCircuits/authorizations. The Auth Key is a mandatory attribute.
     *
     * @return the expressRouteAuthorizationKey value.
     */
    public String expressRouteAuthorizationKey() {
        return this.expressRouteAuthorizationKey;
    }

    /**
     * Set the expressRouteAuthorizationKey property: Authorization key for the circuit, must be of type
     * Microsoft.Network/expressRouteCircuits/authorizations. The Auth Key is a mandatory attribute.
     *
     * @param expressRouteAuthorizationKey the expressRouteAuthorizationKey value to set.
     * @return the ExpressRouteConnectionInformation object itself.
     */
    public ExpressRouteConnectionInformation withExpressRouteAuthorizationKey(String expressRouteAuthorizationKey) {
        this.expressRouteAuthorizationKey = expressRouteAuthorizationKey;
        return this;
    }

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

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