// 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.ManagementNetworkConfiguration;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkFabricOperationalState;
import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState;
import com.azure.resourcemanager.managednetworkfabric.models.TerminalServerConfiguration;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The NetworkFabric resource definition. */
@Fluent
public final class NetworkFabricInner extends Resource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties")
    private NetworkFabricProperties 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 NetworkFabricInner class. */
    public NetworkFabricInner() {
    }

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private NetworkFabricProperties 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 NetworkFabricInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

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

    /**
     * Get the networkFabricSku property: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user
     * chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it
     * is a single / multi rack Network Fabric.
     *
     * @return the networkFabricSku value.
     */
    public String networkFabricSku() {
        return this.innerProperties() == null ? null : this.innerProperties().networkFabricSku();
    }

    /**
     * Set the networkFabricSku property: Supported Network Fabric SKU.Example: Compute / Aggregate racks. Once the user
     * chooses a particular SKU, only supported racks can be added to the Network Fabric. The SKU determines whether it
     * is a single / multi rack Network Fabric.
     *
     * @param networkFabricSku the networkFabricSku value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withNetworkFabricSku(String networkFabricSku) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withNetworkFabricSku(networkFabricSku);
        return this;
    }

    /**
     * Get the rackCount property: Number of racks associated to Network Fabric.Possible values are from 2-8.
     *
     * @return the rackCount value.
     */
    public Integer rackCount() {
        return this.innerProperties() == null ? null : this.innerProperties().rackCount();
    }

    /**
     * Set the rackCount property: Number of racks associated to Network Fabric.Possible values are from 2-8.
     *
     * @param rackCount the rackCount value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withRackCount(Integer rackCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withRackCount(rackCount);
        return this;
    }

    /**
     * Get the serverCountPerRack property: Number of servers.Possible values are from 1-16.
     *
     * @return the serverCountPerRack value.
     */
    public Integer serverCountPerRack() {
        return this.innerProperties() == null ? null : this.innerProperties().serverCountPerRack();
    }

    /**
     * Set the serverCountPerRack property: Number of servers.Possible values are from 1-16.
     *
     * @param serverCountPerRack the serverCountPerRack value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withServerCountPerRack(Integer serverCountPerRack) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withServerCountPerRack(serverCountPerRack);
        return this;
    }

    /**
     * Get the ipv4Prefix property: IPv4Prefix for Management Network. Example: 10.1.0.0/19.
     *
     * @return the ipv4Prefix value.
     */
    public String ipv4Prefix() {
        return this.innerProperties() == null ? null : this.innerProperties().ipv4Prefix();
    }

    /**
     * Set the ipv4Prefix property: IPv4Prefix for Management Network. Example: 10.1.0.0/19.
     *
     * @param ipv4Prefix the ipv4Prefix value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withIpv4Prefix(String ipv4Prefix) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withIpv4Prefix(ipv4Prefix);
        return this;
    }

    /**
     * Get the ipv6Prefix property: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59.
     *
     * @return the ipv6Prefix value.
     */
    public String ipv6Prefix() {
        return this.innerProperties() == null ? null : this.innerProperties().ipv6Prefix();
    }

    /**
     * Set the ipv6Prefix property: IPv6Prefix for Management Network. Example: 3FFE:FFFF:0:CD40::/59.
     *
     * @param ipv6Prefix the ipv6Prefix value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withIpv6Prefix(String ipv6Prefix) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withIpv6Prefix(ipv6Prefix);
        return this;
    }

    /**
     * Get the routerId property: Router Id of CE to be used for MP-BGP between PE and CE.
     *
     * @return the routerId value.
     */
    public String routerId() {
        return this.innerProperties() == null ? null : this.innerProperties().routerId();
    }

    /**
     * Get the fabricAsn property: ASN of CE devices for CE/PE connectivity.
     *
     * @return the fabricAsn value.
     */
    public Integer fabricAsn() {
        return this.innerProperties() == null ? null : this.innerProperties().fabricAsn();
    }

    /**
     * Set the fabricAsn property: ASN of CE devices for CE/PE connectivity.
     *
     * @param fabricAsn the fabricAsn value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withFabricAsn(Integer fabricAsn) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withFabricAsn(fabricAsn);
        return this;
    }

    /**
     * Get the networkFabricControllerId property: Azure resource ID for the NetworkFabricController the NetworkFabric
     * belongs.
     *
     * @return the networkFabricControllerId value.
     */
    public String networkFabricControllerId() {
        return this.innerProperties() == null ? null : this.innerProperties().networkFabricControllerId();
    }

    /**
     * Set the networkFabricControllerId property: Azure resource ID for the NetworkFabricController the NetworkFabric
     * belongs.
     *
     * @param networkFabricControllerId the networkFabricControllerId value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withNetworkFabricControllerId(String networkFabricControllerId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withNetworkFabricControllerId(networkFabricControllerId);
        return this;
    }

    /**
     * Get the terminalServerConfiguration property: Network and credentials configuration currently applied to terminal
     * server.
     *
     * @return the terminalServerConfiguration value.
     */
    public TerminalServerConfiguration terminalServerConfiguration() {
        return this.innerProperties() == null ? null : this.innerProperties().terminalServerConfiguration();
    }

    /**
     * Set the terminalServerConfiguration property: Network and credentials configuration currently applied to terminal
     * server.
     *
     * @param terminalServerConfiguration the terminalServerConfiguration value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withTerminalServerConfiguration(TerminalServerConfiguration terminalServerConfiguration) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withTerminalServerConfiguration(terminalServerConfiguration);
        return this;
    }

    /**
     * Get the managementNetworkConfiguration property: Configuration to be used to setup the management network.
     *
     * @return the managementNetworkConfiguration value.
     */
    public ManagementNetworkConfiguration managementNetworkConfiguration() {
        return this.innerProperties() == null ? null : this.innerProperties().managementNetworkConfiguration();
    }

    /**
     * Set the managementNetworkConfiguration property: Configuration to be used to setup the management network.
     *
     * @param managementNetworkConfiguration the managementNetworkConfiguration value to set.
     * @return the NetworkFabricInner object itself.
     */
    public NetworkFabricInner withManagementNetworkConfiguration(
        ManagementNetworkConfiguration managementNetworkConfiguration) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        this.innerProperties().withManagementNetworkConfiguration(managementNetworkConfiguration);
        return this;
    }

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

    /**
     * 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 racks property: List of NetworkRack resource IDs under the Network Fabric. The number of racks allowed
     * depends on the Network Fabric SKU.
     *
     * @return the racks value.
     */
    public List<String> racks() {
        return this.innerProperties() == null ? null : this.innerProperties().racks();
    }

    /**
     * Get the l2IsolationDomains property: List of L2IsolationDomain resource IDs under the Network Fabric.
     *
     * @return the l2IsolationDomains value.
     */
    public List<String> l2IsolationDomains() {
        return this.innerProperties() == null ? null : this.innerProperties().l2IsolationDomains();
    }

    /**
     * Get the l3IsolationDomains property: List of L3IsolationDomain resource IDs under the Network Fabric.
     *
     * @return the l3IsolationDomains value.
     */
    public List<String> l3IsolationDomains() {
        return this.innerProperties() == null ? null : this.innerProperties().l3IsolationDomains();
    }

    /**
     * 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 NetworkFabricInner object itself.
     */
    public NetworkFabricInner withAnnotation(String annotation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkFabricProperties();
        }
        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();
        }
    }
}
