// 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.PrefixValidationState;
import com.azure.resourcemanager.peering.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

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

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

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

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

    /**
     * Set the prefix property: The customer's prefix from which traffic originates.
     *
     * @param prefix the prefix value to set.
     * @return the PeeringRegisteredPrefixInner object itself.
     */
    public PeeringRegisteredPrefixInner withPrefix(String prefix) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PeeringRegisteredPrefixProperties();
        }
        this.innerProperties().withPrefix(prefix);
        return this;
    }

    /**
     * Get the prefixValidationState property: The prefix validation state.
     *
     * @return the prefixValidationState value.
     */
    public PrefixValidationState prefixValidationState() {
        return this.innerProperties() == null ? null : this.innerProperties().prefixValidationState();
    }

    /**
     * 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 errorMessage property: The error message associated with the validation state, if any.
     *
     * @return the errorMessage value.
     */
    public String errorMessage() {
        return this.innerProperties() == null ? null : this.innerProperties().errorMessage();
    }

    /**
     * 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();
        }
    }
}
