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

package com.azure.resourcemanager.databoxedge.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Represents the networkAdapter on a device. */
@Fluent
public final class NetworkAdapter {
    /*
     * Instance ID of network adapter.
     */
    @JsonProperty(value = "adapterId", access = JsonProperty.Access.WRITE_ONLY)
    private String adapterId;

    /*
     * Hardware position of network adapter.
     */
    @JsonProperty(value = "adapterPosition", access = JsonProperty.Access.WRITE_ONLY)
    private NetworkAdapterPosition adapterPosition;

    /*
     * Logical index of the adapter.
     */
    @JsonProperty(value = "index", access = JsonProperty.Access.WRITE_ONLY)
    private Integer index;

    /*
     * Node ID of the network adapter.
     */
    @JsonProperty(value = "nodeId", access = JsonProperty.Access.WRITE_ONLY)
    private String nodeId;

    /*
     * Network adapter name.
     */
    @JsonProperty(value = "networkAdapterName", access = JsonProperty.Access.WRITE_ONLY)
    private String networkAdapterName;

    /*
     * Hardware label for the adapter.
     */
    @JsonProperty(value = "label", access = JsonProperty.Access.WRITE_ONLY)
    private String label;

    /*
     * MAC address.
     */
    @JsonProperty(value = "macAddress", access = JsonProperty.Access.WRITE_ONLY)
    private String macAddress;

    /*
     * Link speed.
     */
    @JsonProperty(value = "linkSpeed", access = JsonProperty.Access.WRITE_ONLY)
    private Long linkSpeed;

    /*
     * Value indicating whether this adapter is valid.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private NetworkAdapterStatus status;

    /*
     * Value indicating whether this adapter is RDMA capable.
     */
    @JsonProperty(value = "rdmaStatus")
    private NetworkAdapterRdmaStatus rdmaStatus;

    /*
     * Value indicating whether this adapter has DHCP enabled.
     */
    @JsonProperty(value = "dhcpStatus")
    private NetworkAdapterDhcpStatus dhcpStatus;

    /*
     * The IPv4 configuration of the network adapter.
     */
    @JsonProperty(value = "ipv4Configuration", access = JsonProperty.Access.WRITE_ONLY)
    private Ipv4Config ipv4Configuration;

    /*
     * The IPv6 configuration of the network adapter.
     */
    @JsonProperty(value = "ipv6Configuration", access = JsonProperty.Access.WRITE_ONLY)
    private Ipv6Config ipv6Configuration;

    /*
     * The IPv6 local address.
     */
    @JsonProperty(value = "ipv6LinkLocalAddress", access = JsonProperty.Access.WRITE_ONLY)
    private String ipv6LinkLocalAddress;

    /*
     * The list of DNS Servers of the device.
     */
    @JsonProperty(value = "dnsServers", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> dnsServers;

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

    /**
     * Get the adapterId property: Instance ID of network adapter.
     *
     * @return the adapterId value.
     */
    public String adapterId() {
        return this.adapterId;
    }

    /**
     * Get the adapterPosition property: Hardware position of network adapter.
     *
     * @return the adapterPosition value.
     */
    public NetworkAdapterPosition adapterPosition() {
        return this.adapterPosition;
    }

    /**
     * Get the index property: Logical index of the adapter.
     *
     * @return the index value.
     */
    public Integer index() {
        return this.index;
    }

    /**
     * Get the nodeId property: Node ID of the network adapter.
     *
     * @return the nodeId value.
     */
    public String nodeId() {
        return this.nodeId;
    }

    /**
     * Get the networkAdapterName property: Network adapter name.
     *
     * @return the networkAdapterName value.
     */
    public String networkAdapterName() {
        return this.networkAdapterName;
    }

    /**
     * Get the label property: Hardware label for the adapter.
     *
     * @return the label value.
     */
    public String label() {
        return this.label;
    }

    /**
     * Get the macAddress property: MAC address.
     *
     * @return the macAddress value.
     */
    public String macAddress() {
        return this.macAddress;
    }

    /**
     * Get the linkSpeed property: Link speed.
     *
     * @return the linkSpeed value.
     */
    public Long linkSpeed() {
        return this.linkSpeed;
    }

    /**
     * Get the status property: Value indicating whether this adapter is valid.
     *
     * @return the status value.
     */
    public NetworkAdapterStatus status() {
        return this.status;
    }

    /**
     * Get the rdmaStatus property: Value indicating whether this adapter is RDMA capable.
     *
     * @return the rdmaStatus value.
     */
    public NetworkAdapterRdmaStatus rdmaStatus() {
        return this.rdmaStatus;
    }

    /**
     * Set the rdmaStatus property: Value indicating whether this adapter is RDMA capable.
     *
     * @param rdmaStatus the rdmaStatus value to set.
     * @return the NetworkAdapter object itself.
     */
    public NetworkAdapter withRdmaStatus(NetworkAdapterRdmaStatus rdmaStatus) {
        this.rdmaStatus = rdmaStatus;
        return this;
    }

    /**
     * Get the dhcpStatus property: Value indicating whether this adapter has DHCP enabled.
     *
     * @return the dhcpStatus value.
     */
    public NetworkAdapterDhcpStatus dhcpStatus() {
        return this.dhcpStatus;
    }

    /**
     * Set the dhcpStatus property: Value indicating whether this adapter has DHCP enabled.
     *
     * @param dhcpStatus the dhcpStatus value to set.
     * @return the NetworkAdapter object itself.
     */
    public NetworkAdapter withDhcpStatus(NetworkAdapterDhcpStatus dhcpStatus) {
        this.dhcpStatus = dhcpStatus;
        return this;
    }

    /**
     * Get the ipv4Configuration property: The IPv4 configuration of the network adapter.
     *
     * @return the ipv4Configuration value.
     */
    public Ipv4Config ipv4Configuration() {
        return this.ipv4Configuration;
    }

    /**
     * Get the ipv6Configuration property: The IPv6 configuration of the network adapter.
     *
     * @return the ipv6Configuration value.
     */
    public Ipv6Config ipv6Configuration() {
        return this.ipv6Configuration;
    }

    /**
     * Get the ipv6LinkLocalAddress property: The IPv6 local address.
     *
     * @return the ipv6LinkLocalAddress value.
     */
    public String ipv6LinkLocalAddress() {
        return this.ipv6LinkLocalAddress;
    }

    /**
     * Get the dnsServers property: The list of DNS Servers of the device.
     *
     * @return the dnsServers value.
     */
    public List<String> dnsServers() {
        return this.dnsServers;
    }

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