Class DeviceLifeCycleEventProperties
java.lang.Object
com.azure.messaging.eventgrid.systemevents.DeviceLifeCycleEventProperties
- All Implemented Interfaces:
com.azure.json.JsonSerializable<DeviceLifeCycleEventProperties>
- Direct Known Subclasses:
IotHubDeviceCreatedEventData,IotHubDeviceDeletedEventData
public class DeviceLifeCycleEventProperties
extends Object
implements com.azure.json.JsonSerializable<DeviceLifeCycleEventProperties>
Schema of the Data property of an EventGridEvent for a device life cycle event (DeviceCreated, DeviceDeleted).
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeviceLifeCycleEventProperties(String deviceId, String hubName, DeviceTwinInfo twin) Creates an instance of DeviceLifeCycleEventProperties class. -
Method Summary
Modifier and TypeMethodDescriptionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of DeviceLifeCycleEventProperties from the JsonReader.Get the deviceId property: The unique identifier of the device.Get the hubName property: Name of the IoT Hub where the device was created or deleted.getTwin()Get the twin property: Information about the device twin, which is the cloud representation of application device metadata.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
DeviceLifeCycleEventProperties
Creates an instance of DeviceLifeCycleEventProperties class.- Parameters:
deviceId- the deviceId value to set.hubName- the hubName value to set.twin- the twin value to set.
-
-
Method Details
-
getDeviceId
Get the deviceId property: The unique identifier of the device. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ # * ? ! ( ) , = `@` ; $ '.- Returns:
- the deviceId value.
-
getHubName
Get the hubName property: Name of the IoT Hub where the device was created or deleted.- Returns:
- the hubName value.
-
getTwin
Get the twin property: Information about the device twin, which is the cloud representation of application device metadata.- Returns:
- the twin value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<DeviceLifeCycleEventProperties>- Throws:
IOException
-
fromJson
public static DeviceLifeCycleEventProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of DeviceLifeCycleEventProperties from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of DeviceLifeCycleEventProperties if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the DeviceLifeCycleEventProperties.
-