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

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner;
import com.azure.resourcemanager.securityinsights.fluent.models.IoTDeviceEntityProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/** Represents an IoT device entity. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind")
@JsonTypeName("IoTDevice")
@Fluent
public final class IoTDeviceEntity extends EntityInner {
    /*
     * IoTDevice entity properties
     */
    @JsonProperty(value = "properties")
    private IoTDeviceEntityProperties innerProperties;

    /**
     * Get the innerProperties property: IoTDevice entity properties.
     *
     * @return the innerProperties value.
     */
    private IoTDeviceEntityProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the deviceId property: The ID of the IoT Device in the IoT Hub.
     *
     * @return the deviceId value.
     */
    public String deviceId() {
        return this.innerProperties() == null ? null : this.innerProperties().deviceId();
    }

    /**
     * Get the deviceName property: The friendly name of the device.
     *
     * @return the deviceName value.
     */
    public String deviceName() {
        return this.innerProperties() == null ? null : this.innerProperties().deviceName();
    }

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

    /**
     * Get the iotSecurityAgentId property: The ID of the security agent running on the device.
     *
     * @return the iotSecurityAgentId value.
     */
    public UUID iotSecurityAgentId() {
        return this.innerProperties() == null ? null : this.innerProperties().iotSecurityAgentId();
    }

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

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

    /**
     * Get the edgeId property: The ID of the edge device.
     *
     * @return the edgeId value.
     */
    public String edgeId() {
        return this.innerProperties() == null ? null : this.innerProperties().edgeId();
    }

    /**
     * Get the macAddress property: The MAC address of the device.
     *
     * @return the macAddress value.
     */
    public String macAddress() {
        return this.innerProperties() == null ? null : this.innerProperties().macAddress();
    }

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

    /**
     * Get the serialNumber property: The serial number of the device.
     *
     * @return the serialNumber value.
     */
    public String serialNumber() {
        return this.innerProperties() == null ? null : this.innerProperties().serialNumber();
    }

    /**
     * Get the firmwareVersion property: The firmware version of the device.
     *
     * @return the firmwareVersion value.
     */
    public String firmwareVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().firmwareVersion();
    }

    /**
     * Get the operatingSystem property: The operating system of the device.
     *
     * @return the operatingSystem value.
     */
    public String operatingSystem() {
        return this.innerProperties() == null ? null : this.innerProperties().operatingSystem();
    }

    /**
     * Get the iotHubEntityId property: The AzureResource entity id of the IoT Hub.
     *
     * @return the iotHubEntityId value.
     */
    public String iotHubEntityId() {
        return this.innerProperties() == null ? null : this.innerProperties().iotHubEntityId();
    }

    /**
     * Get the hostEntityId property: The Host entity id of this device.
     *
     * @return the hostEntityId value.
     */
    public String hostEntityId() {
        return this.innerProperties() == null ? null : this.innerProperties().hostEntityId();
    }

    /**
     * Get the ipAddressEntityId property: The IP entity if of this device.
     *
     * @return the ipAddressEntityId value.
     */
    public String ipAddressEntityId() {
        return this.innerProperties() == null ? null : this.innerProperties().ipAddressEntityId();
    }

    /**
     * Get the threatIntelligence property: A list of TI contexts attached to the IoTDevice entity.
     *
     * @return the threatIntelligence value.
     */
    public List<ThreatIntelligence> threatIntelligence() {
        return this.innerProperties() == null ? null : this.innerProperties().threatIntelligence();
    }

    /**
     * Get the protocols property: A list of protocols of the IoTDevice entity.
     *
     * @return the protocols value.
     */
    public List<String> protocols() {
        return this.innerProperties() == null ? null : this.innerProperties().protocols();
    }

    /**
     * Get the owners property: A list of owners of the IoTDevice entity.
     *
     * @return the owners value.
     */
    public List<String> owners() {
        return this.innerProperties() == null ? null : this.innerProperties().owners();
    }

    /**
     * Get the nicEntityIds property: A list of Nic entity ids of the IoTDevice entity.
     *
     * @return the nicEntityIds value.
     */
    public List<String> nicEntityIds() {
        return this.innerProperties() == null ? null : this.innerProperties().nicEntityIds();
    }

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

    /**
     * Get the zone property: The zone location of the device within a site.
     *
     * @return the zone value.
     */
    public String zone() {
        return this.innerProperties() == null ? null : this.innerProperties().zone();
    }

    /**
     * Get the sensor property: The sensor the device is monitored by.
     *
     * @return the sensor value.
     */
    public String sensor() {
        return this.innerProperties() == null ? null : this.innerProperties().sensor();
    }

    /**
     * Get the deviceSubType property: The subType of the device ('PLC', 'HMI', 'EWS', etc.).
     *
     * @return the deviceSubType value.
     */
    public String deviceSubType() {
        return this.innerProperties() == null ? null : this.innerProperties().deviceSubType();
    }

    /**
     * Get the importance property: Device importance, determines if the device classified as 'crown jewel'.
     *
     * @return the importance value.
     */
    public DeviceImportance importance() {
        return this.innerProperties() == null ? null : this.innerProperties().importance();
    }

    /**
     * Set the importance property: Device importance, determines if the device classified as 'crown jewel'.
     *
     * @param importance the importance value to set.
     * @return the IoTDeviceEntity object itself.
     */
    public IoTDeviceEntity withImportance(DeviceImportance importance) {
        if (this.innerProperties() == null) {
            this.innerProperties = new IoTDeviceEntityProperties();
        }
        this.innerProperties().withImportance(importance);
        return this;
    }

    /**
     * Get the purdueLayer property: The Purdue Layer of the device.
     *
     * @return the purdueLayer value.
     */
    public String purdueLayer() {
        return this.innerProperties() == null ? null : this.innerProperties().purdueLayer();
    }

    /**
     * Get the isAuthorized property: Determines whether the device classified as authorized device.
     *
     * @return the isAuthorized value.
     */
    public Boolean isAuthorized() {
        return this.innerProperties() == null ? null : this.innerProperties().isAuthorized();
    }

    /**
     * Get the isProgramming property: Determines whether the device classified as programming device.
     *
     * @return the isProgramming value.
     */
    public Boolean isProgramming() {
        return this.innerProperties() == null ? null : this.innerProperties().isProgramming();
    }

    /**
     * Get the isScanner property: Is the device classified as a scanner device.
     *
     * @return the isScanner value.
     */
    public Boolean isScanner() {
        return this.innerProperties() == null ? null : this.innerProperties().isScanner();
    }

    /**
     * Get the additionalData property: A bag of custom fields that should be part of the entity and will be presented
     * to the user.
     *
     * @return the additionalData value.
     */
    public Map<String, Object> additionalData() {
        return this.innerProperties() == null ? null : this.innerProperties().additionalData();
    }

    /**
     * Get the friendlyName property: The graph item display name which is a short humanly readable description of the
     * graph item instance. This property is optional and might be system generated.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyName();
    }

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