-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Expand file tree
/
Copy pathevent_subscription.py
More file actions
88 lines (80 loc) · 3.96 KB
/
event_subscription.py
File metadata and controls
88 lines (80 loc) · 3.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# 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 .resource import Resource
class EventSubscription(Resource):
"""Event Subscription.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar id: Fully qualified identifier of the resource
:vartype id: str
:ivar name: Name of the resource
:vartype name: str
:ivar type: Type of the resource
:vartype type: str
:ivar topic: Name of the topic of the event subscription.
:vartype topic: str
:ivar provisioning_state: Provisioning state of the event subscription.
Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded',
'Canceled', 'Failed', 'AwaitingManualAction'
:vartype provisioning_state: str or
~azure.mgmt.eventgrid.models.EventSubscriptionProvisioningState
:param destination: Information about the destination where events have to
be delivered for the event subscription.
:type destination:
~azure.mgmt.eventgrid.models.EventSubscriptionDestination
:param filter: Information about the filter for the event subscription.
: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:
"InputEventSchema" .
: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 = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'topic': {'readonly': True},
'provisioning_state': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'topic': {'key': 'properties.topic', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'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):
super(EventSubscription, self).__init__(**kwargs)
self.topic = None
self.provisioning_state = None
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', "InputEventSchema")
self.retry_policy = kwargs.get('retry_policy', None)
self.dead_letter_destination = kwargs.get('dead_letter_destination', None)