// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState;
import com.azure.resourcemanager.managednetworkfabric.models.ExternalNetworkPropertiesOptionAProperties;
import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties;
import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption;
import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Defines the ExternalNetwork item. */
@Fluent
public final class ExternalNetworkInner extends ProxyResource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private ExternalNetworkProperties innerProperties = new ExternalNetworkProperties();

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private ExternalNetworkProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the networkToNetworkInterconnectId property: Gets the networkToNetworkInterconnectId of the resource.
     *
     * @return the networkToNetworkInterconnectId value.
     */
    public String networkToNetworkInterconnectId() {
        return this.innerProperties() == null ? null : this.innerProperties().networkToNetworkInterconnectId();
    }

    /**
     * Get the disabledOnResources property: List of resources the externalNetwork is disabled on. Can be either entire
     * NetworkFabric or NetworkRack.
     *
     * @return the disabledOnResources value.
     */
    public List<String> disabledOnResources() {
        return this.innerProperties() == null ? null : this.innerProperties().disabledOnResources();
    }

    /**
     * Get the administrativeState property: AdministrativeState of the externalNetwork. Example: Enabled | Disabled.
     *
     * @return the administrativeState value.
     */
    public EnabledDisabledState administrativeState() {
        return this.innerProperties() == null ? null : this.innerProperties().administrativeState();
    }

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

    /**
     * Get the peeringOption property: Peering option list.
     *
     * @return the peeringOption value.
     */
    public PeeringOption peeringOption() {
        return this.innerProperties() == null ? null : this.innerProperties().peeringOption();
    }

    /**
     * Set the peeringOption property: Peering option list.
     *
     * @param peeringOption the peeringOption value to set.
     * @return the ExternalNetworkInner object itself.
     */
    public ExternalNetworkInner withPeeringOption(PeeringOption peeringOption) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExternalNetworkProperties();
        }
        this.innerProperties().withPeeringOption(peeringOption);
        return this;
    }

    /**
     * Get the optionBProperties property: option B properties object.
     *
     * @return the optionBProperties value.
     */
    public OptionBProperties optionBProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().optionBProperties();
    }

    /**
     * Set the optionBProperties property: option B properties object.
     *
     * @param optionBProperties the optionBProperties value to set.
     * @return the ExternalNetworkInner object itself.
     */
    public ExternalNetworkInner withOptionBProperties(OptionBProperties optionBProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExternalNetworkProperties();
        }
        this.innerProperties().withOptionBProperties(optionBProperties);
        return this;
    }

    /**
     * Get the optionAProperties property: option A properties object.
     *
     * @return the optionAProperties value.
     */
    public ExternalNetworkPropertiesOptionAProperties optionAProperties() {
        return this.innerProperties() == null ? null : this.innerProperties().optionAProperties();
    }

    /**
     * Set the optionAProperties property: option A properties object.
     *
     * @param optionAProperties the optionAProperties value to set.
     * @return the ExternalNetworkInner object itself.
     */
    public ExternalNetworkInner withOptionAProperties(ExternalNetworkPropertiesOptionAProperties optionAProperties) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExternalNetworkProperties();
        }
        this.innerProperties().withOptionAProperties(optionAProperties);
        return this;
    }

    /**
     * Get the importRoutePolicyId property: ARM resource ID of importRoutePolicy.
     *
     * @return the importRoutePolicyId value.
     */
    public String importRoutePolicyId() {
        return this.innerProperties() == null ? null : this.innerProperties().importRoutePolicyId();
    }

    /**
     * Set the importRoutePolicyId property: ARM resource ID of importRoutePolicy.
     *
     * @param importRoutePolicyId the importRoutePolicyId value to set.
     * @return the ExternalNetworkInner object itself.
     */
    public ExternalNetworkInner withImportRoutePolicyId(String importRoutePolicyId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExternalNetworkProperties();
        }
        this.innerProperties().withImportRoutePolicyId(importRoutePolicyId);
        return this;
    }

    /**
     * Get the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy.
     *
     * @return the exportRoutePolicyId value.
     */
    public String exportRoutePolicyId() {
        return this.innerProperties() == null ? null : this.innerProperties().exportRoutePolicyId();
    }

    /**
     * Set the exportRoutePolicyId property: ARM resource ID of exportRoutePolicy.
     *
     * @param exportRoutePolicyId the exportRoutePolicyId value to set.
     * @return the ExternalNetworkInner object itself.
     */
    public ExternalNetworkInner withExportRoutePolicyId(String exportRoutePolicyId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExternalNetworkProperties();
        }
        this.innerProperties().withExportRoutePolicyId(exportRoutePolicyId);
        return this;
    }

    /**
     * Get the annotation property: Switch configuration description.
     *
     * @return the annotation value.
     */
    public String annotation() {
        return this.innerProperties() == null ? null : this.innerProperties().annotation();
    }

    /**
     * Set the annotation property: Switch configuration description.
     *
     * @param annotation the annotation value to set.
     * @return the ExternalNetworkInner object itself.
     */
    public ExternalNetworkInner withAnnotation(String annotation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ExternalNetworkProperties();
        }
        this.innerProperties().withAnnotation(annotation);
        return this;
    }

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

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