diff --git a/azure-eventgrid/azure/eventgrid/models/__init__.py b/azure-eventgrid/azure/eventgrid/models/__init__.py index 57ba4b413989..60497d8405a1 100644 --- a/azure-eventgrid/azure/eventgrid/models/__init__.py +++ b/azure-eventgrid/azure/eventgrid/models/__init__.py @@ -25,12 +25,16 @@ from .subscription_deleted_event_data_py3 import SubscriptionDeletedEventData from .iot_hub_device_created_event_data_py3 import IotHubDeviceCreatedEventData from .iot_hub_device_deleted_event_data_py3 import IotHubDeviceDeletedEventData + from .iot_hub_device_connected_event_data_py3 import IotHubDeviceConnectedEventData + from .iot_hub_device_disconnected_event_data_py3 import IotHubDeviceDisconnectedEventData from .device_twin_metadata_py3 import DeviceTwinMetadata from .device_twin_properties_py3 import DeviceTwinProperties from .device_twin_info_properties_py3 import DeviceTwinInfoProperties from .device_twin_info_x509_thumbprint_py3 import DeviceTwinInfoX509Thumbprint from .device_twin_info_py3 import DeviceTwinInfo from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties + from .device_connection_state_event_info_py3 import DeviceConnectionStateEventInfo + from .device_connection_state_event_properties_py3 import DeviceConnectionStateEventProperties from .container_registry_image_pushed_event_data_py3 import ContainerRegistryImagePushedEventData from .container_registry_image_deleted_event_data_py3 import ContainerRegistryImageDeletedEventData from .container_registry_event_target_py3 import ContainerRegistryEventTarget @@ -57,12 +61,16 @@ from .subscription_deleted_event_data import SubscriptionDeletedEventData from .iot_hub_device_created_event_data import IotHubDeviceCreatedEventData from .iot_hub_device_deleted_event_data import IotHubDeviceDeletedEventData + from .iot_hub_device_connected_event_data import IotHubDeviceConnectedEventData + from .iot_hub_device_disconnected_event_data import IotHubDeviceDisconnectedEventData from .device_twin_metadata import DeviceTwinMetadata from .device_twin_properties import DeviceTwinProperties from .device_twin_info_properties import DeviceTwinInfoProperties from .device_twin_info_x509_thumbprint import DeviceTwinInfoX509Thumbprint from .device_twin_info import DeviceTwinInfo from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties + from .device_connection_state_event_info import DeviceConnectionStateEventInfo + from .device_connection_state_event_properties import DeviceConnectionStateEventProperties from .container_registry_image_pushed_event_data import ContainerRegistryImagePushedEventData from .container_registry_image_deleted_event_data import ContainerRegistryImageDeletedEventData from .container_registry_event_target import ContainerRegistryEventTarget @@ -93,12 +101,16 @@ 'SubscriptionDeletedEventData', 'IotHubDeviceCreatedEventData', 'IotHubDeviceDeletedEventData', + 'IotHubDeviceConnectedEventData', + 'IotHubDeviceDisconnectedEventData', 'DeviceTwinMetadata', 'DeviceTwinProperties', 'DeviceTwinInfoProperties', 'DeviceTwinInfoX509Thumbprint', 'DeviceTwinInfo', 'DeviceLifeCycleEventProperties', + 'DeviceConnectionStateEventInfo', + 'DeviceConnectionStateEventProperties', 'ContainerRegistryImagePushedEventData', 'ContainerRegistryImageDeletedEventData', 'ContainerRegistryEventTarget', diff --git a/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info.py b/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info.py new file mode 100644 index 000000000000..7a110cab64af --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeviceConnectionStateEventInfo(Model): + """Information about the device connection state event. + + :param sequence_number: Sequence number is string representation of a + hexadecimal number. string compare can be used to identify the larger + number because both in ASCII and HEX numbers come after alphabets. If you + are converting the string to hex, then the number is a 256 bit number. + :type sequence_number: str + """ + + _attribute_map = { + 'sequence_number': {'key': 'sequenceNumber', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeviceConnectionStateEventInfo, self).__init__(**kwargs) + self.sequence_number = kwargs.get('sequence_number', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info_py3.py b/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info_py3.py new file mode 100644 index 000000000000..0ef8c03b2074 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_info_py3.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeviceConnectionStateEventInfo(Model): + """Information about the device connection state event. + + :param sequence_number: Sequence number is string representation of a + hexadecimal number. string compare can be used to identify the larger + number because both in ASCII and HEX numbers come after alphabets. If you + are converting the string to hex, then the number is a 256 bit number. + :type sequence_number: str + """ + + _attribute_map = { + 'sequence_number': {'key': 'sequenceNumber', 'type': 'str'}, + } + + def __init__(self, *, sequence_number: str=None, **kwargs) -> None: + super(DeviceConnectionStateEventInfo, self).__init__(**kwargs) + self.sequence_number = sequence_number diff --git a/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties.py b/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties.py new file mode 100644 index 000000000000..04a5a1aefcb0 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeviceConnectionStateEventProperties(Model): + """Schema of the Data property of an EventGridEvent for a device connection + state event (DeviceConnected, DeviceDisconnected). + + :param device_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param module_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type module_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param device_connection_state_event_info: Information about the device + connection state event. + :type device_connection_state_event_info: + ~azure.eventgrid.models.DeviceConnectionStateEventInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'module_id': {'key': 'moduleId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, + } + + def __init__(self, **kwargs): + super(DeviceConnectionStateEventProperties, self).__init__(**kwargs) + self.device_id = kwargs.get('device_id', None) + self.module_id = kwargs.get('module_id', None) + self.hub_name = kwargs.get('hub_name', None) + self.device_connection_state_event_info = kwargs.get('device_connection_state_event_info', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties_py3.py b/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties_py3.py new file mode 100644 index 000000000000..b8c339e55f64 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_connection_state_event_properties_py3.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeviceConnectionStateEventProperties(Model): + """Schema of the Data property of an EventGridEvent for a device connection + state event (DeviceConnected, DeviceDisconnected). + + :param device_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param module_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type module_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param device_connection_state_event_info: Information about the device + connection state event. + :type device_connection_state_event_info: + ~azure.eventgrid.models.DeviceConnectionStateEventInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'module_id': {'key': 'moduleId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, + } + + def __init__(self, *, device_id: str=None, module_id: str=None, hub_name: str=None, device_connection_state_event_info=None, **kwargs) -> None: + super(DeviceConnectionStateEventProperties, self).__init__(**kwargs) + self.device_id = device_id + self.module_id = module_id + self.hub_name = hub_name + self.device_connection_state_event_info = device_connection_state_event_info diff --git a/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py b/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py index daa20dc9ef06..b6cf0e6f2961 100644 --- a/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py +++ b/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties.py @@ -24,21 +24,14 @@ class DeviceLifeCycleEventProperties(Model): :param hub_name: Name of the IoT Hub where the device was created or deleted. :type hub_name: str - :param op_type: The event type specified for this operation by the IoT - Hub. - :type op_type: str - :param operation_timestamp: The ISO8601 timestamp of the operation. - :type operation_timestamp: str :param twin: Information about the device twin, which is the cloud - represenation of application device metadata. + representation of application device metadata. :type twin: ~azure.eventgrid.models.DeviceTwinInfo """ _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'op_type': {'key': 'opType', 'type': 'str'}, - 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, } @@ -46,6 +39,4 @@ def __init__(self, **kwargs): super(DeviceLifeCycleEventProperties, self).__init__(**kwargs) self.device_id = kwargs.get('device_id', None) self.hub_name = kwargs.get('hub_name', None) - self.op_type = kwargs.get('op_type', None) - self.operation_timestamp = kwargs.get('operation_timestamp', None) self.twin = kwargs.get('twin', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py b/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py index f5033203064f..f203cf9f1005 100644 --- a/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py +++ b/azure-eventgrid/azure/eventgrid/models/device_life_cycle_event_properties_py3.py @@ -24,28 +24,19 @@ class DeviceLifeCycleEventProperties(Model): :param hub_name: Name of the IoT Hub where the device was created or deleted. :type hub_name: str - :param op_type: The event type specified for this operation by the IoT - Hub. - :type op_type: str - :param operation_timestamp: The ISO8601 timestamp of the operation. - :type operation_timestamp: str :param twin: Information about the device twin, which is the cloud - represenation of application device metadata. + representation of application device metadata. :type twin: ~azure.eventgrid.models.DeviceTwinInfo """ _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'op_type': {'key': 'opType', 'type': 'str'}, - 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, } - def __init__(self, *, device_id: str=None, hub_name: str=None, op_type: str=None, operation_timestamp: str=None, twin=None, **kwargs) -> None: + def __init__(self, *, device_id: str=None, hub_name: str=None, twin=None, **kwargs) -> None: super(DeviceLifeCycleEventProperties, self).__init__(**kwargs) self.device_id = device_id self.hub_name = hub_name - self.op_type = op_type - self.operation_timestamp = operation_timestamp self.twin = twin diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_info.py b/azure-eventgrid/azure/eventgrid/models/device_twin_info.py index 4f7782f31aa2..a3c555d320cf 100644 --- a/azure-eventgrid/azure/eventgrid/models/device_twin_info.py +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_info.py @@ -13,7 +13,7 @@ class DeviceTwinInfo(Model): - """Information about the device twin, which is the cloud represenation of + """Information about the device twin, which is the cloud representation of application device metadata. :param authentication_type: Authentication type used for this device: diff --git a/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py b/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py index c496c850aba0..e74f3c65e994 100644 --- a/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py +++ b/azure-eventgrid/azure/eventgrid/models/device_twin_info_py3.py @@ -13,7 +13,7 @@ class DeviceTwinInfo(Model): - """Information about the device twin, which is the cloud represenation of + """Information about the device twin, which is the cloud representation of application device metadata. :param authentication_type: Authentication type used for this device: diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data.py new file mode 100644 index 000000000000..9f48f9c10abc --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .device_connection_state_event_properties import DeviceConnectionStateEventProperties + + +class IotHubDeviceConnectedEventData(DeviceConnectionStateEventProperties): + """Event data for Microsoft.Devices.DeviceConnected event. + + :param device_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param module_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type module_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param device_connection_state_event_info: Information about the device + connection state event. + :type device_connection_state_event_info: + ~azure.eventgrid.models.DeviceConnectionStateEventInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'module_id': {'key': 'moduleId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, + } + + def __init__(self, **kwargs): + super(IotHubDeviceConnectedEventData, self).__init__(**kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data_py3.py new file mode 100644 index 000000000000..3c4791507b54 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_connected_event_data_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .device_connection_state_event_properties_py3 import DeviceConnectionStateEventProperties + + +class IotHubDeviceConnectedEventData(DeviceConnectionStateEventProperties): + """Event data for Microsoft.Devices.DeviceConnected event. + + :param device_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param module_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type module_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param device_connection_state_event_info: Information about the device + connection state event. + :type device_connection_state_event_info: + ~azure.eventgrid.models.DeviceConnectionStateEventInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'module_id': {'key': 'moduleId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, + } + + def __init__(self, *, device_id: str=None, module_id: str=None, hub_name: str=None, device_connection_state_event_info=None, **kwargs) -> None: + super(IotHubDeviceConnectedEventData, self).__init__(device_id=device_id, module_id=module_id, hub_name=hub_name, device_connection_state_event_info=device_connection_state_event_info, **kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py index 92c5392dd4c8..df911f0b0456 100644 --- a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data.py @@ -23,21 +23,14 @@ class IotHubDeviceCreatedEventData(DeviceLifeCycleEventProperties): :param hub_name: Name of the IoT Hub where the device was created or deleted. :type hub_name: str - :param op_type: The event type specified for this operation by the IoT - Hub. - :type op_type: str - :param operation_timestamp: The ISO8601 timestamp of the operation. - :type operation_timestamp: str :param twin: Information about the device twin, which is the cloud - represenation of application device metadata. + representation of application device metadata. :type twin: ~azure.eventgrid.models.DeviceTwinInfo """ _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'op_type': {'key': 'opType', 'type': 'str'}, - 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, } diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py index 02b0ee8ce99d..e8d497edc97e 100644 --- a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_created_event_data_py3.py @@ -23,23 +23,16 @@ class IotHubDeviceCreatedEventData(DeviceLifeCycleEventProperties): :param hub_name: Name of the IoT Hub where the device was created or deleted. :type hub_name: str - :param op_type: The event type specified for this operation by the IoT - Hub. - :type op_type: str - :param operation_timestamp: The ISO8601 timestamp of the operation. - :type operation_timestamp: str :param twin: Information about the device twin, which is the cloud - represenation of application device metadata. + representation of application device metadata. :type twin: ~azure.eventgrid.models.DeviceTwinInfo """ _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'op_type': {'key': 'opType', 'type': 'str'}, - 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, } - def __init__(self, *, device_id: str=None, hub_name: str=None, op_type: str=None, operation_timestamp: str=None, twin=None, **kwargs) -> None: - super(IotHubDeviceCreatedEventData, self).__init__(device_id=device_id, hub_name=hub_name, op_type=op_type, operation_timestamp=operation_timestamp, twin=twin, **kwargs) + def __init__(self, *, device_id: str=None, hub_name: str=None, twin=None, **kwargs) -> None: + super(IotHubDeviceCreatedEventData, self).__init__(device_id=device_id, hub_name=hub_name, twin=twin, **kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py index 95fbdd3e1cca..92d7e5c9c67f 100644 --- a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data.py @@ -23,21 +23,14 @@ class IotHubDeviceDeletedEventData(DeviceLifeCycleEventProperties): :param hub_name: Name of the IoT Hub where the device was created or deleted. :type hub_name: str - :param op_type: The event type specified for this operation by the IoT - Hub. - :type op_type: str - :param operation_timestamp: The ISO8601 timestamp of the operation. - :type operation_timestamp: str :param twin: Information about the device twin, which is the cloud - represenation of application device metadata. + representation of application device metadata. :type twin: ~azure.eventgrid.models.DeviceTwinInfo """ _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'op_type': {'key': 'opType', 'type': 'str'}, - 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, } diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py index a090981744a5..635003d7176c 100644 --- a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_deleted_event_data_py3.py @@ -23,23 +23,16 @@ class IotHubDeviceDeletedEventData(DeviceLifeCycleEventProperties): :param hub_name: Name of the IoT Hub where the device was created or deleted. :type hub_name: str - :param op_type: The event type specified for this operation by the IoT - Hub. - :type op_type: str - :param operation_timestamp: The ISO8601 timestamp of the operation. - :type operation_timestamp: str :param twin: Information about the device twin, which is the cloud - represenation of application device metadata. + representation of application device metadata. :type twin: ~azure.eventgrid.models.DeviceTwinInfo """ _attribute_map = { 'device_id': {'key': 'deviceId', 'type': 'str'}, 'hub_name': {'key': 'hubName', 'type': 'str'}, - 'op_type': {'key': 'opType', 'type': 'str'}, - 'operation_timestamp': {'key': 'operationTimestamp', 'type': 'str'}, 'twin': {'key': 'twin', 'type': 'DeviceTwinInfo'}, } - def __init__(self, *, device_id: str=None, hub_name: str=None, op_type: str=None, operation_timestamp: str=None, twin=None, **kwargs) -> None: - super(IotHubDeviceDeletedEventData, self).__init__(device_id=device_id, hub_name=hub_name, op_type=op_type, operation_timestamp=operation_timestamp, twin=twin, **kwargs) + def __init__(self, *, device_id: str=None, hub_name: str=None, twin=None, **kwargs) -> None: + super(IotHubDeviceDeletedEventData, self).__init__(device_id=device_id, hub_name=hub_name, twin=twin, **kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data.py new file mode 100644 index 000000000000..0de85a3a601f --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .device_connection_state_event_properties import DeviceConnectionStateEventProperties + + +class IotHubDeviceDisconnectedEventData(DeviceConnectionStateEventProperties): + """Event data for Microsoft.Devices.DeviceDisconnected event. + + :param device_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param module_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type module_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param device_connection_state_event_info: Information about the device + connection state event. + :type device_connection_state_event_info: + ~azure.eventgrid.models.DeviceConnectionStateEventInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'module_id': {'key': 'moduleId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, + } + + def __init__(self, **kwargs): + super(IotHubDeviceDisconnectedEventData, self).__init__(**kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data_py3.py new file mode 100644 index 000000000000..d340d625e90c --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_disconnected_event_data_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .device_connection_state_event_properties_py3 import DeviceConnectionStateEventProperties + + +class IotHubDeviceDisconnectedEventData(DeviceConnectionStateEventProperties): + """Event data for Microsoft.Devices.DeviceDisconnected event. + + :param device_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type device_id: str + :param module_id: 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: - : . + % _ + # * ? ! ( ) , = @ ; $ '. + :type module_id: str + :param hub_name: Name of the IoT Hub where the device was created or + deleted. + :type hub_name: str + :param device_connection_state_event_info: Information about the device + connection state event. + :type device_connection_state_event_info: + ~azure.eventgrid.models.DeviceConnectionStateEventInfo + """ + + _attribute_map = { + 'device_id': {'key': 'deviceId', 'type': 'str'}, + 'module_id': {'key': 'moduleId', 'type': 'str'}, + 'hub_name': {'key': 'hubName', 'type': 'str'}, + 'device_connection_state_event_info': {'key': 'deviceConnectionStateEventInfo', 'type': 'DeviceConnectionStateEventInfo'}, + } + + def __init__(self, *, device_id: str=None, module_id: str=None, hub_name: str=None, device_connection_state_event_info=None, **kwargs) -> None: + super(IotHubDeviceDisconnectedEventData, self).__init__(device_id=device_id, module_id=module_id, hub_name=hub_name, device_connection_state_event_info=device_connection_state_event_info, **kwargs) diff --git a/azure-eventgrid/azure/eventgrid/version.py b/azure-eventgrid/azure/eventgrid/version.py index 24b9de3384da..a39916c162ce 100644 --- a/azure-eventgrid/azure/eventgrid/version.py +++ b/azure-eventgrid/azure/eventgrid/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0" +VERSION = "1.0.0"