// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.networkcloud.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.networkcloud.models.HybridAksPluginType;
import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkDetailedStatus;
import com.azure.resourcemanager.networkcloud.models.TrunkedNetworkProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** TrunkedNetworkProperties represents properties of the trunked network. */
@Fluent
public final class TrunkedNetworkProperties {
    /*
     * The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.
     */
    @JsonProperty(value = "associatedResourceIds", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> associatedResourceIds;

    /*
     * The resource ID of the Network Cloud cluster this trunked network is associated with.
     */
    @JsonProperty(value = "clusterId", access = JsonProperty.Access.WRITE_ONLY)
    private String clusterId;

    /*
     * The more detailed status of the trunked network.
     */
    @JsonProperty(value = "detailedStatus", access = JsonProperty.Access.WRITE_ONLY)
    private TrunkedNetworkDetailedStatus detailedStatus;

    /*
     * The descriptive message about the current detailed status.
     */
    @JsonProperty(value = "detailedStatusMessage", access = JsonProperty.Access.WRITE_ONLY)
    private String detailedStatusMessage;

    /*
     * Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are
     * associated with this trunked network.
     */
    @JsonProperty(value = "hybridAksClustersAssociatedIds", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> hybridAksClustersAssociatedIds;

    /*
     * Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored.
     * The network plugin type for Hybrid AKS.
     */
    @JsonProperty(value = "hybridAksPluginType")
    private HybridAksPluginType hybridAksPluginType;

    /*
     * The default interface name for this trunked network in the virtual machine. This name can be overridden by the
     * name supplied in the network attachment configuration of that virtual machine.
     */
    @JsonProperty(value = "interfaceName")
    private String interfaceName;

    /*
     * The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of
     * l2IsolationDomain and l3IsolationDomain resources.
     */
    @JsonProperty(value = "isolationDomainIds", required = true)
    private List<String> isolationDomainIds;

    /*
     * The provisioning state of the trunked network.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private TrunkedNetworkProvisioningState provisioningState;

    /*
     * Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any
     * Hybrid AKS virtual machines, that are currently using this trunked network.
     */
    @JsonProperty(value = "virtualMachinesAssociatedIds", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> virtualMachinesAssociatedIds;

    /*
     * The list of vlans that are selected from the isolation domains for trunking.
     */
    @JsonProperty(value = "vlans", required = true)
    private List<Long> vlans;

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

    /**
     * Get the associatedResourceIds property: The list of resource IDs for the other Microsoft.NetworkCloud resources
     * that have attached this network.
     *
     * @return the associatedResourceIds value.
     */
    public List<String> associatedResourceIds() {
        return this.associatedResourceIds;
    }

    /**
     * Get the clusterId property: The resource ID of the Network Cloud cluster this trunked network is associated with.
     *
     * @return the clusterId value.
     */
    public String clusterId() {
        return this.clusterId;
    }

    /**
     * Get the detailedStatus property: The more detailed status of the trunked network.
     *
     * @return the detailedStatus value.
     */
    public TrunkedNetworkDetailedStatus detailedStatus() {
        return this.detailedStatus;
    }

    /**
     * Get the detailedStatusMessage property: The descriptive message about the current detailed status.
     *
     * @return the detailedStatusMessage value.
     */
    public String detailedStatusMessage() {
        return this.detailedStatusMessage;
    }

    /**
     * Get the hybridAksClustersAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list
     * of Hybrid AKS cluster resource IDs that are associated with this trunked network.
     *
     * @return the hybridAksClustersAssociatedIds value.
     */
    public List<String> hybridAksClustersAssociatedIds() {
        return this.hybridAksClustersAssociatedIds;
    }

    /**
     * Get the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no
     * defined behavior and will be ignored. The network plugin type for Hybrid AKS.
     *
     * @return the hybridAksPluginType value.
     */
    public HybridAksPluginType hybridAksPluginType() {
        return this.hybridAksPluginType;
    }

    /**
     * Set the hybridAksPluginType property: Field Deprecated. The field was previously optional, now it will have no
     * defined behavior and will be ignored. The network plugin type for Hybrid AKS.
     *
     * @param hybridAksPluginType the hybridAksPluginType value to set.
     * @return the TrunkedNetworkProperties object itself.
     */
    public TrunkedNetworkProperties withHybridAksPluginType(HybridAksPluginType hybridAksPluginType) {
        this.hybridAksPluginType = hybridAksPluginType;
        return this;
    }

    /**
     * Get the interfaceName property: The default interface name for this trunked network in the virtual machine. This
     * name can be overridden by the name supplied in the network attachment configuration of that virtual machine.
     *
     * @return the interfaceName value.
     */
    public String interfaceName() {
        return this.interfaceName;
    }

    /**
     * Set the interfaceName property: The default interface name for this trunked network in the virtual machine. This
     * name can be overridden by the name supplied in the network attachment configuration of that virtual machine.
     *
     * @param interfaceName the interfaceName value to set.
     * @return the TrunkedNetworkProperties object itself.
     */
    public TrunkedNetworkProperties withInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
        return this;
    }

    /**
     * Get the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains.
     * It can be any combination of l2IsolationDomain and l3IsolationDomain resources.
     *
     * @return the isolationDomainIds value.
     */
    public List<String> isolationDomainIds() {
        return this.isolationDomainIds;
    }

    /**
     * Set the isolationDomainIds property: The list of resource IDs representing the Network Fabric isolation domains.
     * It can be any combination of l2IsolationDomain and l3IsolationDomain resources.
     *
     * @param isolationDomainIds the isolationDomainIds value to set.
     * @return the TrunkedNetworkProperties object itself.
     */
    public TrunkedNetworkProperties withIsolationDomainIds(List<String> isolationDomainIds) {
        this.isolationDomainIds = isolationDomainIds;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state of the trunked network.
     *
     * @return the provisioningState value.
     */
    public TrunkedNetworkProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the virtualMachinesAssociatedIds property: Field Deprecated. These fields will be empty/omitted. The list of
     * virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked
     * network.
     *
     * @return the virtualMachinesAssociatedIds value.
     */
    public List<String> virtualMachinesAssociatedIds() {
        return this.virtualMachinesAssociatedIds;
    }

    /**
     * Get the vlans property: The list of vlans that are selected from the isolation domains for trunking.
     *
     * @return the vlans value.
     */
    public List<Long> vlans() {
        return this.vlans;
    }

    /**
     * Set the vlans property: The list of vlans that are selected from the isolation domains for trunking.
     *
     * @param vlans the vlans value to set.
     * @return the TrunkedNetworkProperties object itself.
     */
    public TrunkedNetworkProperties withVlans(List<Long> vlans) {
        this.vlans = vlans;
        return this;
    }

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

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