// 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.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The customer's ASN that is registered by the peering service provider. */
@Fluent
public final class PeeringRegisteredAsnInner extends ProxyResource {
    /*
     * The properties that define a registered ASN.
     */
    @JsonProperty(value = "properties")
    private PeeringRegisteredAsnProperties innerProperties;

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

    /**
     * Get the innerProperties property: The properties that define a registered ASN.
     *
     * @return the innerProperties value.
     */
    private PeeringRegisteredAsnProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the asn property: The customer's ASN from which traffic originates.
     *
     * @return the asn value.
     */
    public Integer asn() {
        return this.innerProperties() == null ? null : this.innerProperties().asn();
    }

    /**
     * Set the asn property: The customer's ASN from which traffic originates.
     *
     * @param asn the asn value to set.
     * @return the PeeringRegisteredAsnInner object itself.
     */
    public PeeringRegisteredAsnInner withAsn(Integer asn) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PeeringRegisteredAsnProperties();
        }
        this.innerProperties().withAsn(asn);
        return this;
    }

    /**
     * Get the peeringServicePrefixKey property: The peering service prefix key that is to be shared with the customer.
     *
     * @return the peeringServicePrefixKey value.
     */
    public String peeringServicePrefixKey() {
        return this.innerProperties() == null ? null : this.innerProperties().peeringServicePrefixKey();
    }

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

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