Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventGrid DataPlane SDK: Regenerated the SDK based on latest swagger. #3181

Merged
merged 4 commits into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions azure-eventgrid/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

1.2.0 (2018-08-28)
++++++++++++++++++

- Event Schemas for new events (IotHub DeviceConnected and DeviceDisconnected events, Resource events related to actions), and breaking changes to the schema for IotHub DeviceCreated event and IotHub DeviceDeleted event.

1.1.0 (2018-05-24)
++++++++++++++++++

Expand Down
8 changes: 1 addition & 7 deletions azure-eventgrid/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ Microsoft Azure SDK for Python

This is the Microsoft Azure Event Grid Client Library.

Azure Resource Manager (ARM) is the next generation of management APIs that
replace the old Azure Service Management (ASM).

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.

For the older Azure Service Management (ASM) libraries, see
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.

Expand Down
21 changes: 21 additions & 0 deletions azure-eventgrid/azure/eventgrid/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,25 @@
from .resource_delete_success_data_py3 import ResourceDeleteSuccessData
from .resource_delete_failure_data_py3 import ResourceDeleteFailureData
from .resource_delete_cancel_data_py3 import ResourceDeleteCancelData
from .resource_action_success_data_py3 import ResourceActionSuccessData
from .resource_action_failure_data_py3 import ResourceActionFailureData
from .resource_action_cancel_data_py3 import ResourceActionCancelData
from .event_grid_event_py3 import EventGridEvent
from .subscription_validation_event_data_py3 import SubscriptionValidationEventData
from .subscription_validation_response_py3 import SubscriptionValidationResponse
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
Expand All @@ -51,18 +58,25 @@
from .resource_delete_success_data import ResourceDeleteSuccessData
from .resource_delete_failure_data import ResourceDeleteFailureData
from .resource_delete_cancel_data import ResourceDeleteCancelData
from .resource_action_success_data import ResourceActionSuccessData
from .resource_action_failure_data import ResourceActionFailureData
from .resource_action_cancel_data import ResourceActionCancelData
from .event_grid_event import EventGridEvent
from .subscription_validation_event_data import SubscriptionValidationEventData
from .subscription_validation_response import SubscriptionValidationResponse
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
Expand All @@ -87,18 +101,25 @@
'ResourceDeleteSuccessData',
'ResourceDeleteFailureData',
'ResourceDeleteCancelData',
'ResourceActionSuccessData',
'ResourceActionFailureData',
'ResourceActionCancelData',
'EventGridEvent',
'SubscriptionValidationEventData',
'SubscriptionValidationResponse',
'SubscriptionDeletedEventData',
'IotHubDeviceCreatedEventData',
'IotHubDeviceDeletedEventData',
'IotHubDeviceConnectedEventData',
'IotHubDeviceDisconnectedEventData',
'DeviceTwinMetadata',
'DeviceTwinProperties',
'DeviceTwinInfoProperties',
'DeviceTwinInfoX509Thumbprint',
'DeviceTwinInfo',
'DeviceLifeCycleEventProperties',
'DeviceConnectionStateEventInfo',
'DeviceConnectionStateEventProperties',
'ContainerRegistryImagePushedEventData',
'ContainerRegistryImageDeletedEventData',
'ContainerRegistryEventTarget',
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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: - : . + % _
&#35; * ? ! ( ) , = @ ; $ '.
: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: - : . + % _
&#35; * ? ! ( ) , = @ ; $ '.
: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)
Original file line number Diff line number Diff line change
@@ -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: - : . + % _
&#35; * ? ! ( ) , = @ ; $ '.
: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: - : . + % _
&#35; * ? ! ( ) , = @ ; $ '.
: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
Original file line number Diff line number Diff line change
Expand Up @@ -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, **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)
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion azure-eventgrid/azure/eventgrid/models/device_twin_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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: - : . + % _
&#35; * ? ! ( ) , = @ ; $ '.
: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: - : . + % _
&#35; * ? ! ( ) , = @ ; $ '.
: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)
Loading