diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py index 8d03e4f3c85b..b5a272315294 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py @@ -86,7 +86,7 @@ def __init__( super(EventGridManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-01-01' + self.api_version = '2018-05-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py index 722199b81f97..633b89b64252 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py @@ -12,14 +12,23 @@ try: from .event_subscription_destination_py3 import EventSubscriptionDestination from .event_subscription_filter_py3 import EventSubscriptionFilter + from .retry_policy_py3 import RetryPolicy + from .dead_letter_destination_py3 import DeadLetterDestination from .resource_py3 import Resource + from .storage_blob_dead_letter_destination_py3 import StorageBlobDeadLetterDestination from .web_hook_event_subscription_destination_py3 import WebHookEventSubscriptionDestination from .event_hub_event_subscription_destination_py3 import EventHubEventSubscriptionDestination + from .storage_queue_event_subscription_destination_py3 import StorageQueueEventSubscriptionDestination + from .hybrid_connection_event_subscription_destination_py3 import HybridConnectionEventSubscriptionDestination from .event_subscription_py3 import EventSubscription from .event_subscription_update_parameters_py3 import EventSubscriptionUpdateParameters from .event_subscription_full_url_py3 import EventSubscriptionFullUrl from .operation_info_py3 import OperationInfo from .operation_py3 import Operation + from .input_schema_mapping_py3 import InputSchemaMapping + from .json_field_py3 import JsonField + from .json_field_with_default_py3 import JsonFieldWithDefault + from .json_input_schema_mapping_py3 import JsonInputSchemaMapping from .tracked_resource_py3 import TrackedResource from .topic_py3 import Topic from .topic_update_parameters_py3 import TopicUpdateParameters @@ -30,14 +39,23 @@ except (SyntaxError, ImportError): from .event_subscription_destination import EventSubscriptionDestination from .event_subscription_filter import EventSubscriptionFilter + from .retry_policy import RetryPolicy + from .dead_letter_destination import DeadLetterDestination from .resource import Resource + from .storage_blob_dead_letter_destination import StorageBlobDeadLetterDestination from .web_hook_event_subscription_destination import WebHookEventSubscriptionDestination from .event_hub_event_subscription_destination import EventHubEventSubscriptionDestination + from .storage_queue_event_subscription_destination import StorageQueueEventSubscriptionDestination + from .hybrid_connection_event_subscription_destination import HybridConnectionEventSubscriptionDestination from .event_subscription import EventSubscription from .event_subscription_update_parameters import EventSubscriptionUpdateParameters from .event_subscription_full_url import EventSubscriptionFullUrl from .operation_info import OperationInfo from .operation import Operation + from .input_schema_mapping import InputSchemaMapping + from .json_field import JsonField + from .json_field_with_default import JsonFieldWithDefault + from .json_input_schema_mapping import JsonInputSchemaMapping from .tracked_resource import TrackedResource from .topic import Topic from .topic_update_parameters import TopicUpdateParameters @@ -52,7 +70,9 @@ from .topic_type_info_paged import TopicTypeInfoPaged from .event_grid_management_client_enums import ( EventSubscriptionProvisioningState, + EventDeliverySchema, TopicProvisioningState, + InputSchema, ResourceRegionType, TopicTypeProvisioningState, ) @@ -60,14 +80,23 @@ __all__ = [ 'EventSubscriptionDestination', 'EventSubscriptionFilter', + 'RetryPolicy', + 'DeadLetterDestination', 'Resource', + 'StorageBlobDeadLetterDestination', 'WebHookEventSubscriptionDestination', 'EventHubEventSubscriptionDestination', + 'StorageQueueEventSubscriptionDestination', + 'HybridConnectionEventSubscriptionDestination', 'EventSubscription', 'EventSubscriptionUpdateParameters', 'EventSubscriptionFullUrl', 'OperationInfo', 'Operation', + 'InputSchemaMapping', + 'JsonField', + 'JsonFieldWithDefault', + 'JsonInputSchemaMapping', 'TrackedResource', 'Topic', 'TopicUpdateParameters', @@ -81,7 +110,9 @@ 'EventTypePaged', 'TopicTypeInfoPaged', 'EventSubscriptionProvisioningState', + 'EventDeliverySchema', 'TopicProvisioningState', + 'InputSchema', 'ResourceRegionType', 'TopicTypeProvisioningState', ] diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination.py new file mode 100644 index 000000000000..b91be0d5288c --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination.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 DeadLetterDestination(Model): + """Information about the dead letter destination for an event subscription. To + configure a deadletter destination, do not directly instantiate an object + of this class. Instead, instantiate an object of a derived class. + Currently, StorageBlobDeadLetterDestination is the only class that derives + from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StorageBlobDeadLetterDestination + + All required parameters must be populated in order to send to Azure. + + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + } + + _subtype_map = { + 'endpoint_type': {'StorageBlob': 'StorageBlobDeadLetterDestination'} + } + + def __init__(self, **kwargs): + super(DeadLetterDestination, self).__init__(**kwargs) + self.endpoint_type = None diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination_py3.py new file mode 100644 index 000000000000..f38c332f5149 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination_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 DeadLetterDestination(Model): + """Information about the dead letter destination for an event subscription. To + configure a deadletter destination, do not directly instantiate an object + of this class. Instead, instantiate an object of a derived class. + Currently, StorageBlobDeadLetterDestination is the only class that derives + from this class. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: StorageBlobDeadLetterDestination + + All required parameters must be populated in order to send to Azure. + + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + } + + _subtype_map = { + 'endpoint_type': {'StorageBlob': 'StorageBlobDeadLetterDestination'} + } + + def __init__(self, **kwargs) -> None: + super(DeadLetterDestination, self).__init__(**kwargs) + self.endpoint_type = None diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py index 2bc5cc92ef06..3a265b2304c5 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py @@ -20,6 +20,14 @@ class EventSubscriptionProvisioningState(str, Enum): succeeded = "Succeeded" canceled = "Canceled" failed = "Failed" + awaiting_manual_action = "AwaitingManualAction" + + +class EventDeliverySchema(str, Enum): + + event_grid_schema = "EventGridSchema" + input_event_schema = "InputEventSchema" + cloud_event_v01_schema = "CloudEventV01Schema" class TopicProvisioningState(str, Enum): @@ -32,6 +40,13 @@ class TopicProvisioningState(str, Enum): failed = "Failed" +class InputSchema(str, Enum): + + event_grid_schema = "EventGridSchema" + custom_event_schema = "CustomEventSchema" + cloud_event_v01_schema = "CloudEventV01Schema" + + class ResourceRegionType(str, Enum): regional_resource = "RegionalResource" diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py index bb01a052127a..747419ac4275 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py @@ -28,7 +28,7 @@ class EventSubscription(Resource): :vartype topic: str :ivar provisioning_state: Provisioning state of the event subscription. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' + 'Canceled', 'Failed', 'AwaitingManualAction' :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.EventSubscriptionProvisioningState :param destination: Information about the destination where events have to @@ -39,6 +39,19 @@ class EventSubscription(Resource): :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter :param labels: List of user defined labels. :type labels: list[str] + :param event_delivery_schema: The event delivery schema for the event + subscription. Possible values include: 'EventGridSchema', + 'InputEventSchema', 'CloudEventV01Schema'. Default value: + "EventGridSchema" . + :type event_delivery_schema: str or + ~azure.mgmt.eventgrid.models.EventDeliverySchema + :param retry_policy: The retry policy for events. This can be used to + configure maximum number of delivery attempts and time to live for events. + :type retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy + :param dead_letter_destination: The DeadLetter destination of the event + subscription. + :type dead_letter_destination: + ~azure.mgmt.eventgrid.models.DeadLetterDestination """ _validation = { @@ -58,6 +71,9 @@ class EventSubscription(Resource): 'destination': {'key': 'properties.destination', 'type': 'EventSubscriptionDestination'}, 'filter': {'key': 'properties.filter', 'type': 'EventSubscriptionFilter'}, 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'event_delivery_schema': {'key': 'properties.eventDeliverySchema', 'type': 'str'}, + 'retry_policy': {'key': 'properties.retryPolicy', 'type': 'RetryPolicy'}, + 'dead_letter_destination': {'key': 'properties.deadLetterDestination', 'type': 'DeadLetterDestination'}, } def __init__(self, **kwargs): @@ -67,3 +83,6 @@ def __init__(self, **kwargs): self.destination = kwargs.get('destination', None) self.filter = kwargs.get('filter', None) self.labels = kwargs.get('labels', None) + self.event_delivery_schema = kwargs.get('event_delivery_schema', "EventGridSchema") + self.retry_policy = kwargs.get('retry_policy', None) + self.dead_letter_destination = kwargs.get('dead_letter_destination', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination.py index 53cd7e9d2da4..42667ddc6424 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination.py @@ -17,7 +17,9 @@ class EventSubscriptionDestination(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: WebHookEventSubscriptionDestination, - EventHubEventSubscriptionDestination + EventHubEventSubscriptionDestination, + StorageQueueEventSubscriptionDestination, + HybridConnectionEventSubscriptionDestination All required parameters must be populated in order to send to Azure. @@ -34,7 +36,7 @@ class EventSubscriptionDestination(Model): } _subtype_map = { - 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination'} + 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination', 'StorageQueue': 'StorageQueueEventSubscriptionDestination', 'HybridConnection': 'HybridConnectionEventSubscriptionDestination'} } def __init__(self, **kwargs): diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination_py3.py index 3364d18b8cee..3bdf32247603 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination_py3.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination_py3.py @@ -17,7 +17,9 @@ class EventSubscriptionDestination(Model): You probably want to use the sub-classes and not this class directly. Known sub-classes are: WebHookEventSubscriptionDestination, - EventHubEventSubscriptionDestination + EventHubEventSubscriptionDestination, + StorageQueueEventSubscriptionDestination, + HybridConnectionEventSubscriptionDestination All required parameters must be populated in order to send to Azure. @@ -34,7 +36,7 @@ class EventSubscriptionDestination(Model): } _subtype_map = { - 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination'} + 'endpoint_type': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination', 'StorageQueue': 'StorageQueueEventSubscriptionDestination', 'HybridConnection': 'HybridConnectionEventSubscriptionDestination'} } def __init__(self, **kwargs) -> None: diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py index f703cebfa17a..2343a939d830 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py @@ -28,7 +28,7 @@ class EventSubscription(Resource): :vartype topic: str :ivar provisioning_state: Provisioning state of the event subscription. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', - 'Canceled', 'Failed' + 'Canceled', 'Failed', 'AwaitingManualAction' :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.EventSubscriptionProvisioningState :param destination: Information about the destination where events have to @@ -39,6 +39,19 @@ class EventSubscription(Resource): :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter :param labels: List of user defined labels. :type labels: list[str] + :param event_delivery_schema: The event delivery schema for the event + subscription. Possible values include: 'EventGridSchema', + 'InputEventSchema', 'CloudEventV01Schema'. Default value: + "EventGridSchema" . + :type event_delivery_schema: str or + ~azure.mgmt.eventgrid.models.EventDeliverySchema + :param retry_policy: The retry policy for events. This can be used to + configure maximum number of delivery attempts and time to live for events. + :type retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy + :param dead_letter_destination: The DeadLetter destination of the event + subscription. + :type dead_letter_destination: + ~azure.mgmt.eventgrid.models.DeadLetterDestination """ _validation = { @@ -58,12 +71,18 @@ class EventSubscription(Resource): 'destination': {'key': 'properties.destination', 'type': 'EventSubscriptionDestination'}, 'filter': {'key': 'properties.filter', 'type': 'EventSubscriptionFilter'}, 'labels': {'key': 'properties.labels', 'type': '[str]'}, + 'event_delivery_schema': {'key': 'properties.eventDeliverySchema', 'type': 'str'}, + 'retry_policy': {'key': 'properties.retryPolicy', 'type': 'RetryPolicy'}, + 'dead_letter_destination': {'key': 'properties.deadLetterDestination', 'type': 'DeadLetterDestination'}, } - def __init__(self, *, destination=None, filter=None, labels=None, **kwargs) -> None: + def __init__(self, *, destination=None, filter=None, labels=None, event_delivery_schema="EventGridSchema", retry_policy=None, dead_letter_destination=None, **kwargs) -> None: super(EventSubscription, self).__init__(**kwargs) self.topic = None self.provisioning_state = None self.destination = destination self.filter = filter self.labels = labels + self.event_delivery_schema = event_delivery_schema + self.retry_policy = retry_policy + self.dead_letter_destination = dead_letter_destination diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py index d3fd58cdebb6..c077f27fc04e 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py @@ -23,12 +23,28 @@ class EventSubscriptionUpdateParameters(Model): :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter :param labels: List of user defined labels. :type labels: list[str] + :param event_delivery_schema: The event delivery schema for the event + subscription. Possible values include: 'EventGridSchema', + 'InputEventSchema', 'CloudEventV01Schema'. Default value: + "EventGridSchema" . + :type event_delivery_schema: str or + ~azure.mgmt.eventgrid.models.EventDeliverySchema + :param retry_policy: The retry policy for events. This can be used to + configure maximum number of delivery attempts and time to live for events. + :type retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy + :param dead_letter_destination: The DeadLetter destination of the event + subscription. + :type dead_letter_destination: + ~azure.mgmt.eventgrid.models.DeadLetterDestination """ _attribute_map = { 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, 'filter': {'key': 'filter', 'type': 'EventSubscriptionFilter'}, 'labels': {'key': 'labels', 'type': '[str]'}, + 'event_delivery_schema': {'key': 'eventDeliverySchema', 'type': 'str'}, + 'retry_policy': {'key': 'retryPolicy', 'type': 'RetryPolicy'}, + 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, } def __init__(self, **kwargs): @@ -36,3 +52,6 @@ def __init__(self, **kwargs): self.destination = kwargs.get('destination', None) self.filter = kwargs.get('filter', None) self.labels = kwargs.get('labels', None) + self.event_delivery_schema = kwargs.get('event_delivery_schema', "EventGridSchema") + self.retry_policy = kwargs.get('retry_policy', None) + self.dead_letter_destination = kwargs.get('dead_letter_destination', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py index e6cf8cdbef82..18bb5ec06d64 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py @@ -23,16 +23,35 @@ class EventSubscriptionUpdateParameters(Model): :type filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter :param labels: List of user defined labels. :type labels: list[str] + :param event_delivery_schema: The event delivery schema for the event + subscription. Possible values include: 'EventGridSchema', + 'InputEventSchema', 'CloudEventV01Schema'. Default value: + "EventGridSchema" . + :type event_delivery_schema: str or + ~azure.mgmt.eventgrid.models.EventDeliverySchema + :param retry_policy: The retry policy for events. This can be used to + configure maximum number of delivery attempts and time to live for events. + :type retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy + :param dead_letter_destination: The DeadLetter destination of the event + subscription. + :type dead_letter_destination: + ~azure.mgmt.eventgrid.models.DeadLetterDestination """ _attribute_map = { 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, 'filter': {'key': 'filter', 'type': 'EventSubscriptionFilter'}, 'labels': {'key': 'labels', 'type': '[str]'}, + 'event_delivery_schema': {'key': 'eventDeliverySchema', 'type': 'str'}, + 'retry_policy': {'key': 'retryPolicy', 'type': 'RetryPolicy'}, + 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, } - def __init__(self, *, destination=None, filter=None, labels=None, **kwargs) -> None: + def __init__(self, *, destination=None, filter=None, labels=None, event_delivery_schema="EventGridSchema", retry_policy=None, dead_letter_destination=None, **kwargs) -> None: super(EventSubscriptionUpdateParameters, self).__init__(**kwargs) self.destination = destination self.filter = filter self.labels = labels + self.event_delivery_schema = event_delivery_schema + self.retry_policy = retry_policy + self.dead_letter_destination = dead_letter_destination diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py new file mode 100644 index 000000000000..a28228db5fa0 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py @@ -0,0 +1,40 @@ +# 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 .event_subscription_destination import EventSubscriptionDestination + + +class HybridConnectionEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the HybridConnection destination for an event + subscription. + + All required parameters must be populated in order to send to Azure. + + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of an hybrid connection that is + the destination of an event subscription. + :type resource_id: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HybridConnectionEventSubscriptionDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.endpoint_type = 'HybridConnection' diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination_py3.py new file mode 100644 index 000000000000..54d0fe6e5202 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination_py3.py @@ -0,0 +1,40 @@ +# 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 .event_subscription_destination import EventSubscriptionDestination + + +class HybridConnectionEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the HybridConnection destination for an event + subscription. + + All required parameters must be populated in order to send to Azure. + + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of an hybrid connection that is + the destination of an event subscription. + :type resource_id: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, **kwargs) -> None: + super(HybridConnectionEventSubscriptionDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.endpoint_type = 'HybridConnection' diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/input_schema_mapping.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/input_schema_mapping.py new file mode 100644 index 000000000000..f99596238470 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/input_schema_mapping.py @@ -0,0 +1,44 @@ +# 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 InputSchemaMapping(Model): + """By default, Event Grid expects events to be in the Event Grid event schema. + Specifying an input schema mapping enables publishing to Event Grid using a + custom input schema. Currently, the only supported type of + InputSchemaMapping is 'JsonInputSchemaMapping'. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: JsonInputSchemaMapping + + All required parameters must be populated in order to send to Azure. + + :param input_schema_mapping_type: Required. Constant filled by server. + :type input_schema_mapping_type: str + """ + + _validation = { + 'input_schema_mapping_type': {'required': True}, + } + + _attribute_map = { + 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, + } + + _subtype_map = { + 'input_schema_mapping_type': {'Json': 'JsonInputSchemaMapping'} + } + + def __init__(self, **kwargs): + super(InputSchemaMapping, self).__init__(**kwargs) + self.input_schema_mapping_type = None diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/input_schema_mapping_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/input_schema_mapping_py3.py new file mode 100644 index 000000000000..b3a12a359f62 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/input_schema_mapping_py3.py @@ -0,0 +1,44 @@ +# 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 InputSchemaMapping(Model): + """By default, Event Grid expects events to be in the Event Grid event schema. + Specifying an input schema mapping enables publishing to Event Grid using a + custom input schema. Currently, the only supported type of + InputSchemaMapping is 'JsonInputSchemaMapping'. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: JsonInputSchemaMapping + + All required parameters must be populated in order to send to Azure. + + :param input_schema_mapping_type: Required. Constant filled by server. + :type input_schema_mapping_type: str + """ + + _validation = { + 'input_schema_mapping_type': {'required': True}, + } + + _attribute_map = { + 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, + } + + _subtype_map = { + 'input_schema_mapping_type': {'Json': 'JsonInputSchemaMapping'} + } + + def __init__(self, **kwargs) -> None: + super(InputSchemaMapping, self).__init__(**kwargs) + self.input_schema_mapping_type = None diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field.py new file mode 100644 index 000000000000..31cbc55eb4f1 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field.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 JsonField(Model): + """This is used to express the source of an input schema mapping for a single + target field in the Event Grid Event schema. This is currently used in the + mappings for the 'id','topic' and 'eventtime' properties. This represents a + field in the input event schema. + + :param source_field: Name of a field in the input event schema that's to + be used as the source of a mapping. + :type source_field: str + """ + + _attribute_map = { + 'source_field': {'key': 'sourceField', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JsonField, self).__init__(**kwargs) + self.source_field = kwargs.get('source_field', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_py3.py new file mode 100644 index 000000000000..c13826fc2891 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_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 JsonField(Model): + """This is used to express the source of an input schema mapping for a single + target field in the Event Grid Event schema. This is currently used in the + mappings for the 'id','topic' and 'eventtime' properties. This represents a + field in the input event schema. + + :param source_field: Name of a field in the input event schema that's to + be used as the source of a mapping. + :type source_field: str + """ + + _attribute_map = { + 'source_field': {'key': 'sourceField', 'type': 'str'}, + } + + def __init__(self, *, source_field: str=None, **kwargs) -> None: + super(JsonField, self).__init__(**kwargs) + self.source_field = source_field diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_with_default.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_with_default.py new file mode 100644 index 000000000000..802c804df12e --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_with_default.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 JsonFieldWithDefault(Model): + """This is used to express the source of an input schema mapping for a single + target field in the Event Grid Event schema. This is currently used in the + mappings for the 'subject','eventtype' and 'dataversion' properties. This + represents a field in the input event schema along with a default value to + be used, and at least one of these two properties should be provided. + + :param source_field: Name of a field in the input event schema that's to + be used as the source of a mapping. + :type source_field: str + :param default_value: The default value to be used for mapping when a + SourceField is not provided or if there's no property with the specified + name in the published JSON event payload. + :type default_value: str + """ + + _attribute_map = { + 'source_field': {'key': 'sourceField', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JsonFieldWithDefault, self).__init__(**kwargs) + self.source_field = kwargs.get('source_field', None) + self.default_value = kwargs.get('default_value', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_with_default_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_with_default_py3.py new file mode 100644 index 000000000000..2de769b63a99 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_field_with_default_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 JsonFieldWithDefault(Model): + """This is used to express the source of an input schema mapping for a single + target field in the Event Grid Event schema. This is currently used in the + mappings for the 'subject','eventtype' and 'dataversion' properties. This + represents a field in the input event schema along with a default value to + be used, and at least one of these two properties should be provided. + + :param source_field: Name of a field in the input event schema that's to + be used as the source of a mapping. + :type source_field: str + :param default_value: The default value to be used for mapping when a + SourceField is not provided or if there's no property with the specified + name in the published JSON event payload. + :type default_value: str + """ + + _attribute_map = { + 'source_field': {'key': 'sourceField', 'type': 'str'}, + 'default_value': {'key': 'defaultValue', 'type': 'str'}, + } + + def __init__(self, *, source_field: str=None, default_value: str=None, **kwargs) -> None: + super(JsonFieldWithDefault, self).__init__(**kwargs) + self.source_field = source_field + self.default_value = default_value diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_input_schema_mapping.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_input_schema_mapping.py new file mode 100644 index 000000000000..a7635fe6717e --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_input_schema_mapping.py @@ -0,0 +1,66 @@ +# 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 .input_schema_mapping import InputSchemaMapping + + +class JsonInputSchemaMapping(InputSchemaMapping): + """This enables publishing to Event Grid using a custom input schema. This can + be used to map properties from a custom input JSON schema to the Event Grid + event schema. + + All required parameters must be populated in order to send to Azure. + + :param input_schema_mapping_type: Required. Constant filled by server. + :type input_schema_mapping_type: str + :param id: The mapping information for the Id property of the Event Grid + Event. + :type id: ~azure.mgmt.eventgrid.models.JsonField + :param topic: The mapping information for the Topic property of the Event + Grid Event. + :type topic: ~azure.mgmt.eventgrid.models.JsonField + :param event_time: The mapping information for the EventTime property of + the Event Grid Event. + :type event_time: ~azure.mgmt.eventgrid.models.JsonField + :param event_type: The mapping information for the EventType property of + the Event Grid Event. + :type event_type: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault + :param subject: The mapping information for the Subject property of the + Event Grid Event. + :type subject: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault + :param data_version: The mapping information for the DataVersion property + of the Event Grid Event. + :type data_version: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault + """ + + _validation = { + 'input_schema_mapping_type': {'required': True}, + } + + _attribute_map = { + 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, + 'id': {'key': 'properties.id', 'type': 'JsonField'}, + 'topic': {'key': 'properties.topic', 'type': 'JsonField'}, + 'event_time': {'key': 'properties.eventTime', 'type': 'JsonField'}, + 'event_type': {'key': 'properties.eventType', 'type': 'JsonFieldWithDefault'}, + 'subject': {'key': 'properties.subject', 'type': 'JsonFieldWithDefault'}, + 'data_version': {'key': 'properties.dataVersion', 'type': 'JsonFieldWithDefault'}, + } + + def __init__(self, **kwargs): + super(JsonInputSchemaMapping, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.topic = kwargs.get('topic', None) + self.event_time = kwargs.get('event_time', None) + self.event_type = kwargs.get('event_type', None) + self.subject = kwargs.get('subject', None) + self.data_version = kwargs.get('data_version', None) + self.input_schema_mapping_type = 'Json' diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_input_schema_mapping_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_input_schema_mapping_py3.py new file mode 100644 index 000000000000..64c492a5c4f2 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/json_input_schema_mapping_py3.py @@ -0,0 +1,66 @@ +# 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 .input_schema_mapping import InputSchemaMapping + + +class JsonInputSchemaMapping(InputSchemaMapping): + """This enables publishing to Event Grid using a custom input schema. This can + be used to map properties from a custom input JSON schema to the Event Grid + event schema. + + All required parameters must be populated in order to send to Azure. + + :param input_schema_mapping_type: Required. Constant filled by server. + :type input_schema_mapping_type: str + :param id: The mapping information for the Id property of the Event Grid + Event. + :type id: ~azure.mgmt.eventgrid.models.JsonField + :param topic: The mapping information for the Topic property of the Event + Grid Event. + :type topic: ~azure.mgmt.eventgrid.models.JsonField + :param event_time: The mapping information for the EventTime property of + the Event Grid Event. + :type event_time: ~azure.mgmt.eventgrid.models.JsonField + :param event_type: The mapping information for the EventType property of + the Event Grid Event. + :type event_type: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault + :param subject: The mapping information for the Subject property of the + Event Grid Event. + :type subject: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault + :param data_version: The mapping information for the DataVersion property + of the Event Grid Event. + :type data_version: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault + """ + + _validation = { + 'input_schema_mapping_type': {'required': True}, + } + + _attribute_map = { + 'input_schema_mapping_type': {'key': 'inputSchemaMappingType', 'type': 'str'}, + 'id': {'key': 'properties.id', 'type': 'JsonField'}, + 'topic': {'key': 'properties.topic', 'type': 'JsonField'}, + 'event_time': {'key': 'properties.eventTime', 'type': 'JsonField'}, + 'event_type': {'key': 'properties.eventType', 'type': 'JsonFieldWithDefault'}, + 'subject': {'key': 'properties.subject', 'type': 'JsonFieldWithDefault'}, + 'data_version': {'key': 'properties.dataVersion', 'type': 'JsonFieldWithDefault'}, + } + + def __init__(self, *, id=None, topic=None, event_time=None, event_type=None, subject=None, data_version=None, **kwargs) -> None: + super(JsonInputSchemaMapping, self).__init__(**kwargs) + self.id = id + self.topic = topic + self.event_time = event_time + self.event_type = event_type + self.subject = subject + self.data_version = data_version + self.input_schema_mapping_type = 'Json' diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy.py new file mode 100644 index 000000000000..7b0b7c04141c --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy.py @@ -0,0 +1,34 @@ +# 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 RetryPolicy(Model): + """Information about the retry policy for an event subscription. + + :param max_delivery_attempts: Maximum number of delivery retry attempts + for events. + :type max_delivery_attempts: int + :param event_time_to_live_in_minutes: Time To Live (in minutes) for + events. + :type event_time_to_live_in_minutes: int + """ + + _attribute_map = { + 'max_delivery_attempts': {'key': 'maxDeliveryAttempts', 'type': 'int'}, + 'event_time_to_live_in_minutes': {'key': 'eventTimeToLiveInMinutes', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(RetryPolicy, self).__init__(**kwargs) + self.max_delivery_attempts = kwargs.get('max_delivery_attempts', None) + self.event_time_to_live_in_minutes = kwargs.get('event_time_to_live_in_minutes', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy_py3.py new file mode 100644 index 000000000000..12a366226399 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy_py3.py @@ -0,0 +1,34 @@ +# 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 RetryPolicy(Model): + """Information about the retry policy for an event subscription. + + :param max_delivery_attempts: Maximum number of delivery retry attempts + for events. + :type max_delivery_attempts: int + :param event_time_to_live_in_minutes: Time To Live (in minutes) for + events. + :type event_time_to_live_in_minutes: int + """ + + _attribute_map = { + 'max_delivery_attempts': {'key': 'maxDeliveryAttempts', 'type': 'int'}, + 'event_time_to_live_in_minutes': {'key': 'eventTimeToLiveInMinutes', 'type': 'int'}, + } + + def __init__(self, *, max_delivery_attempts: int=None, event_time_to_live_in_minutes: int=None, **kwargs) -> None: + super(RetryPolicy, self).__init__(**kwargs) + self.max_delivery_attempts = max_delivery_attempts + self.event_time_to_live_in_minutes = event_time_to_live_in_minutes diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py new file mode 100644 index 000000000000..aadbe4e08efa --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py @@ -0,0 +1,44 @@ +# 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 .dead_letter_destination import DeadLetterDestination + + +class StorageBlobDeadLetterDestination(DeadLetterDestination): + """Information about the storage blob based dead letter destination. + + All required parameters must be populated in order to send to Azure. + + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of the storage account that is + the destination of the deadletter events + :type resource_id: str + :param blob_container_name: The name of the Storage blob container that is + the destination of the deadletter events + :type blob_container_name: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'blob_container_name': {'key': 'properties.blobContainerName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageBlobDeadLetterDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.blob_container_name = kwargs.get('blob_container_name', None) + self.endpoint_type = 'StorageBlob' diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination_py3.py new file mode 100644 index 000000000000..44c3330323ce --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination_py3.py @@ -0,0 +1,44 @@ +# 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 .dead_letter_destination import DeadLetterDestination + + +class StorageBlobDeadLetterDestination(DeadLetterDestination): + """Information about the storage blob based dead letter destination. + + All required parameters must be populated in order to send to Azure. + + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of the storage account that is + the destination of the deadletter events + :type resource_id: str + :param blob_container_name: The name of the Storage blob container that is + the destination of the deadletter events + :type blob_container_name: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'blob_container_name': {'key': 'properties.blobContainerName', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, blob_container_name: str=None, **kwargs) -> None: + super(StorageBlobDeadLetterDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.blob_container_name = blob_container_name + self.endpoint_type = 'StorageBlob' diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py new file mode 100644 index 000000000000..620fea9145e9 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py @@ -0,0 +1,44 @@ +# 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 .event_subscription_destination import EventSubscriptionDestination + + +class StorageQueueEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the storage queue destination for an event subscription. + + All required parameters must be populated in order to send to Azure. + + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of the storage account that + contains the queue that is the destination of an event subscription. + :type resource_id: str + :param queue_name: The name of the Storage queue under a storage account + that is the destination of an event subscription. + :type queue_name: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'queue_name': {'key': 'properties.queueName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageQueueEventSubscriptionDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.queue_name = kwargs.get('queue_name', None) + self.endpoint_type = 'StorageQueue' diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination_py3.py new file mode 100644 index 000000000000..3b331c76ac26 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination_py3.py @@ -0,0 +1,44 @@ +# 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 .event_subscription_destination import EventSubscriptionDestination + + +class StorageQueueEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the storage queue destination for an event subscription. + + All required parameters must be populated in order to send to Azure. + + :param endpoint_type: Required. Constant filled by server. + :type endpoint_type: str + :param resource_id: The Azure Resource ID of the storage account that + contains the queue that is the destination of an event subscription. + :type resource_id: str + :param queue_name: The name of the Storage queue under a storage account + that is the destination of an event subscription. + :type queue_name: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'queue_name': {'key': 'properties.queueName', 'type': 'str'}, + } + + def __init__(self, *, resource_id: str=None, queue_name: str=None, **kwargs) -> None: + super(StorageQueueEventSubscriptionDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.queue_name = queue_name + self.endpoint_type = 'StorageQueue' diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic.py index 46c6de571fa7..50d28d5206e5 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic.py @@ -37,6 +37,17 @@ class Topic(TrackedResource): ~azure.mgmt.eventgrid.models.TopicProvisioningState :ivar endpoint: Endpoint for the topic. :vartype endpoint: str + :param input_schema: This determines the format that Event Grid should + expect for incoming events published to the topic. Possible values + include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + Default value: "EventGridSchema" . + :type input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema + :param input_schema_mapping: This enables publishing using custom event + schemas. An InputSchemaMapping can be specified to map various properties + of a source schema to various required properties of the EventGridEvent + schema. + :type input_schema_mapping: + ~azure.mgmt.eventgrid.models.InputSchemaMapping """ _validation = { @@ -56,9 +67,13 @@ class Topic(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, + 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, } def __init__(self, **kwargs): super(Topic, self).__init__(**kwargs) self.provisioning_state = None self.endpoint = None + self.input_schema = kwargs.get('input_schema', "EventGridSchema") + self.input_schema_mapping = kwargs.get('input_schema_mapping', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_py3.py index 3d60ed890953..59235fefaed1 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_py3.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_py3.py @@ -37,6 +37,17 @@ class Topic(TrackedResource): ~azure.mgmt.eventgrid.models.TopicProvisioningState :ivar endpoint: Endpoint for the topic. :vartype endpoint: str + :param input_schema: This determines the format that Event Grid should + expect for incoming events published to the topic. Possible values + include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema'. + Default value: "EventGridSchema" . + :type input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema + :param input_schema_mapping: This enables publishing using custom event + schemas. An InputSchemaMapping can be specified to map various properties + of a source schema to various required properties of the EventGridEvent + schema. + :type input_schema_mapping: + ~azure.mgmt.eventgrid.models.InputSchemaMapping """ _validation = { @@ -56,9 +67,13 @@ class Topic(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, + 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, input_schema="EventGridSchema", input_schema_mapping=None, **kwargs) -> None: super(Topic, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.endpoint = None + self.input_schema = input_schema + self.input_schema_mapping = input_schema_mapping diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request.py index 01257fd6929d..3335abcd735a 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request.py @@ -13,7 +13,7 @@ class TopicRegenerateKeyRequest(Model): - """Topic regenerate share access key key request. + """Topic regenerate share access key request. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request_py3.py index 11423c5bd224..348236358bf9 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request_py3.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request_py3.py @@ -13,7 +13,7 @@ class TopicRegenerateKeyRequest(Model): - """Topic regenerate share access key key request. + """Topic regenerate share access key request. All required parameters must be populated in order to send to Azure. diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py index 50c21d7219e6..4c0f4207c460 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py @@ -25,7 +25,7 @@ class EventSubscriptionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-01" + self.api_version = "2018-05-01-preview" self.config = config @@ -384,7 +384,7 @@ def update( for an EventGrid topic. :type scope: str :param event_subscription_name: Name of the event subscription to be - created + updated :type event_subscription_name: str :param event_subscription_update_parameters: Updated event subscription information diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py index 95a6262e62ba..364a1340c93d 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-01" + self.api_version = "2018-05-01-preview" self.config = config diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py index db9c52f7e9c7..da5486135b71 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py @@ -23,7 +23,7 @@ class TopicTypesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-01" + self.api_version = "2018-05-01-preview" self.config = config diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py index 610cc07164b8..c0edd40647bb 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py @@ -25,7 +25,7 @@ class TopicsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-01-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-01-01" + self.api_version = "2018-05-01-preview" self.config = config @@ -106,9 +106,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, topic_name, location, tags=None, custom_headers=None, raw=False, **operation_config): - topic_info = models.Topic(location=location, tags=tags) - + self, resource_group_name, topic_name, topic_info, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -157,7 +155,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, topic_name, location, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, topic_name, topic_info, custom_headers=None, raw=False, polling=True, **operation_config): """Create a topic. Asynchronously creates a new topic with the specified parameters. @@ -167,10 +165,8 @@ def create_or_update( :type resource_group_name: str :param topic_name: Name of the topic :type topic_name: str - :param location: Location of the resource - :type location: str - :param tags: Tags of the resource - :type tags: dict[str, str] + :param topic_info: Topic information + :type topic_info: ~azure.mgmt.eventgrid.models.Topic :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -187,8 +183,7 @@ def create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, topic_name=topic_name, - location=location, - tags=tags, + topic_info=topic_info, custom_headers=custom_headers, raw=True, **operation_config