// 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.resourcemanager.managednetworkfabric.models.AnnotationResource;
import com.azure.resourcemanager.managednetworkfabric.models.Layer3OptionAProperties;
import com.azure.resourcemanager.managednetworkfabric.models.OptionBProperties;
import com.azure.resourcemanager.managednetworkfabric.models.PeeringOption;
import com.fasterxml.jackson.annotation.JsonProperty;

/** External Network Patch properties. */
@Fluent
public final class ExternalNetworkPatchProperties extends AnnotationResource {
    /*
     * Peering option list.
     */
    @JsonProperty(value = "peeringOption")
    private PeeringOption peeringOption;

    /*
     * option B properties object
     */
    @JsonProperty(value = "optionBProperties")
    private OptionBProperties optionBProperties;

    /*
     * option A properties object
     */
    @JsonProperty(value = "optionAProperties")
    private Layer3OptionAProperties optionAProperties;

    /*
     * ARM resource ID of importRoutePolicy.
     */
    @JsonProperty(value = "importRoutePolicyId")
    private String importRoutePolicyId;

    /*
     * ARM resource ID of exportRoutePolicy.
     */
    @JsonProperty(value = "exportRoutePolicyId")
    private String exportRoutePolicyId;

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

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

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

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

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

    /**
     * Get the optionAProperties property: option A properties object.
     *
     * @return the optionAProperties value.
     */
    public Layer3OptionAProperties optionAProperties() {
        return this.optionAProperties;
    }

    /**
     * Set the optionAProperties property: option A properties object.
     *
     * @param optionAProperties the optionAProperties value to set.
     * @return the ExternalNetworkPatchProperties object itself.
     */
    public ExternalNetworkPatchProperties withOptionAProperties(Layer3OptionAProperties optionAProperties) {
        this.optionAProperties = optionAProperties;
        return this;
    }

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

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

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

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

    /** {@inheritDoc} */
    @Override
    public ExternalNetworkPatchProperties withAnnotation(String annotation) {
        super.withAnnotation(annotation);
        return this;
    }

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