// 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.util.logging.ClientLogger;
import com.azure.resourcemanager.managednetworkfabric.models.DeviceInterfaceProperties;
import com.azure.resourcemanager.managednetworkfabric.models.DeviceLimits;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkDeviceRoleName;
import com.azure.resourcemanager.managednetworkfabric.models.ProvisioningState;
import com.azure.resourcemanager.managednetworkfabric.models.SupportedVersionProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** NetworkDeviceSkuProperties define the resource properties. */
@Fluent
public final class NetworkDeviceSkuProperties {
    /*
     * Model of the network device.
     */
    @JsonProperty(value = "model", required = true)
    private String model;

    /*
     * Manufacturer of the network device.
     */
    @JsonProperty(value = "manufacturer")
    private String manufacturer;

    /*
     * List of network device interfaces.
     */
    @JsonProperty(value = "supportedVersions")
    private List<SupportedVersionProperties> supportedVersions;

    /*
     * Network device limits.
     */
    @JsonProperty(value = "limits")
    private DeviceLimits limits;

    /*
     * Available roles for the network device.
     */
    @JsonProperty(value = "supportedRoleTypes")
    private List<NetworkDeviceRoleName> supportedRoleTypes;

    /*
     * List of network device interfaces.
     */
    @JsonProperty(value = "interfaces")
    private List<DeviceInterfaceProperties> interfaces;

    /*
     * Gets the provisioning state of the resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

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

    /**
     * Get the model property: Model of the network device.
     *
     * @return the model value.
     */
    public String model() {
        return this.model;
    }

    /**
     * Set the model property: Model of the network device.
     *
     * @param model the model value to set.
     * @return the NetworkDeviceSkuProperties object itself.
     */
    public NetworkDeviceSkuProperties withModel(String model) {
        this.model = model;
        return this;
    }

    /**
     * Get the manufacturer property: Manufacturer of the network device.
     *
     * @return the manufacturer value.
     */
    public String manufacturer() {
        return this.manufacturer;
    }

    /**
     * Set the manufacturer property: Manufacturer of the network device.
     *
     * @param manufacturer the manufacturer value to set.
     * @return the NetworkDeviceSkuProperties object itself.
     */
    public NetworkDeviceSkuProperties withManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
        return this;
    }

    /**
     * Get the supportedVersions property: List of network device interfaces.
     *
     * @return the supportedVersions value.
     */
    public List<SupportedVersionProperties> supportedVersions() {
        return this.supportedVersions;
    }

    /**
     * Set the supportedVersions property: List of network device interfaces.
     *
     * @param supportedVersions the supportedVersions value to set.
     * @return the NetworkDeviceSkuProperties object itself.
     */
    public NetworkDeviceSkuProperties withSupportedVersions(List<SupportedVersionProperties> supportedVersions) {
        this.supportedVersions = supportedVersions;
        return this;
    }

    /**
     * Get the limits property: Network device limits.
     *
     * @return the limits value.
     */
    public DeviceLimits limits() {
        return this.limits;
    }

    /**
     * Set the limits property: Network device limits.
     *
     * @param limits the limits value to set.
     * @return the NetworkDeviceSkuProperties object itself.
     */
    public NetworkDeviceSkuProperties withLimits(DeviceLimits limits) {
        this.limits = limits;
        return this;
    }

    /**
     * Get the supportedRoleTypes property: Available roles for the network device.
     *
     * @return the supportedRoleTypes value.
     */
    public List<NetworkDeviceRoleName> supportedRoleTypes() {
        return this.supportedRoleTypes;
    }

    /**
     * Set the supportedRoleTypes property: Available roles for the network device.
     *
     * @param supportedRoleTypes the supportedRoleTypes value to set.
     * @return the NetworkDeviceSkuProperties object itself.
     */
    public NetworkDeviceSkuProperties withSupportedRoleTypes(List<NetworkDeviceRoleName> supportedRoleTypes) {
        this.supportedRoleTypes = supportedRoleTypes;
        return this;
    }

    /**
     * Get the interfaces property: List of network device interfaces.
     *
     * @return the interfaces value.
     */
    public List<DeviceInterfaceProperties> interfaces() {
        return this.interfaces;
    }

    /**
     * Set the interfaces property: List of network device interfaces.
     *
     * @param interfaces the interfaces value to set.
     * @return the NetworkDeviceSkuProperties object itself.
     */
    public NetworkDeviceSkuProperties withInterfaces(List<DeviceInterfaceProperties> interfaces) {
        this.interfaces = interfaces;
        return this;
    }

    /**
     * Get the provisioningState property: Gets the provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (model() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property model in model NetworkDeviceSkuProperties"));
        }
        if (supportedVersions() != null) {
            supportedVersions().forEach(e -> e.validate());
        }
        if (limits() != null) {
            limits().validate();
        }
        if (interfaces() != null) {
            interfaces().forEach(e -> e.validate());
        }
    }

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