From 8a491dc195ea8d593f7038cebf8231a340d5de2b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 8 May 2018 09:01:00 -0700 Subject: [PATCH 1/3] Generated from 300790b66c1157425c03aaace75edace1f39d38d (#2539) Add ServiceBus Messaging Integration Events with EventGrid to the EventGrid spec --- .../azure/eventgrid/models/__init__.py | 6 ++ ..._available_with_no_listeners_event_data.py | 55 +++++++++++++++++++ ...ilable_with_no_listeners_event_data_py3.py | 55 +++++++++++++++++++ ..._available_with_no_listeners_event_data.py | 55 +++++++++++++++++++ ...ilable_with_no_listeners_event_data_py3.py | 55 +++++++++++++++++++ 5 files changed, 226 insertions(+) create mode 100644 azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data.py create mode 100644 azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data_py3.py create mode 100644 azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data.py create mode 100644 azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data_py3.py diff --git a/azure-eventgrid/azure/eventgrid/models/__init__.py b/azure-eventgrid/azure/eventgrid/models/__init__.py index ddea8d9d1677..88e6490d4025 100644 --- a/azure-eventgrid/azure/eventgrid/models/__init__.py +++ b/azure-eventgrid/azure/eventgrid/models/__init__.py @@ -35,6 +35,8 @@ from .container_registry_event_actor_py3 import ContainerRegistryEventActor from .container_registry_event_source_py3 import ContainerRegistryEventSource from .container_registry_event_data_py3 import ContainerRegistryEventData + from .service_bus_active_messages_available_with_no_listeners_event_data_py3 import ServiceBusActiveMessagesAvailableWithNoListenersEventData + from .service_bus_deadletter_messages_available_with_no_listeners_event_data_py3 import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData except (SyntaxError, ImportError): from .storage_blob_created_event_data import StorageBlobCreatedEventData from .storage_blob_deleted_event_data import StorageBlobDeletedEventData @@ -61,6 +63,8 @@ from .container_registry_event_actor import ContainerRegistryEventActor from .container_registry_event_source import ContainerRegistryEventSource from .container_registry_event_data import ContainerRegistryEventData + from .service_bus_active_messages_available_with_no_listeners_event_data import ServiceBusActiveMessagesAvailableWithNoListenersEventData + from .service_bus_deadletter_messages_available_with_no_listeners_event_data import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData __all__ = [ 'StorageBlobCreatedEventData', @@ -88,4 +92,6 @@ 'ContainerRegistryEventActor', 'ContainerRegistryEventSource', 'ContainerRegistryEventData', + 'ServiceBusActiveMessagesAvailableWithNoListenersEventData', + 'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData', ] diff --git a/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data.py b/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data.py new file mode 100644 index 000000000000..c409c8396a05 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data.py @@ -0,0 +1,55 @@ +# 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 ServiceBusActiveMessagesAvailableWithNoListenersEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. + + :param namespace_name: The namespace name of the Microsoft.ServiceBus + resource. + :type namespace_name: str + :param request_uri: The endpoint of the Microsoft.ServiceBus resource. + :type request_uri: str + :param entity_type: The entity type of the Microsoft.ServiceBus resource. + Could be one of 'queue' or 'subscriber'. + :type entity_type: str + :param queue_name: The name of the Microsoft.ServiceBus queue. If the + entity type is of type 'subscriber', then this value will be null. + :type queue_name: str + :param topic_name: The name of the Microsoft.ServiceBus topic. If the + entity type is of type 'queue', then this value will be null. + :type topic_name: str + :param subscription_name: The name of the Microsoft.ServiceBus topic's + subscription. If the entity type is of type 'queue', then this value will + be null. + :type subscription_name: str + """ + + _attribute_map = { + 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'queue_name': {'key': 'queueName', 'type': 'str'}, + 'topic_name': {'key': 'topicName', 'type': 'str'}, + 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceBusActiveMessagesAvailableWithNoListenersEventData, self).__init__(**kwargs) + self.namespace_name = kwargs.get('namespace_name', None) + self.request_uri = kwargs.get('request_uri', None) + self.entity_type = kwargs.get('entity_type', None) + self.queue_name = kwargs.get('queue_name', None) + self.topic_name = kwargs.get('topic_name', None) + self.subscription_name = kwargs.get('subscription_name', None) diff --git a/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data_py3.py new file mode 100644 index 000000000000..35a4108ae4d9 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/service_bus_active_messages_available_with_no_listeners_event_data_py3.py @@ -0,0 +1,55 @@ +# 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 ServiceBusActiveMessagesAvailableWithNoListenersEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.ServiceBus.ActiveMessagesAvailableWithNoListeners event. + + :param namespace_name: The namespace name of the Microsoft.ServiceBus + resource. + :type namespace_name: str + :param request_uri: The endpoint of the Microsoft.ServiceBus resource. + :type request_uri: str + :param entity_type: The entity type of the Microsoft.ServiceBus resource. + Could be one of 'queue' or 'subscriber'. + :type entity_type: str + :param queue_name: The name of the Microsoft.ServiceBus queue. If the + entity type is of type 'subscriber', then this value will be null. + :type queue_name: str + :param topic_name: The name of the Microsoft.ServiceBus topic. If the + entity type is of type 'queue', then this value will be null. + :type topic_name: str + :param subscription_name: The name of the Microsoft.ServiceBus topic's + subscription. If the entity type is of type 'queue', then this value will + be null. + :type subscription_name: str + """ + + _attribute_map = { + 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'queue_name': {'key': 'queueName', 'type': 'str'}, + 'topic_name': {'key': 'topicName', 'type': 'str'}, + 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, + } + + def __init__(self, *, namespace_name: str=None, request_uri: str=None, entity_type: str=None, queue_name: str=None, topic_name: str=None, subscription_name: str=None, **kwargs) -> None: + super(ServiceBusActiveMessagesAvailableWithNoListenersEventData, self).__init__(**kwargs) + self.namespace_name = namespace_name + self.request_uri = request_uri + self.entity_type = entity_type + self.queue_name = queue_name + self.topic_name = topic_name + self.subscription_name = subscription_name diff --git a/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data.py b/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data.py new file mode 100644 index 000000000000..60310de45628 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data.py @@ -0,0 +1,55 @@ +# 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 ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent event. + + :param namespace_name: The namespace name of the Microsoft.ServiceBus + resource. + :type namespace_name: str + :param request_uri: The endpoint of the Microsoft.ServiceBus resource. + :type request_uri: str + :param entity_type: The entity type of the Microsoft.ServiceBus resource. + Could be one of 'queue' or 'subscriber'. + :type entity_type: str + :param queue_name: The name of the Microsoft.ServiceBus queue. If the + entity type is of type 'subscriber', then this value will be null. + :type queue_name: str + :param topic_name: The name of the Microsoft.ServiceBus topic. If the + entity type is of type 'queue', then this value will be null. + :type topic_name: str + :param subscription_name: The name of the Microsoft.ServiceBus topic's + subscription. If the entity type is of type 'queue', then this value will + be null. + :type subscription_name: str + """ + + _attribute_map = { + 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'queue_name': {'key': 'queueName', 'type': 'str'}, + 'topic_name': {'key': 'topicName', 'type': 'str'}, + 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceBusDeadletterMessagesAvailableWithNoListenersEventData, self).__init__(**kwargs) + self.namespace_name = kwargs.get('namespace_name', None) + self.request_uri = kwargs.get('request_uri', None) + self.entity_type = kwargs.get('entity_type', None) + self.queue_name = kwargs.get('queue_name', None) + self.topic_name = kwargs.get('topic_name', None) + self.subscription_name = kwargs.get('subscription_name', None) diff --git a/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data_py3.py new file mode 100644 index 000000000000..3f8afafc482c --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/service_bus_deadletter_messages_available_with_no_listeners_event_data_py3.py @@ -0,0 +1,55 @@ +# 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 ServiceBusDeadletterMessagesAvailableWithNoListenersEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.ServiceBus.DeadletterMessagesAvailableWithNoListenersEvent event. + + :param namespace_name: The namespace name of the Microsoft.ServiceBus + resource. + :type namespace_name: str + :param request_uri: The endpoint of the Microsoft.ServiceBus resource. + :type request_uri: str + :param entity_type: The entity type of the Microsoft.ServiceBus resource. + Could be one of 'queue' or 'subscriber'. + :type entity_type: str + :param queue_name: The name of the Microsoft.ServiceBus queue. If the + entity type is of type 'subscriber', then this value will be null. + :type queue_name: str + :param topic_name: The name of the Microsoft.ServiceBus topic. If the + entity type is of type 'queue', then this value will be null. + :type topic_name: str + :param subscription_name: The name of the Microsoft.ServiceBus topic's + subscription. If the entity type is of type 'queue', then this value will + be null. + :type subscription_name: str + """ + + _attribute_map = { + 'namespace_name': {'key': 'namespaceName', 'type': 'str'}, + 'request_uri': {'key': 'requestUri', 'type': 'str'}, + 'entity_type': {'key': 'entityType', 'type': 'str'}, + 'queue_name': {'key': 'queueName', 'type': 'str'}, + 'topic_name': {'key': 'topicName', 'type': 'str'}, + 'subscription_name': {'key': 'subscriptionName', 'type': 'str'}, + } + + def __init__(self, *, namespace_name: str=None, request_uri: str=None, entity_type: str=None, queue_name: str=None, topic_name: str=None, subscription_name: str=None, **kwargs) -> None: + super(ServiceBusDeadletterMessagesAvailableWithNoListenersEventData, self).__init__(**kwargs) + self.namespace_name = namespace_name + self.request_uri = request_uri + self.entity_type = entity_type + self.queue_name = queue_name + self.topic_name = topic_name + self.subscription_name = subscription_name From 2a24a5c90e7f0951b6b43f614196c6a1d9cda8c2 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 16 May 2018 12:18:23 -0700 Subject: [PATCH 2/3] Generated from a7ae120aeccf96b91aeeb0a9cba5428cd39f5352 (#2571) Added subscription validation response. --- .../azure/eventgrid/models/__init__.py | 9 ++++ ...r_registry_image_deleted_event_data_py3.py | 2 +- ...er_registry_image_pushed_event_data_py3.py | 2 +- .../iot_hub_device_created_event_data_py3.py | 2 +- .../iot_hub_device_deleted_event_data_py3.py | 2 +- .../models/subscription_deleted_event_data.py | 37 ++++++++++++++ .../subscription_deleted_event_data_py3.py | 37 ++++++++++++++ .../subscription_validation_event_data.py | 50 +++++++++++++++++++ .../subscription_validation_event_data_py3.py | 50 +++++++++++++++++++ .../subscription_validation_response.py | 32 ++++++++++++ .../subscription_validation_response_py3.py | 32 ++++++++++++ 11 files changed, 251 insertions(+), 4 deletions(-) create mode 100644 azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data.py create mode 100644 azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data_py3.py create mode 100644 azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data.py create mode 100644 azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data_py3.py create mode 100644 azure-eventgrid/azure/eventgrid/models/subscription_validation_response.py create mode 100644 azure-eventgrid/azure/eventgrid/models/subscription_validation_response_py3.py diff --git a/azure-eventgrid/azure/eventgrid/models/__init__.py b/azure-eventgrid/azure/eventgrid/models/__init__.py index 88e6490d4025..2b2f97b8fbfa 100644 --- a/azure-eventgrid/azure/eventgrid/models/__init__.py +++ b/azure-eventgrid/azure/eventgrid/models/__init__.py @@ -20,6 +20,9 @@ from .resource_delete_failure_data_py3 import ResourceDeleteFailureData from .resource_delete_cancel_data_py3 import ResourceDeleteCancelData 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 .device_twin_metadata_py3 import DeviceTwinMetadata @@ -48,6 +51,9 @@ from .resource_delete_failure_data import ResourceDeleteFailureData from .resource_delete_cancel_data import ResourceDeleteCancelData 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 .device_twin_metadata import DeviceTwinMetadata @@ -77,6 +83,9 @@ 'ResourceDeleteFailureData', 'ResourceDeleteCancelData', 'EventGridEvent', + 'SubscriptionValidationEventData', + 'SubscriptionValidationResponse', + 'SubscriptionDeletedEventData', 'IotHubDeviceCreatedEventData', 'IotHubDeviceDeletedEventData', 'DeviceTwinMetadata', diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py index dc8924583b50..7365ea5c6a98 100644 --- a/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_image_deleted_event_data_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_event_data import ContainerRegistryEventData +from .container_registry_event_data_py3 import ContainerRegistryEventData class ContainerRegistryImageDeletedEventData(ContainerRegistryEventData): diff --git a/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py index 0eb8a68e9462..f12aa21fc809 100644 --- a/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py +++ b/azure-eventgrid/azure/eventgrid/models/container_registry_image_pushed_event_data_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .container_registry_event_data import ContainerRegistryEventData +from .container_registry_event_data_py3 import ContainerRegistryEventData class ContainerRegistryImagePushedEventData(ContainerRegistryEventData): 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 8ddc99f32782..8c739a8e7724 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 @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties +from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties class IotHubDeviceCreatedEventData(DeviceLifeCycleEventProperties): 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 7d4745272f77..070953804e30 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 @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .device_life_cycle_event_properties import DeviceLifeCycleEventProperties +from .device_life_cycle_event_properties_py3 import DeviceLifeCycleEventProperties class IotHubDeviceDeletedEventData(DeviceLifeCycleEventProperties): diff --git a/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data.py b/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data.py new file mode 100644 index 000000000000..2aa366646706 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data.py @@ -0,0 +1,37 @@ +# 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 SubscriptionDeletedEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.EventGrid.SubscriptionDeletedEvent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar event_subscription_id: The Azure resource ID of the deleted event + subscription. + :vartype event_subscription_id: str + """ + + _validation = { + 'event_subscription_id': {'readonly': True}, + } + + _attribute_map = { + 'event_subscription_id': {'key': 'eventSubscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubscriptionDeletedEventData, self).__init__(**kwargs) + self.event_subscription_id = None diff --git a/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data_py3.py new file mode 100644 index 000000000000..133338d9d112 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/subscription_deleted_event_data_py3.py @@ -0,0 +1,37 @@ +# 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 SubscriptionDeletedEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.EventGrid.SubscriptionDeletedEvent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar event_subscription_id: The Azure resource ID of the deleted event + subscription. + :vartype event_subscription_id: str + """ + + _validation = { + 'event_subscription_id': {'readonly': True}, + } + + _attribute_map = { + 'event_subscription_id': {'key': 'eventSubscriptionId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SubscriptionDeletedEventData, self).__init__(**kwargs) + self.event_subscription_id = None diff --git a/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data.py b/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data.py new file mode 100644 index 000000000000..f9d0bfe7c431 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data.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 SubscriptionValidationEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.EventGrid.SubscriptionValidationEvent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar validation_code: The validation code sent by Azure Event Grid to + validate an event subscription. To complete the validation handshake, the + subscriber must either respond with this validation code as part of the + validation response, or perform a GET request on the validationUrl + (available starting version 2018-05-01-preview). + :vartype validation_code: str + :ivar validation_url: The validation URL sent by Azure Event Grid + (available starting version 2018-05-01-preview). To complete the + validation handshake, the subscriber must either respond with the + validationCode as part of the validation response, or perform a GET + request on the validationUrl (available starting version + 2018-05-01-preview). + :vartype validation_url: str + """ + + _validation = { + 'validation_code': {'readonly': True}, + 'validation_url': {'readonly': True}, + } + + _attribute_map = { + 'validation_code': {'key': 'validationCode', 'type': 'str'}, + 'validation_url': {'key': 'validationUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubscriptionValidationEventData, self).__init__(**kwargs) + self.validation_code = None + self.validation_url = None diff --git a/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data_py3.py new file mode 100644 index 000000000000..b4302b98927b --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/subscription_validation_event_data_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 SubscriptionValidationEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.EventGrid.SubscriptionValidationEvent. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar validation_code: The validation code sent by Azure Event Grid to + validate an event subscription. To complete the validation handshake, the + subscriber must either respond with this validation code as part of the + validation response, or perform a GET request on the validationUrl + (available starting version 2018-05-01-preview). + :vartype validation_code: str + :ivar validation_url: The validation URL sent by Azure Event Grid + (available starting version 2018-05-01-preview). To complete the + validation handshake, the subscriber must either respond with the + validationCode as part of the validation response, or perform a GET + request on the validationUrl (available starting version + 2018-05-01-preview). + :vartype validation_url: str + """ + + _validation = { + 'validation_code': {'readonly': True}, + 'validation_url': {'readonly': True}, + } + + _attribute_map = { + 'validation_code': {'key': 'validationCode', 'type': 'str'}, + 'validation_url': {'key': 'validationUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SubscriptionValidationEventData, self).__init__(**kwargs) + self.validation_code = None + self.validation_url = None diff --git a/azure-eventgrid/azure/eventgrid/models/subscription_validation_response.py b/azure-eventgrid/azure/eventgrid/models/subscription_validation_response.py new file mode 100644 index 000000000000..034d55d1faf1 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/subscription_validation_response.py @@ -0,0 +1,32 @@ +# 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 SubscriptionValidationResponse(Model): + """To complete an event subscription validation handshake, a subscriber can + use either the validationCode or the validationUrl received in a + SubscriptionValidationEvent. When the validationCode is used, the + SubscriptionValidationResponse can be used to build the response. + + :param validation_response: The validation response sent by the subscriber + to Azure Event Grid to complete the validation of an event subscription. + :type validation_response: str + """ + + _attribute_map = { + 'validation_response': {'key': 'validationResponse', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubscriptionValidationResponse, self).__init__(**kwargs) + self.validation_response = kwargs.get('validation_response', None) diff --git a/azure-eventgrid/azure/eventgrid/models/subscription_validation_response_py3.py b/azure-eventgrid/azure/eventgrid/models/subscription_validation_response_py3.py new file mode 100644 index 000000000000..dc76e2a5ca6f --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/subscription_validation_response_py3.py @@ -0,0 +1,32 @@ +# 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 SubscriptionValidationResponse(Model): + """To complete an event subscription validation handshake, a subscriber can + use either the validationCode or the validationUrl received in a + SubscriptionValidationEvent. When the validationCode is used, the + SubscriptionValidationResponse can be used to build the response. + + :param validation_response: The validation response sent by the subscriber + to Azure Event Grid to complete the validation of an event subscription. + :type validation_response: str + """ + + _attribute_map = { + 'validation_response': {'key': 'validationResponse', 'type': 'str'}, + } + + def __init__(self, *, validation_response: str=None, **kwargs) -> None: + super(SubscriptionValidationResponse, self).__init__(**kwargs) + self.validation_response = validation_response From b635dc1ec473f39409c1ad790934701957971ce8 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 18 May 2018 13:56:19 -0700 Subject: [PATCH 3/3] Generated from 074682bf5a1904c479dbe62300145863c169ba0a (#2587) Media Services Event Grid schema updates (2) --- .../azure/eventgrid/models/__init__.py | 7 +++ .../models/event_grid_client_enums.py | 23 ++++++++++ .../media_job_state_change_event_data.py | 45 +++++++++++++++++++ .../media_job_state_change_event_data_py3.py | 45 +++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 azure-eventgrid/azure/eventgrid/models/event_grid_client_enums.py create mode 100644 azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data.py create mode 100644 azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data_py3.py diff --git a/azure-eventgrid/azure/eventgrid/models/__init__.py b/azure-eventgrid/azure/eventgrid/models/__init__.py index 2b2f97b8fbfa..57ba4b413989 100644 --- a/azure-eventgrid/azure/eventgrid/models/__init__.py +++ b/azure-eventgrid/azure/eventgrid/models/__init__.py @@ -40,6 +40,7 @@ from .container_registry_event_data_py3 import ContainerRegistryEventData from .service_bus_active_messages_available_with_no_listeners_event_data_py3 import ServiceBusActiveMessagesAvailableWithNoListenersEventData from .service_bus_deadletter_messages_available_with_no_listeners_event_data_py3 import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData + from .media_job_state_change_event_data_py3 import MediaJobStateChangeEventData except (SyntaxError, ImportError): from .storage_blob_created_event_data import StorageBlobCreatedEventData from .storage_blob_deleted_event_data import StorageBlobDeletedEventData @@ -71,6 +72,10 @@ from .container_registry_event_data import ContainerRegistryEventData from .service_bus_active_messages_available_with_no_listeners_event_data import ServiceBusActiveMessagesAvailableWithNoListenersEventData from .service_bus_deadletter_messages_available_with_no_listeners_event_data import ServiceBusDeadletterMessagesAvailableWithNoListenersEventData + from .media_job_state_change_event_data import MediaJobStateChangeEventData +from .event_grid_client_enums import ( + JobState, +) __all__ = [ 'StorageBlobCreatedEventData', @@ -103,4 +108,6 @@ 'ContainerRegistryEventData', 'ServiceBusActiveMessagesAvailableWithNoListenersEventData', 'ServiceBusDeadletterMessagesAvailableWithNoListenersEventData', + 'MediaJobStateChangeEventData', + 'JobState', ] diff --git a/azure-eventgrid/azure/eventgrid/models/event_grid_client_enums.py b/azure-eventgrid/azure/eventgrid/models/event_grid_client_enums.py new file mode 100644 index 000000000000..f76069221076 --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/event_grid_client_enums.py @@ -0,0 +1,23 @@ +# 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 enum import Enum + + +class JobState(str, Enum): + + canceled = "Canceled" #: The job was canceled. This is a final state for the job. + canceling = "Canceling" #: The job is in the process of being canceled. This is a transient state for the job. + error = "Error" #: The job has encountered an error. This is a final state for the job. + finished = "Finished" #: The job is finished. This is a final state for the job. + processing = "Processing" #: The job is processing. This is a transient state for the job. + queued = "Queued" #: The job is in a queued state, waiting for resources to become available. This is a transient state. + scheduled = "Scheduled" #: The job is being scheduled to run on an available resource. This is a transient state, between queued and processing states. diff --git a/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data.py b/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data.py new file mode 100644 index 000000000000..02f704f2ca2b --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/media_job_state_change_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 msrest.serialization import Model + + +class MediaJobStateChangeEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.Media.JobStateChange event. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar previous_state: The previous state of the Job. Possible values + include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', + 'Queued', 'Scheduled' + :vartype previous_state: str or ~azure.eventgrid.models.JobState + :ivar state: The new state of the Job. Possible values include: + 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', + 'Scheduled' + :vartype state: str or ~azure.eventgrid.models.JobState + """ + + _validation = { + 'previous_state': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'previous_state': {'key': 'previousState', 'type': 'JobState'}, + 'state': {'key': 'state', 'type': 'JobState'}, + } + + def __init__(self, **kwargs): + super(MediaJobStateChangeEventData, self).__init__(**kwargs) + self.previous_state = None + self.state = None diff --git a/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data_py3.py b/azure-eventgrid/azure/eventgrid/models/media_job_state_change_event_data_py3.py new file mode 100644 index 000000000000..ce69d00211eb --- /dev/null +++ b/azure-eventgrid/azure/eventgrid/models/media_job_state_change_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 msrest.serialization import Model + + +class MediaJobStateChangeEventData(Model): + """Schema of the Data property of an EventGridEvent for a + Microsoft.Media.JobStateChange event. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar previous_state: The previous state of the Job. Possible values + include: 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', + 'Queued', 'Scheduled' + :vartype previous_state: str or ~azure.eventgrid.models.JobState + :ivar state: The new state of the Job. Possible values include: + 'Canceled', 'Canceling', 'Error', 'Finished', 'Processing', 'Queued', + 'Scheduled' + :vartype state: str or ~azure.eventgrid.models.JobState + """ + + _validation = { + 'previous_state': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'previous_state': {'key': 'previousState', 'type': 'JobState'}, + 'state': {'key': 'state', 'type': 'JobState'}, + } + + def __init__(self, **kwargs) -> None: + super(MediaJobStateChangeEventData, self).__init__(**kwargs) + self.previous_state = None + self.state = None