// 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.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.managednetworkfabric.models.EnabledDisabledState;
import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The L2IsolationDomain resource definition. */
@Fluent
public final class L2IsolationDomainInner extends Resource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties")
    private L2IsolationDomainProperties innerProperties;

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

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

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private L2IsolationDomainProperties 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;
    }

    /** {@inheritDoc} */
    @Override
    public L2IsolationDomainInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public L2IsolationDomainInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the networkFabricId property: Network Fabric ARM resource id.
     *
     * @return the networkFabricId value.
     */
    public String networkFabricId() {
        return this.innerProperties() == null ? null : this.innerProperties().networkFabricId();
    }

    /**
     * Set the networkFabricId property: Network Fabric ARM resource id.
     *
     * @param networkFabricId the networkFabricId value to set.
     * @return the L2IsolationDomainInner object itself.
     */
    public L2IsolationDomainInner withNetworkFabricId(String networkFabricId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new L2IsolationDomainProperties();
        }
        this.innerProperties().withNetworkFabricId(networkFabricId);
        return this;
    }

    /**
     * Get the vlanId property: vlanId. Example: 501.
     *
     * @return the vlanId value.
     */
    public Integer vlanId() {
        return this.innerProperties() == null ? null : this.innerProperties().vlanId();
    }

    /**
     * Set the vlanId property: vlanId. Example: 501.
     *
     * @param vlanId the vlanId value to set.
     * @return the L2IsolationDomainInner object itself.
     */
    public L2IsolationDomainInner withVlanId(Integer vlanId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new L2IsolationDomainProperties();
        }
        this.innerProperties().withVlanId(vlanId);
        return this;
    }

    /**
     * Get the mtu property: maximum transmission unit. Default value is 1500.
     *
     * @return the mtu value.
     */
    public Integer mtu() {
        return this.innerProperties() == null ? null : this.innerProperties().mtu();
    }

    /**
     * Set the mtu property: maximum transmission unit. Default value is 1500.
     *
     * @param mtu the mtu value to set.
     * @return the L2IsolationDomainInner object itself.
     */
    public L2IsolationDomainInner withMtu(Integer mtu) {
        if (this.innerProperties() == null) {
            this.innerProperties = new L2IsolationDomainProperties();
        }
        this.innerProperties().withMtu(mtu);
        return this;
    }

    /**
     * Get the disabledOnResources property: List of resources the L2 Isolation Domain 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: state. Example: Enabled | Disabled. It indicates administrative state of
     * the isolationDomain, whether it is enabled or disabled. If enabled, the configuration is applied on the devices.
     * If disabled, the configuration is removed from the devices.
     *
     * @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 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 L2IsolationDomainInner object itself.
     */
    public L2IsolationDomainInner withAnnotation(String annotation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new L2IsolationDomainProperties();
        }
        this.innerProperties().withAnnotation(annotation);
        return this;
    }

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