com.azure.resourcemanager.securityinsights.fluent.models.IoTDeviceEntityProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-09.
The newest version!
// 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.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.securityinsights.models.DeviceImportance;
import com.azure.resourcemanager.securityinsights.models.EntityCommonProperties;
import com.azure.resourcemanager.securityinsights.models.ThreatIntelligence;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* IoTDevice entity property bag.
*/
@Fluent
public final class IoTDeviceEntityProperties extends EntityCommonProperties {
/*
* The ID of the IoT Device in the IoT Hub
*/
private String deviceId;
/*
* The friendly name of the device
*/
private String deviceName;
/*
* The source of the device
*/
private String source;
/*
* The ID of the security agent running on the device
*/
private UUID iotSecurityAgentId;
/*
* The type of the device
*/
private String deviceType;
/*
* The vendor of the device
*/
private String vendor;
/*
* The ID of the edge device
*/
private String edgeId;
/*
* The MAC address of the device
*/
private String macAddress;
/*
* The model of the device
*/
private String model;
/*
* The serial number of the device
*/
private String serialNumber;
/*
* The firmware version of the device
*/
private String firmwareVersion;
/*
* The operating system of the device
*/
private String operatingSystem;
/*
* The AzureResource entity id of the IoT Hub
*/
private String iotHubEntityId;
/*
* The Host entity id of this device
*/
private String hostEntityId;
/*
* The IP entity if of this device
*/
private String ipAddressEntityId;
/*
* A list of TI contexts attached to the IoTDevice entity.
*/
private List threatIntelligence;
/*
* A list of protocols of the IoTDevice entity.
*/
private List protocols;
/*
* A list of owners of the IoTDevice entity.
*/
private List owners;
/*
* A list of Nic entity ids of the IoTDevice entity.
*/
private List nicEntityIds;
/*
* The site of the device
*/
private String site;
/*
* The zone location of the device within a site
*/
private String zone;
/*
* The sensor the device is monitored by
*/
private String sensor;
/*
* The subType of the device ('PLC', 'HMI', 'EWS', etc.)
*/
private String deviceSubType;
/*
* Device importance, determines if the device classified as 'crown jewel'
*/
private DeviceImportance importance;
/*
* The Purdue Layer of the device
*/
private String purdueLayer;
/*
* Determines whether the device classified as authorized device
*/
private Boolean isAuthorized;
/*
* Determines whether the device classified as programming device
*/
private Boolean isProgramming;
/*
* Is the device classified as a scanner device
*/
private Boolean isScanner;
/*
* 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.
*/
private String friendlyName;
/*
* A bag of custom fields that should be part of the entity and will be presented to the user.
*/
private Map additionalData;
/**
* Creates an instance of IoTDeviceEntityProperties class.
*/
public IoTDeviceEntityProperties() {
}
/**
* Get the deviceId property: The ID of the IoT Device in the IoT Hub.
*
* @return the deviceId value.
*/
public String deviceId() {
return this.deviceId;
}
/**
* Get the deviceName property: The friendly name of the device.
*
* @return the deviceName value.
*/
public String deviceName() {
return this.deviceName;
}
/**
* Get the source property: The source of the device.
*
* @return the source value.
*/
public String source() {
return this.source;
}
/**
* Get the iotSecurityAgentId property: The ID of the security agent running on the device.
*
* @return the iotSecurityAgentId value.
*/
public UUID iotSecurityAgentId() {
return this.iotSecurityAgentId;
}
/**
* Get the deviceType property: The type of the device.
*
* @return the deviceType value.
*/
public String deviceType() {
return this.deviceType;
}
/**
* Get the vendor property: The vendor of the device.
*
* @return the vendor value.
*/
public String vendor() {
return this.vendor;
}
/**
* Get the edgeId property: The ID of the edge device.
*
* @return the edgeId value.
*/
public String edgeId() {
return this.edgeId;
}
/**
* Get the macAddress property: The MAC address of the device.
*
* @return the macAddress value.
*/
public String macAddress() {
return this.macAddress;
}
/**
* Get the model property: The model of the device.
*
* @return the model value.
*/
public String model() {
return this.model;
}
/**
* Get the serialNumber property: The serial number of the device.
*
* @return the serialNumber value.
*/
public String serialNumber() {
return this.serialNumber;
}
/**
* Get the firmwareVersion property: The firmware version of the device.
*
* @return the firmwareVersion value.
*/
public String firmwareVersion() {
return this.firmwareVersion;
}
/**
* Get the operatingSystem property: The operating system of the device.
*
* @return the operatingSystem value.
*/
public String operatingSystem() {
return this.operatingSystem;
}
/**
* Get the iotHubEntityId property: The AzureResource entity id of the IoT Hub.
*
* @return the iotHubEntityId value.
*/
public String iotHubEntityId() {
return this.iotHubEntityId;
}
/**
* Get the hostEntityId property: The Host entity id of this device.
*
* @return the hostEntityId value.
*/
public String hostEntityId() {
return this.hostEntityId;
}
/**
* Get the ipAddressEntityId property: The IP entity if of this device.
*
* @return the ipAddressEntityId value.
*/
public String ipAddressEntityId() {
return this.ipAddressEntityId;
}
/**
* Get the threatIntelligence property: A list of TI contexts attached to the IoTDevice entity.
*
* @return the threatIntelligence value.
*/
public List threatIntelligence() {
return this.threatIntelligence;
}
/**
* Get the protocols property: A list of protocols of the IoTDevice entity.
*
* @return the protocols value.
*/
public List protocols() {
return this.protocols;
}
/**
* Get the owners property: A list of owners of the IoTDevice entity.
*
* @return the owners value.
*/
public List owners() {
return this.owners;
}
/**
* Get the nicEntityIds property: A list of Nic entity ids of the IoTDevice entity.
*
* @return the nicEntityIds value.
*/
public List nicEntityIds() {
return this.nicEntityIds;
}
/**
* Get the site property: The site of the device.
*
* @return the site value.
*/
public String site() {
return this.site;
}
/**
* Get the zone property: The zone location of the device within a site.
*
* @return the zone value.
*/
public String zone() {
return this.zone;
}
/**
* Get the sensor property: The sensor the device is monitored by.
*
* @return the sensor value.
*/
public String sensor() {
return this.sensor;
}
/**
* Get the deviceSubType property: The subType of the device ('PLC', 'HMI', 'EWS', etc.).
*
* @return the deviceSubType value.
*/
public String deviceSubType() {
return this.deviceSubType;
}
/**
* Get the importance property: Device importance, determines if the device classified as 'crown jewel'.
*
* @return the importance value.
*/
public DeviceImportance importance() {
return this.importance;
}
/**
* Set the importance property: Device importance, determines if the device classified as 'crown jewel'.
*
* @param importance the importance value to set.
* @return the IoTDeviceEntityProperties object itself.
*/
public IoTDeviceEntityProperties withImportance(DeviceImportance importance) {
this.importance = importance;
return this;
}
/**
* Get the purdueLayer property: The Purdue Layer of the device.
*
* @return the purdueLayer value.
*/
public String purdueLayer() {
return this.purdueLayer;
}
/**
* Get the isAuthorized property: Determines whether the device classified as authorized device.
*
* @return the isAuthorized value.
*/
public Boolean isAuthorized() {
return this.isAuthorized;
}
/**
* Get the isProgramming property: Determines whether the device classified as programming device.
*
* @return the isProgramming value.
*/
public Boolean isProgramming() {
return this.isProgramming;
}
/**
* Get the isScanner property: Is the device classified as a scanner device.
*
* @return the isScanner value.
*/
public Boolean isScanner() {
return this.isScanner;
}
/**
* 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.
*/
@Override
public String friendlyName() {
return this.friendlyName;
}
/**
* 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.
*/
@Override
public Map additionalData() {
return this.additionalData;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
if (threatIntelligence() != null) {
threatIntelligence().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("importance", this.importance == null ? null : this.importance.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of IoTDeviceEntityProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of IoTDeviceEntityProperties if the JsonReader was pointing to an instance of it, or null if
* it was pointing to JSON null.
* @throws IOException If an error occurs while reading the IoTDeviceEntityProperties.
*/
public static IoTDeviceEntityProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
IoTDeviceEntityProperties deserializedIoTDeviceEntityProperties = new IoTDeviceEntityProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("additionalData".equals(fieldName)) {
Map additionalData = reader.readMap(reader1 -> reader1.readUntyped());
deserializedIoTDeviceEntityProperties.additionalData = additionalData;
} else if ("friendlyName".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.friendlyName = reader.getString();
} else if ("deviceId".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.deviceId = reader.getString();
} else if ("deviceName".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.deviceName = reader.getString();
} else if ("source".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.source = reader.getString();
} else if ("iotSecurityAgentId".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.iotSecurityAgentId
= reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
} else if ("deviceType".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.deviceType = reader.getString();
} else if ("vendor".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.vendor = reader.getString();
} else if ("edgeId".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.edgeId = reader.getString();
} else if ("macAddress".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.macAddress = reader.getString();
} else if ("model".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.model = reader.getString();
} else if ("serialNumber".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.serialNumber = reader.getString();
} else if ("firmwareVersion".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.firmwareVersion = reader.getString();
} else if ("operatingSystem".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.operatingSystem = reader.getString();
} else if ("iotHubEntityId".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.iotHubEntityId = reader.getString();
} else if ("hostEntityId".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.hostEntityId = reader.getString();
} else if ("ipAddressEntityId".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.ipAddressEntityId = reader.getString();
} else if ("threatIntelligence".equals(fieldName)) {
List threatIntelligence
= reader.readArray(reader1 -> ThreatIntelligence.fromJson(reader1));
deserializedIoTDeviceEntityProperties.threatIntelligence = threatIntelligence;
} else if ("protocols".equals(fieldName)) {
List protocols = reader.readArray(reader1 -> reader1.getString());
deserializedIoTDeviceEntityProperties.protocols = protocols;
} else if ("owners".equals(fieldName)) {
List owners = reader.readArray(reader1 -> reader1.getString());
deserializedIoTDeviceEntityProperties.owners = owners;
} else if ("nicEntityIds".equals(fieldName)) {
List nicEntityIds = reader.readArray(reader1 -> reader1.getString());
deserializedIoTDeviceEntityProperties.nicEntityIds = nicEntityIds;
} else if ("site".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.site = reader.getString();
} else if ("zone".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.zone = reader.getString();
} else if ("sensor".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.sensor = reader.getString();
} else if ("deviceSubType".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.deviceSubType = reader.getString();
} else if ("importance".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.importance = DeviceImportance.fromString(reader.getString());
} else if ("purdueLayer".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.purdueLayer = reader.getString();
} else if ("isAuthorized".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.isAuthorized = reader.getNullable(JsonReader::getBoolean);
} else if ("isProgramming".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.isProgramming = reader.getNullable(JsonReader::getBoolean);
} else if ("isScanner".equals(fieldName)) {
deserializedIoTDeviceEntityProperties.isScanner = reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedIoTDeviceEntityProperties;
});
}
}