diff --git a/azure-eventgrid/README.rst b/azure-eventgrid/README.rst index dd5266c639ec..917e45cba5e9 100644 --- a/azure-eventgrid/README.rst +++ b/azure-eventgrid/README.rst @@ -22,3 +22,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-eventgrid%2FREADME.png diff --git a/azure-eventgrid/azure/eventgrid/models/__init__.py b/azure-eventgrid/azure/eventgrid/models/__init__.py index 60f75159e94b..355df072cd54 100644 --- a/azure-eventgrid/azure/eventgrid/models/__init__.py +++ b/azure-eventgrid/azure/eventgrid/models/__init__.py @@ -30,6 +30,7 @@ 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 .iot_hub_device_telemetry_event_data_py3 import IotHubDeviceTelemetryEventData from .device_twin_metadata_py3 import DeviceTwinMetadata from .device_twin_properties_py3 import DeviceTwinProperties from .device_twin_info_properties_py3 import DeviceTwinInfoProperties @@ -38,6 +39,7 @@ 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 .device_telemetry_event_properties_py3 import DeviceTelemetryEventProperties from .container_registry_image_pushed_event_data_py3 import ContainerRegistryImagePushedEventData from .container_registry_image_deleted_event_data_py3 import ContainerRegistryImageDeletedEventData from .container_registry_chart_pushed_event_data_py3 import ContainerRegistryChartPushedEventData @@ -107,6 +109,7 @@ 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 .iot_hub_device_telemetry_event_data import IotHubDeviceTelemetryEventData from .device_twin_metadata import DeviceTwinMetadata from .device_twin_properties import DeviceTwinProperties from .device_twin_info_properties import DeviceTwinInfoProperties @@ -115,6 +118,7 @@ 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 .device_telemetry_event_properties import DeviceTelemetryEventProperties from .container_registry_image_pushed_event_data import ContainerRegistryImagePushedEventData from .container_registry_image_deleted_event_data import ContainerRegistryImageDeletedEventData from .container_registry_chart_pushed_event_data import ContainerRegistryChartPushedEventData @@ -191,6 +195,7 @@ 'IotHubDeviceDeletedEventData', 'IotHubDeviceConnectedEventData', 'IotHubDeviceDisconnectedEventData', + 'IotHubDeviceTelemetryEventData', 'DeviceTwinMetadata', 'DeviceTwinProperties', 'DeviceTwinInfoProperties', @@ -199,6 +204,7 @@ 'DeviceLifeCycleEventProperties', 'DeviceConnectionStateEventInfo', 'DeviceConnectionStateEventProperties', + 'DeviceTelemetryEventProperties', 'ContainerRegistryImagePushedEventData', 'ContainerRegistryImageDeletedEventData', 'ContainerRegistryChartPushedEventData', diff --git a/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties.py b/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties.py new file mode 100644 index 000000000000..5ef54c29c86d --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties.py @@ -0,0 +1,39 @@ +# 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 DeviceTelemetryEventProperties(Model): + """Schema of the Data property of an EventGridEvent for a device telemetry + event (DeviceTelemetry). + + :param body: The content of the message from the device. + :type body: object + :param properties: Application properties are user-defined strings that + can be added to the message. These fields are optional. + :type properties: dict[str, str] + :param system_properties: System properties help identify contents and + source of the messages. + :type system_properties: dict[str, str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DeviceTelemetryEventProperties, self).__init__(**kwargs) + self.body = kwargs.get('body', None) + self.properties = kwargs.get('properties', None) + self.system_properties = kwargs.get('system_properties', None) diff --git a/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties_py3.py b/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties_py3.py new file mode 100644 index 000000000000..57fdb9114dc5 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/device_telemetry_event_properties_py3.py @@ -0,0 +1,39 @@ +# 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 DeviceTelemetryEventProperties(Model): + """Schema of the Data property of an EventGridEvent for a device telemetry + event (DeviceTelemetry). + + :param body: The content of the message from the device. + :type body: object + :param properties: Application properties are user-defined strings that + can be added to the message. These fields are optional. + :type properties: dict[str, str] + :param system_properties: System properties help identify contents and + source of the messages. + :type system_properties: dict[str, str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, + } + + def __init__(self, *, body=None, properties=None, system_properties=None, **kwargs) -> None: + super(DeviceTelemetryEventProperties, self).__init__(**kwargs) + self.body = body + self.properties = properties + self.system_properties = system_properties diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data.py new file mode 100644 index 000000000000..68327f110245 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data.py @@ -0,0 +1,35 @@ +# 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_telemetry_event_properties import DeviceTelemetryEventProperties + + +class IotHubDeviceTelemetryEventData(DeviceTelemetryEventProperties): + """Event data for Microsoft.Devices.DeviceTelemetry event. + + :param body: The content of the message from the device. + :type body: object + :param properties: Application properties are user-defined strings that + can be added to the message. These fields are optional. + :type properties: dict[str, str] + :param system_properties: System properties help identify contents and + source of the messages. + :type system_properties: dict[str, str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(IotHubDeviceTelemetryEventData, self).__init__(**kwargs) diff --git a/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data_py3.py new file mode 100644 index 000000000000..99ff68ce2594 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/iot_hub_device_telemetry_event_data_py3.py @@ -0,0 +1,35 @@ +# 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_telemetry_event_properties_py3 import DeviceTelemetryEventProperties + + +class IotHubDeviceTelemetryEventData(DeviceTelemetryEventProperties): + """Event data for Microsoft.Devices.DeviceTelemetry event. + + :param body: The content of the message from the device. + :type body: object + :param properties: Application properties are user-defined strings that + can be added to the message. These fields are optional. + :type properties: dict[str, str] + :param system_properties: System properties help identify contents and + source of the messages. + :type system_properties: dict[str, str] + """ + + _attribute_map = { + 'body': {'key': 'body', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'system_properties': {'key': 'systemProperties', 'type': '{str}'}, + } + + def __init__(self, *, body=None, properties=None, system_properties=None, **kwargs) -> None: + super(IotHubDeviceTelemetryEventData, self).__init__(body=body, properties=properties, system_properties=system_properties, **kwargs) diff --git a/azure-eventgrid/setup.py b/azure-eventgrid/setup.py index 35c7d8087e6a..f43c64560ac5 100644 --- a/azure-eventgrid/setup.py +++ b/azure-eventgrid/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',