Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
31 changes: 31 additions & 0 deletions azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -52,22 +70,33 @@
from .topic_type_info_paged import TopicTypeInfoPaged
from .event_grid_management_client_enums import (
EventSubscriptionProvisioningState,
EventDeliverySchema,
TopicProvisioningState,
InputSchema,
ResourceRegionType,
TopicTypeProvisioningState,
)

__all__ = [
'EventSubscriptionDestination',
'EventSubscriptionFilter',
'RetryPolicy',
'DeadLetterDestination',
'Resource',
'StorageBlobDeadLetterDestination',
'WebHookEventSubscriptionDestination',
'EventHubEventSubscriptionDestination',
'StorageQueueEventSubscriptionDestination',
'HybridConnectionEventSubscriptionDestination',
'EventSubscription',
'EventSubscriptionUpdateParameters',
'EventSubscriptionFullUrl',
'OperationInfo',
'Operation',
'InputSchemaMapping',
'JsonField',
'JsonFieldWithDefault',
'JsonInputSchemaMapping',
'TrackedResource',
'Topic',
'TopicUpdateParameters',
Expand All @@ -81,7 +110,9 @@
'EventTypePaged',
'TopicTypeInfoPaged',
'EventSubscriptionProvisioningState',
'EventDeliverySchema',
'TopicProvisioningState',
'InputSchema',
'ResourceRegionType',
'TopicTypeProvisioningState',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from 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
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {
Expand All @@ -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):
Expand All @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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, **kwargs):
super(EventSubscriptionUpdateParameters, self).__init__(**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)
Loading