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

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Peering optionA properties. */
@Fluent
public class Layer3OptionAProperties extends Layer3IpPrefixProperties {
    /*
     * MTU to use for option A peering.
     */
    @JsonProperty(value = "mtu")
    private Integer mtu;

    /*
     * Vlan identifier. Example : 501
     */
    @JsonProperty(value = "vlanId")
    private Integer vlanId;

    /*
     * Fabric ASN number. Example 65001
     */
    @JsonProperty(value = "fabricASN", access = JsonProperty.Access.WRITE_ONLY)
    private Integer fabricAsn;

    /*
     * Peer ASN number.Example : 28
     */
    @JsonProperty(value = "peerASN")
    private Integer peerAsn;

    /*
     * BFD configuration properties
     */
    @JsonProperty(value = "bfdConfiguration")
    private BfdConfiguration bfdConfiguration;

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

    /**
     * Get the mtu property: MTU to use for option A peering.
     *
     * @return the mtu value.
     */
    public Integer mtu() {
        return this.mtu;
    }

    /**
     * Set the mtu property: MTU to use for option A peering.
     *
     * @param mtu the mtu value to set.
     * @return the Layer3OptionAProperties object itself.
     */
    public Layer3OptionAProperties withMtu(Integer mtu) {
        this.mtu = mtu;
        return this;
    }

    /**
     * Get the vlanId property: Vlan identifier. Example : 501.
     *
     * @return the vlanId value.
     */
    public Integer vlanId() {
        return this.vlanId;
    }

    /**
     * Set the vlanId property: Vlan identifier. Example : 501.
     *
     * @param vlanId the vlanId value to set.
     * @return the Layer3OptionAProperties object itself.
     */
    public Layer3OptionAProperties withVlanId(Integer vlanId) {
        this.vlanId = vlanId;
        return this;
    }

    /**
     * Get the fabricAsn property: Fabric ASN number. Example 65001.
     *
     * @return the fabricAsn value.
     */
    public Integer fabricAsn() {
        return this.fabricAsn;
    }

    /**
     * Get the peerAsn property: Peer ASN number.Example : 28.
     *
     * @return the peerAsn value.
     */
    public Integer peerAsn() {
        return this.peerAsn;
    }

    /**
     * Set the peerAsn property: Peer ASN number.Example : 28.
     *
     * @param peerAsn the peerAsn value to set.
     * @return the Layer3OptionAProperties object itself.
     */
    public Layer3OptionAProperties withPeerAsn(Integer peerAsn) {
        this.peerAsn = peerAsn;
        return this;
    }

    /**
     * Get the bfdConfiguration property: BFD configuration properties.
     *
     * @return the bfdConfiguration value.
     */
    public BfdConfiguration bfdConfiguration() {
        return this.bfdConfiguration;
    }

    /**
     * Set the bfdConfiguration property: BFD configuration properties.
     *
     * @param bfdConfiguration the bfdConfiguration value to set.
     * @return the Layer3OptionAProperties object itself.
     */
    public Layer3OptionAProperties withBfdConfiguration(BfdConfiguration bfdConfiguration) {
        this.bfdConfiguration = bfdConfiguration;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Layer3OptionAProperties withPrimaryIpv4Prefix(String primaryIpv4Prefix) {
        super.withPrimaryIpv4Prefix(primaryIpv4Prefix);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Layer3OptionAProperties withPrimaryIpv6Prefix(String primaryIpv6Prefix) {
        super.withPrimaryIpv6Prefix(primaryIpv6Prefix);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Layer3OptionAProperties withSecondaryIpv4Prefix(String secondaryIpv4Prefix) {
        super.withSecondaryIpv4Prefix(secondaryIpv4Prefix);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public Layer3OptionAProperties withSecondaryIpv6Prefix(String secondaryIpv6Prefix) {
        super.withSecondaryIpv6Prefix(secondaryIpv6Prefix);
        return this;
    }

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