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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.peering.models.Kind;
import com.azure.resourcemanager.peering.models.PeeringLocationPropertiesDirect;
import com.azure.resourcemanager.peering.models.PeeringLocationPropertiesExchange;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Peering location is where connectivity could be established to the Microsoft Cloud Edge. */
@Fluent
public final class PeeringLocationInner extends ProxyResource {
    /*
     * The kind of peering that the peering location supports.
     */
    @JsonProperty(value = "kind")
    private Kind kind;

    /*
     * The properties that define a peering location.
     */
    @JsonProperty(value = "properties")
    private PeeringLocationProperties innerProperties;

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

    /**
     * Get the kind property: The kind of peering that the peering location supports.
     *
     * @return the kind value.
     */
    public Kind kind() {
        return this.kind;
    }

    /**
     * Set the kind property: The kind of peering that the peering location supports.
     *
     * @param kind the kind value to set.
     * @return the PeeringLocationInner object itself.
     */
    public PeeringLocationInner withKind(Kind kind) {
        this.kind = kind;
        return this;
    }

    /**
     * Get the innerProperties property: The properties that define a peering location.
     *
     * @return the innerProperties value.
     */
    private PeeringLocationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the direct property: The properties that define a direct peering location.
     *
     * @return the direct value.
     */
    public PeeringLocationPropertiesDirect direct() {
        return this.innerProperties() == null ? null : this.innerProperties().direct();
    }

    /**
     * Set the direct property: The properties that define a direct peering location.
     *
     * @param direct the direct value to set.
     * @return the PeeringLocationInner object itself.
     */
    public PeeringLocationInner withDirect(PeeringLocationPropertiesDirect direct) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PeeringLocationProperties();
        }
        this.innerProperties().withDirect(direct);
        return this;
    }

    /**
     * Get the exchange property: The properties that define an exchange peering location.
     *
     * @return the exchange value.
     */
    public PeeringLocationPropertiesExchange exchange() {
        return this.innerProperties() == null ? null : this.innerProperties().exchange();
    }

    /**
     * Set the exchange property: The properties that define an exchange peering location.
     *
     * @param exchange the exchange value to set.
     * @return the PeeringLocationInner object itself.
     */
    public PeeringLocationInner withExchange(PeeringLocationPropertiesExchange exchange) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PeeringLocationProperties();
        }
        this.innerProperties().withExchange(exchange);
        return this;
    }

    /**
     * Get the peeringLocation property: The name of the peering location.
     *
     * @return the peeringLocation value.
     */
    public String peeringLocation() {
        return this.innerProperties() == null ? null : this.innerProperties().peeringLocation();
    }

    /**
     * Set the peeringLocation property: The name of the peering location.
     *
     * @param peeringLocation the peeringLocation value to set.
     * @return the PeeringLocationInner object itself.
     */
    public PeeringLocationInner withPeeringLocation(String peeringLocation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PeeringLocationProperties();
        }
        this.innerProperties().withPeeringLocation(peeringLocation);
        return this;
    }

    /**
     * Get the country property: The country in which the peering location exists.
     *
     * @return the country value.
     */
    public String country() {
        return this.innerProperties() == null ? null : this.innerProperties().country();
    }

    /**
     * Set the country property: The country in which the peering location exists.
     *
     * @param country the country value to set.
     * @return the PeeringLocationInner object itself.
     */
    public PeeringLocationInner withCountry(String country) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PeeringLocationProperties();
        }
        this.innerProperties().withCountry(country);
        return this;
    }

    /**
     * Get the azureRegion property: The Azure region associated with the peering location.
     *
     * @return the azureRegion value.
     */
    public String azureRegion() {
        return this.innerProperties() == null ? null : this.innerProperties().azureRegion();
    }

    /**
     * Set the azureRegion property: The Azure region associated with the peering location.
     *
     * @param azureRegion the azureRegion value to set.
     * @return the PeeringLocationInner object itself.
     */
    public PeeringLocationInner withAzureRegion(String azureRegion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PeeringLocationProperties();
        }
        this.innerProperties().withAzureRegion(azureRegion);
        return this;
    }

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