// 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.ProxyResource;
import com.azure.core.management.SystemData;
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;

/** The NetworkDeviceSku resource definition. */
@Fluent
public final class NetworkDeviceSkuInner extends ProxyResource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private NetworkDeviceSkuProperties innerProperties = new NetworkDeviceSkuProperties();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * 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();
    }

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

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