Class DeviceConnectionStateEventProperties

java.lang.Object
com.azure.messaging.eventgrid.systemevents.DeviceConnectionStateEventProperties
All Implemented Interfaces:
com.azure.json.JsonSerializable<DeviceConnectionStateEventProperties>
Direct Known Subclasses:
IotHubDeviceConnectedEventData, IotHubDeviceDisconnectedEventData

public class DeviceConnectionStateEventProperties extends Object implements com.azure.json.JsonSerializable<DeviceConnectionStateEventProperties>
Schema of the Data property of an EventGridEvent for a device connection state event (DeviceConnected, DeviceDisconnected).
  • Constructor Details

    • DeviceConnectionStateEventProperties

      protected DeviceConnectionStateEventProperties(String deviceId, String hubName, DeviceConnectionStateEventInfo deviceConnectionStateEventInfo)
      Creates an instance of DeviceConnectionStateEventProperties class.
      Parameters:
      deviceId - the deviceId value to set.
      hubName - the hubName value to set.
      deviceConnectionStateEventInfo - the deviceConnectionStateEventInfo value to set.
  • Method Details

    • getDeviceId

      public String 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: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '.
      Returns:
      the deviceId value.
    • getModuleId

      public String getModuleId()
      Get the moduleId property: The unique identifier of the module. This case-sensitive string can be up to 128 characters long, and supports ASCII 7-bit alphanumeric characters plus the following special characters: - : . + % _ &#35; * ? ! ( ) , = `@` ; $ '.
      Returns:
      the moduleId value.
    • getHubName

      public String getHubName()
      Get the hubName property: Name of the IoT Hub where the device was created or deleted.
      Returns:
      the hubName value.
    • getDeviceConnectionStateEventInfo

      public DeviceConnectionStateEventInfo getDeviceConnectionStateEventInfo()
      Get the deviceConnectionStateEventInfo property: Information about the device connection state event.
      Returns:
      the deviceConnectionStateEventInfo value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<DeviceConnectionStateEventProperties>
      Throws:
      IOException
    • fromJson

      public static DeviceConnectionStateEventProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of DeviceConnectionStateEventProperties from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of DeviceConnectionStateEventProperties 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 DeviceConnectionStateEventProperties.