diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/__init__.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/__init__.py new file mode 100644 index 000000000000..4cb1d289ddea --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/__init__.py @@ -0,0 +1,18 @@ +# 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_grid_management_client import EventGridManagementClient +from .version import VERSION + +__all__ = ['EventGridManagementClient'] + +__version__ = VERSION + diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py new file mode 100644 index 000000000000..2f32c2f09f38 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py @@ -0,0 +1,110 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.domains_operations import DomainsOperations +from .operations.domain_topics_operations import DomainTopicsOperations +from .operations.event_subscriptions_operations import EventSubscriptionsOperations +from .operations.operations import Operations +from .operations.topics_operations import TopicsOperations +from .operations.topic_types_operations import TopicTypesOperations +from . import models + + +class EventGridManagementClientConfiguration(AzureConfiguration): + """Configuration for EventGridManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials that uniquely identify a + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(EventGridManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-eventgrid/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class EventGridManagementClient(SDKClient): + """Azure EventGrid Management Client + + :ivar config: Configuration for client. + :vartype config: EventGridManagementClientConfiguration + + :ivar domains: Domains operations + :vartype domains: azure.mgmt.eventgrid.operations.DomainsOperations + :ivar domain_topics: DomainTopics operations + :vartype domain_topics: azure.mgmt.eventgrid.operations.DomainTopicsOperations + :ivar event_subscriptions: EventSubscriptions operations + :vartype event_subscriptions: azure.mgmt.eventgrid.operations.EventSubscriptionsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.eventgrid.operations.Operations + :ivar topics: Topics operations + :vartype topics: azure.mgmt.eventgrid.operations.TopicsOperations + :ivar topic_types: TopicTypes operations + :vartype topic_types: azure.mgmt.eventgrid.operations.TopicTypesOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials that uniquely identify a + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = EventGridManagementClientConfiguration(credentials, subscription_id, base_url) + 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 = '2019-06-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.domains = DomainsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.domain_topics = DomainTopicsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.event_subscriptions = EventSubscriptionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.topics = TopicsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.topic_types = TopicTypesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py new file mode 100644 index 000000000000..d0e9d4733032 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py @@ -0,0 +1,167 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .resource_py3 import Resource + from .tracked_resource_py3 import TrackedResource + from .domain_py3 import Domain + from .domain_update_parameters_py3 import DomainUpdateParameters + from .domain_shared_access_keys_py3 import DomainSharedAccessKeys + from .domain_regenerate_key_request_py3 import DomainRegenerateKeyRequest + from .domain_topic_py3 import DomainTopic + from .event_subscription_destination_py3 import EventSubscriptionDestination + from .advanced_filter_py3 import AdvancedFilter + from .event_subscription_filter_py3 import EventSubscriptionFilter + from .retry_policy_py3 import RetryPolicy + from .dead_letter_destination_py3 import DeadLetterDestination + from .number_in_advanced_filter_py3 import NumberInAdvancedFilter + from .storage_blob_dead_letter_destination_py3 import StorageBlobDeadLetterDestination + from .number_not_in_advanced_filter_py3 import NumberNotInAdvancedFilter + from .number_less_than_advanced_filter_py3 import NumberLessThanAdvancedFilter + from .number_greater_than_advanced_filter_py3 import NumberGreaterThanAdvancedFilter + from .number_less_than_or_equals_advanced_filter_py3 import NumberLessThanOrEqualsAdvancedFilter + from .number_greater_than_or_equals_advanced_filter_py3 import NumberGreaterThanOrEqualsAdvancedFilter + from .bool_equals_advanced_filter_py3 import BoolEqualsAdvancedFilter + from .string_in_advanced_filter_py3 import StringInAdvancedFilter + from .string_not_in_advanced_filter_py3 import StringNotInAdvancedFilter + from .string_begins_with_advanced_filter_py3 import StringBeginsWithAdvancedFilter + from .string_ends_with_advanced_filter_py3 import StringEndsWithAdvancedFilter + from .string_contains_advanced_filter_py3 import StringContainsAdvancedFilter + 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 .service_bus_queue_event_subscription_destination_py3 import ServiceBusQueueEventSubscriptionDestination + 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 .topic_py3 import Topic + from .topic_update_parameters_py3 import TopicUpdateParameters + from .topic_shared_access_keys_py3 import TopicSharedAccessKeys + from .topic_regenerate_key_request_py3 import TopicRegenerateKeyRequest + from .event_type_py3 import EventType + from .topic_type_info_py3 import TopicTypeInfo +except (SyntaxError, ImportError): + from .resource import Resource + from .tracked_resource import TrackedResource + from .domain import Domain + from .domain_update_parameters import DomainUpdateParameters + from .domain_shared_access_keys import DomainSharedAccessKeys + from .domain_regenerate_key_request import DomainRegenerateKeyRequest + from .domain_topic import DomainTopic + from .event_subscription_destination import EventSubscriptionDestination + from .advanced_filter import AdvancedFilter + from .event_subscription_filter import EventSubscriptionFilter + from .retry_policy import RetryPolicy + from .dead_letter_destination import DeadLetterDestination + from .number_in_advanced_filter import NumberInAdvancedFilter + from .storage_blob_dead_letter_destination import StorageBlobDeadLetterDestination + from .number_not_in_advanced_filter import NumberNotInAdvancedFilter + from .number_less_than_advanced_filter import NumberLessThanAdvancedFilter + from .number_greater_than_advanced_filter import NumberGreaterThanAdvancedFilter + from .number_less_than_or_equals_advanced_filter import NumberLessThanOrEqualsAdvancedFilter + from .number_greater_than_or_equals_advanced_filter import NumberGreaterThanOrEqualsAdvancedFilter + from .bool_equals_advanced_filter import BoolEqualsAdvancedFilter + from .string_in_advanced_filter import StringInAdvancedFilter + from .string_not_in_advanced_filter import StringNotInAdvancedFilter + from .string_begins_with_advanced_filter import StringBeginsWithAdvancedFilter + from .string_ends_with_advanced_filter import StringEndsWithAdvancedFilter + from .string_contains_advanced_filter import StringContainsAdvancedFilter + 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 .service_bus_queue_event_subscription_destination import ServiceBusQueueEventSubscriptionDestination + 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 .topic import Topic + from .topic_update_parameters import TopicUpdateParameters + from .topic_shared_access_keys import TopicSharedAccessKeys + from .topic_regenerate_key_request import TopicRegenerateKeyRequest + from .event_type import EventType + from .topic_type_info import TopicTypeInfo +from .domain_paged import DomainPaged +from .domain_topic_paged import DomainTopicPaged +from .event_subscription_paged import EventSubscriptionPaged +from .operation_paged import OperationPaged +from .topic_paged import TopicPaged +from .event_type_paged import EventTypePaged +from .topic_type_info_paged import TopicTypeInfoPaged +from .event_grid_management_client_enums import ( + DomainProvisioningState, + DomainTopicProvisioningState, + EventSubscriptionProvisioningState, + TopicProvisioningState, + ResourceRegionType, + TopicTypeProvisioningState, +) + +__all__ = [ + 'Resource', + 'TrackedResource', + 'Domain', + 'DomainUpdateParameters', + 'DomainSharedAccessKeys', + 'DomainRegenerateKeyRequest', + 'DomainTopic', + 'EventSubscriptionDestination', + 'AdvancedFilter', + 'EventSubscriptionFilter', + 'RetryPolicy', + 'DeadLetterDestination', + 'NumberInAdvancedFilter', + 'StorageBlobDeadLetterDestination', + 'NumberNotInAdvancedFilter', + 'NumberLessThanAdvancedFilter', + 'NumberGreaterThanAdvancedFilter', + 'NumberLessThanOrEqualsAdvancedFilter', + 'NumberGreaterThanOrEqualsAdvancedFilter', + 'BoolEqualsAdvancedFilter', + 'StringInAdvancedFilter', + 'StringNotInAdvancedFilter', + 'StringBeginsWithAdvancedFilter', + 'StringEndsWithAdvancedFilter', + 'StringContainsAdvancedFilter', + 'WebHookEventSubscriptionDestination', + 'EventHubEventSubscriptionDestination', + 'StorageQueueEventSubscriptionDestination', + 'HybridConnectionEventSubscriptionDestination', + 'ServiceBusQueueEventSubscriptionDestination', + 'EventSubscription', + 'EventSubscriptionUpdateParameters', + 'EventSubscriptionFullUrl', + 'OperationInfo', + 'Operation', + 'Topic', + 'TopicUpdateParameters', + 'TopicSharedAccessKeys', + 'TopicRegenerateKeyRequest', + 'EventType', + 'TopicTypeInfo', + 'DomainPaged', + 'DomainTopicPaged', + 'EventSubscriptionPaged', + 'OperationPaged', + 'TopicPaged', + 'EventTypePaged', + 'TopicTypeInfoPaged', + 'DomainProvisioningState', + 'DomainTopicProvisioningState', + 'EventSubscriptionProvisioningState', + 'TopicProvisioningState', + 'ResourceRegionType', + 'TopicTypeProvisioningState', +] diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter.py new file mode 100644 index 000000000000..10cd4c474b8e --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter.py @@ -0,0 +1,57 @@ +# 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 AdvancedFilter(Model): + """This is the base type that represents an advanced filter. To configure an + advanced filter, do not directly instantiate an object of this class. + Instead, instantiate an object of a derived class such as + BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + StringEqualsAdvancedFilter etc. depending on the type of the key based on + which you want to filter. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: NumberInAdvancedFilter, NumberNotInAdvancedFilter, + NumberLessThanAdvancedFilter, NumberGreaterThanAdvancedFilter, + NumberLessThanOrEqualsAdvancedFilter, + NumberGreaterThanOrEqualsAdvancedFilter, BoolEqualsAdvancedFilter, + StringInAdvancedFilter, StringNotInAdvancedFilter, + StringBeginsWithAdvancedFilter, StringEndsWithAdvancedFilter, + StringContainsAdvancedFilter + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + } + + _subtype_map = { + 'operator_type': {'NumberIn': 'NumberInAdvancedFilter', 'NumberNotIn': 'NumberNotInAdvancedFilter', 'NumberLessThan': 'NumberLessThanAdvancedFilter', 'NumberGreaterThan': 'NumberGreaterThanAdvancedFilter', 'NumberLessThanOrEquals': 'NumberLessThanOrEqualsAdvancedFilter', 'NumberGreaterThanOrEquals': 'NumberGreaterThanOrEqualsAdvancedFilter', 'BoolEquals': 'BoolEqualsAdvancedFilter', 'StringIn': 'StringInAdvancedFilter', 'StringNotIn': 'StringNotInAdvancedFilter', 'StringBeginsWith': 'StringBeginsWithAdvancedFilter', 'StringEndsWith': 'StringEndsWithAdvancedFilter', 'StringContains': 'StringContainsAdvancedFilter'} + } + + def __init__(self, **kwargs): + super(AdvancedFilter, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.operator_type = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter_py3.py new file mode 100644 index 000000000000..d016b6c60b9b --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter_py3.py @@ -0,0 +1,57 @@ +# 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 AdvancedFilter(Model): + """This is the base type that represents an advanced filter. To configure an + advanced filter, do not directly instantiate an object of this class. + Instead, instantiate an object of a derived class such as + BoolEqualsAdvancedFilter, NumberInAdvancedFilter, + StringEqualsAdvancedFilter etc. depending on the type of the key based on + which you want to filter. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: NumberInAdvancedFilter, NumberNotInAdvancedFilter, + NumberLessThanAdvancedFilter, NumberGreaterThanAdvancedFilter, + NumberLessThanOrEqualsAdvancedFilter, + NumberGreaterThanOrEqualsAdvancedFilter, BoolEqualsAdvancedFilter, + StringInAdvancedFilter, StringNotInAdvancedFilter, + StringBeginsWithAdvancedFilter, StringEndsWithAdvancedFilter, + StringContainsAdvancedFilter + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + } + + _subtype_map = { + 'operator_type': {'NumberIn': 'NumberInAdvancedFilter', 'NumberNotIn': 'NumberNotInAdvancedFilter', 'NumberLessThan': 'NumberLessThanAdvancedFilter', 'NumberGreaterThan': 'NumberGreaterThanAdvancedFilter', 'NumberLessThanOrEquals': 'NumberLessThanOrEqualsAdvancedFilter', 'NumberGreaterThanOrEquals': 'NumberGreaterThanOrEqualsAdvancedFilter', 'BoolEquals': 'BoolEqualsAdvancedFilter', 'StringIn': 'StringInAdvancedFilter', 'StringNotIn': 'StringNotInAdvancedFilter', 'StringBeginsWith': 'StringBeginsWithAdvancedFilter', 'StringEndsWith': 'StringEndsWithAdvancedFilter', 'StringContains': 'StringContainsAdvancedFilter'} + } + + def __init__(self, *, key: str=None, **kwargs) -> None: + super(AdvancedFilter, self).__init__(**kwargs) + self.key = key + self.operator_type = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter.py new file mode 100644 index 000000000000..e74a642c229e --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class BoolEqualsAdvancedFilter(AdvancedFilter): + """BoolEquals Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The boolean filter value. + :type value: bool + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(BoolEqualsAdvancedFilter, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.operator_type = 'BoolEquals' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter_py3.py new file mode 100644 index 000000000000..023fd8be7744 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class BoolEqualsAdvancedFilter(AdvancedFilter): + """BoolEquals Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The boolean filter value. + :type value: bool + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, *, key: str=None, value: bool=None, **kwargs) -> None: + super(BoolEqualsAdvancedFilter, self).__init__(key=key, **kwargs) + self.value = value + self.operator_type = 'BoolEquals' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination.py new file mode 100644 index 000000000000..b91be0d5288c --- /dev/null +++ b/sdk/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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/dead_letter_destination_py3.py new file mode 100644 index 000000000000..f38c332f5149 --- /dev/null +++ b/sdk/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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain.py new file mode 100644 index 000000000000..c6cbf8a1bd2f --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain.py @@ -0,0 +1,64 @@ +# 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 .tracked_resource import TrackedResource + + +class Domain(TrackedResource): + """EventGrid Domain. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :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 + :param location: Required. Location of the resource. + :type location: str + :param tags: Tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state of the domain. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Canceled', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.eventgrid.models.DomainProvisioningState + :ivar endpoint: Endpoint for the domain. + :vartype endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Domain, self).__init__(**kwargs) + self.provisioning_state = None + self.endpoint = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_paged.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_paged.py new file mode 100644 index 000000000000..ed7fa29c5786 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class DomainPaged(Paged): + """ + A paging container for iterating over a list of :class:`Domain ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Domain]'} + } + + def __init__(self, *args, **kwargs): + + super(DomainPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_py3.py new file mode 100644 index 000000000000..b01e2e563a0e --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_py3.py @@ -0,0 +1,64 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class Domain(TrackedResource): + """EventGrid Domain. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :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 + :param location: Required. Location of the resource. + :type location: str + :param tags: Tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state of the domain. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Canceled', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.eventgrid.models.DomainProvisioningState + :ivar endpoint: Endpoint for the domain. + :vartype endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Domain, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.endpoint = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request.py new file mode 100644 index 000000000000..266a703414a5 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request.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 DomainRegenerateKeyRequest(Model): + """Domain regenerate share access key request. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Key name to regenerate key1 or key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DomainRegenerateKeyRequest, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request_py3.py new file mode 100644 index 000000000000..62d2c0f7279d --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request_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 DomainRegenerateKeyRequest(Model): + """Domain regenerate share access key request. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Key name to regenerate key1 or key2. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(DomainRegenerateKeyRequest, self).__init__(**kwargs) + self.key_name = key_name diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys.py new file mode 100644 index 000000000000..d04032da4981 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys.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 DomainSharedAccessKeys(Model): + """Shared access keys of the Domain. + + :param key1: Shared access key1 for the domain. + :type key1: str + :param key2: Shared access key2 for the domain. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DomainSharedAccessKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys_py3.py new file mode 100644 index 000000000000..2c13d4ab0367 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys_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 DomainSharedAccessKeys(Model): + """Shared access keys of the Domain. + + :param key1: Shared access key1 for the domain. + :type key1: str + :param key2: Shared access key2 for the domain. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(DomainSharedAccessKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic.py new file mode 100644 index 000000000000..c0c5ae3619ff --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic.py @@ -0,0 +1,49 @@ +# 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 DomainTopic(Resource): + """Domain Topic. + + 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 + :param provisioning_state: Provisioning state of the domain topic. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Canceled', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.eventgrid.models.DomainTopicProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DomainTopic, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_paged.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_paged.py new file mode 100644 index 000000000000..b5f599064d3e --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class DomainTopicPaged(Paged): + """ + A paging container for iterating over a list of :class:`DomainTopic ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DomainTopic]'} + } + + def __init__(self, *args, **kwargs): + + super(DomainTopicPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_py3.py new file mode 100644 index 000000000000..ef8d3d687696 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_py3.py @@ -0,0 +1,49 @@ +# 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_py3 import Resource + + +class DomainTopic(Resource): + """Domain Topic. + + 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 + :param provisioning_state: Provisioning state of the domain topic. + Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Canceled', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.eventgrid.models.DomainTopicProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state=None, **kwargs) -> None: + super(DomainTopic, self).__init__(**kwargs) + self.provisioning_state = provisioning_state diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters.py new file mode 100644 index 000000000000..ca98e1a44b26 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters.py @@ -0,0 +1,28 @@ +# 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 DomainUpdateParameters(Model): + """Properties of the Domain update. + + :param tags: Tags of the domains resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DomainUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters_py3.py new file mode 100644 index 000000000000..681a18a5f227 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters_py3.py @@ -0,0 +1,28 @@ +# 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 DomainUpdateParameters(Model): + """Properties of the Domain update. + + :param tags: Tags of the domains resource. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(DomainUpdateParameters, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py new file mode 100644 index 000000000000..c0d3b4079d5c --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py @@ -0,0 +1,69 @@ +# 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 DomainProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" + + +class DomainTopicProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" + + +class EventSubscriptionProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" + awaiting_manual_action = "AwaitingManualAction" + + +class TopicProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" + + +class ResourceRegionType(str, Enum): + + regional_resource = "RegionalResource" + global_resource = "GlobalResource" + + +class TopicTypeProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_hub_event_subscription_destination.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_hub_event_subscription_destination.py new file mode 100644 index 000000000000..57252109fa55 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_hub_event_subscription_destination.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 .event_subscription_destination import EventSubscriptionDestination + + +class EventHubEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the event hub 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 that represents the endpoint of + an Event Hub 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(EventHubEventSubscriptionDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.endpoint_type = 'EventHub' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_hub_event_subscription_destination_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_hub_event_subscription_destination_py3.py new file mode 100644 index 000000000000..3e86991a1375 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_hub_event_subscription_destination_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 .event_subscription_destination_py3 import EventSubscriptionDestination + + +class EventHubEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the event hub 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 that represents the endpoint of + an Event Hub 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(EventHubEventSubscriptionDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.endpoint_type = 'EventHub' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py new file mode 100644 index 000000000000..7e4034ed7f4c --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py @@ -0,0 +1,84 @@ +# 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 expiration_time_utc: Expiration time of the event subscription. + :type expiration_time_utc: datetime + :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]'}, + 'expiration_time_utc': {'key': 'properties.expirationTimeUtc', 'type': 'iso-8601'}, + '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.expiration_time_utc = kwargs.get('expiration_time_utc', None) + self.retry_policy = kwargs.get('retry_policy', None) + self.dead_letter_destination = kwargs.get('dead_letter_destination', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination.py new file mode 100644 index 000000000000..6422d14d56b1 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_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 EventSubscriptionDestination(Model): + """Information about the destination for an event subscription. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WebHookEventSubscriptionDestination, + EventHubEventSubscriptionDestination, + StorageQueueEventSubscriptionDestination, + HybridConnectionEventSubscriptionDestination, + ServiceBusQueueEventSubscriptionDestination + + 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': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination', 'StorageQueue': 'StorageQueueEventSubscriptionDestination', 'HybridConnection': 'HybridConnectionEventSubscriptionDestination', 'ServiceBusQueue': 'ServiceBusQueueEventSubscriptionDestination'} + } + + def __init__(self, **kwargs): + super(EventSubscriptionDestination, self).__init__(**kwargs) + self.endpoint_type = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_destination_py3.py new file mode 100644 index 000000000000..b63db834f037 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_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 EventSubscriptionDestination(Model): + """Information about the destination for an event subscription. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: WebHookEventSubscriptionDestination, + EventHubEventSubscriptionDestination, + StorageQueueEventSubscriptionDestination, + HybridConnectionEventSubscriptionDestination, + ServiceBusQueueEventSubscriptionDestination + + 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': {'WebHook': 'WebHookEventSubscriptionDestination', 'EventHub': 'EventHubEventSubscriptionDestination', 'StorageQueue': 'StorageQueueEventSubscriptionDestination', 'HybridConnection': 'HybridConnectionEventSubscriptionDestination', 'ServiceBusQueue': 'ServiceBusQueueEventSubscriptionDestination'} + } + + def __init__(self, **kwargs) -> None: + super(EventSubscriptionDestination, self).__init__(**kwargs) + self.endpoint_type = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter.py new file mode 100644 index 000000000000..41bd9b04b4bc --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter.py @@ -0,0 +1,54 @@ +# 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 EventSubscriptionFilter(Model): + """Filter for the Event Subscription. + + :param subject_begins_with: An optional string to filter events for an + event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path. + :type subject_begins_with: str + :param subject_ends_with: An optional string to filter events for an event + subscription based on a resource path suffix. + Wildcard characters are not supported in this path. + :type subject_ends_with: str + :param included_event_types: A list of applicable event types that need to + be part of the event subscription. If it is desired to subscribe to all + default event types, set the IncludedEventTypes to null. + :type included_event_types: list[str] + :param is_subject_case_sensitive: Specifies if the SubjectBeginsWith and + SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. Default value: False . + :type is_subject_case_sensitive: bool + :param advanced_filters: An array of advanced filters that are used for + filtering event subscriptions. + :type advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter] + """ + + _attribute_map = { + 'subject_begins_with': {'key': 'subjectBeginsWith', 'type': 'str'}, + 'subject_ends_with': {'key': 'subjectEndsWith', 'type': 'str'}, + 'included_event_types': {'key': 'includedEventTypes', 'type': '[str]'}, + 'is_subject_case_sensitive': {'key': 'isSubjectCaseSensitive', 'type': 'bool'}, + 'advanced_filters': {'key': 'advancedFilters', 'type': '[AdvancedFilter]'}, + } + + def __init__(self, **kwargs): + super(EventSubscriptionFilter, self).__init__(**kwargs) + self.subject_begins_with = kwargs.get('subject_begins_with', None) + self.subject_ends_with = kwargs.get('subject_ends_with', None) + self.included_event_types = kwargs.get('included_event_types', None) + self.is_subject_case_sensitive = kwargs.get('is_subject_case_sensitive', False) + self.advanced_filters = kwargs.get('advanced_filters', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter_py3.py new file mode 100644 index 000000000000..2591b771a441 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter_py3.py @@ -0,0 +1,54 @@ +# 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 EventSubscriptionFilter(Model): + """Filter for the Event Subscription. + + :param subject_begins_with: An optional string to filter events for an + event subscription based on a resource path prefix. + The format of this depends on the publisher of the events. + Wildcard characters are not supported in this path. + :type subject_begins_with: str + :param subject_ends_with: An optional string to filter events for an event + subscription based on a resource path suffix. + Wildcard characters are not supported in this path. + :type subject_ends_with: str + :param included_event_types: A list of applicable event types that need to + be part of the event subscription. If it is desired to subscribe to all + default event types, set the IncludedEventTypes to null. + :type included_event_types: list[str] + :param is_subject_case_sensitive: Specifies if the SubjectBeginsWith and + SubjectEndsWith properties of the filter + should be compared in a case sensitive manner. Default value: False . + :type is_subject_case_sensitive: bool + :param advanced_filters: An array of advanced filters that are used for + filtering event subscriptions. + :type advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter] + """ + + _attribute_map = { + 'subject_begins_with': {'key': 'subjectBeginsWith', 'type': 'str'}, + 'subject_ends_with': {'key': 'subjectEndsWith', 'type': 'str'}, + 'included_event_types': {'key': 'includedEventTypes', 'type': '[str]'}, + 'is_subject_case_sensitive': {'key': 'isSubjectCaseSensitive', 'type': 'bool'}, + 'advanced_filters': {'key': 'advancedFilters', 'type': '[AdvancedFilter]'}, + } + + def __init__(self, *, subject_begins_with: str=None, subject_ends_with: str=None, included_event_types=None, is_subject_case_sensitive: bool=False, advanced_filters=None, **kwargs) -> None: + super(EventSubscriptionFilter, self).__init__(**kwargs) + self.subject_begins_with = subject_begins_with + self.subject_ends_with = subject_ends_with + self.included_event_types = included_event_types + self.is_subject_case_sensitive = is_subject_case_sensitive + self.advanced_filters = advanced_filters diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_full_url.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_full_url.py new file mode 100644 index 000000000000..e0b289a47ef6 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_full_url.py @@ -0,0 +1,29 @@ +# 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 EventSubscriptionFullUrl(Model): + """Full endpoint url of an event subscription. + + :param endpoint_url: The URL that represents the endpoint of the + destination of an event subscription. + :type endpoint_url: str + """ + + _attribute_map = { + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EventSubscriptionFullUrl, self).__init__(**kwargs) + self.endpoint_url = kwargs.get('endpoint_url', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_full_url_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_full_url_py3.py new file mode 100644 index 000000000000..f1471cde4313 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_full_url_py3.py @@ -0,0 +1,29 @@ +# 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 EventSubscriptionFullUrl(Model): + """Full endpoint url of an event subscription. + + :param endpoint_url: The URL that represents the endpoint of the + destination of an event subscription. + :type endpoint_url: str + """ + + _attribute_map = { + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + } + + def __init__(self, *, endpoint_url: str=None, **kwargs) -> None: + super(EventSubscriptionFullUrl, self).__init__(**kwargs) + self.endpoint_url = endpoint_url diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_paged.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_paged.py new file mode 100644 index 000000000000..4a4656c716bc --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class EventSubscriptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`EventSubscription ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EventSubscription]'} + } + + def __init__(self, *args, **kwargs): + + super(EventSubscriptionPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py new file mode 100644 index 000000000000..8fed85e7b1dc --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py @@ -0,0 +1,84 @@ +# 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_py3 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 expiration_time_utc: Expiration time of the event subscription. + :type expiration_time_utc: datetime + :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]'}, + 'expiration_time_utc': {'key': 'properties.expirationTimeUtc', 'type': 'iso-8601'}, + 'retry_policy': {'key': 'properties.retryPolicy', 'type': 'RetryPolicy'}, + 'dead_letter_destination': {'key': 'properties.deadLetterDestination', 'type': 'DeadLetterDestination'}, + } + + def __init__(self, *, destination=None, filter=None, labels=None, expiration_time_utc=None, 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.expiration_time_utc = expiration_time_utc + self.retry_policy = retry_policy + self.dead_letter_destination = dead_letter_destination diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py new file mode 100644 index 000000000000..0d76071f0078 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py @@ -0,0 +1,54 @@ +# 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 EventSubscriptionUpdateParameters(Model): + """Properties of the Event Subscription update. + + :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 expiration_time_utc: Information about the expiration time for the + event subscription. + :type expiration_time_utc: datetime + :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]'}, + 'expiration_time_utc': {'key': 'expirationTimeUtc', 'type': 'iso-8601'}, + '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.expiration_time_utc = kwargs.get('expiration_time_utc', None) + self.retry_policy = kwargs.get('retry_policy', None) + self.dead_letter_destination = kwargs.get('dead_letter_destination', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py new file mode 100644 index 000000000000..a124a7623031 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py @@ -0,0 +1,54 @@ +# 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 EventSubscriptionUpdateParameters(Model): + """Properties of the Event Subscription update. + + :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 expiration_time_utc: Information about the expiration time for the + event subscription. + :type expiration_time_utc: datetime + :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]'}, + 'expiration_time_utc': {'key': 'expirationTimeUtc', 'type': 'iso-8601'}, + 'retry_policy': {'key': 'retryPolicy', 'type': 'RetryPolicy'}, + 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, + } + + def __init__(self, *, destination=None, filter=None, labels=None, expiration_time_utc=None, retry_policy=None, dead_letter_destination=None, **kwargs) -> None: + super(EventSubscriptionUpdateParameters, self).__init__(**kwargs) + self.destination = destination + self.filter = filter + self.labels = labels + self.expiration_time_utc = expiration_time_utc + self.retry_policy = retry_policy + self.dead_letter_destination = dead_letter_destination diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type.py new file mode 100644 index 000000000000..3695b2342878 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type.py @@ -0,0 +1,58 @@ +# 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 EventType(Resource): + """Event Type for a subject under a topic. + + 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 + :param display_name: Display name of the event type. + :type display_name: str + :param description: Description of the event type. + :type description: str + :param schema_url: Url of the schema for this event type. + :type schema_url: str + :param is_in_default_set: IsInDefaultSet flag of the event type. + :type is_in_default_set: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'schema_url': {'key': 'properties.schemaUrl', 'type': 'str'}, + 'is_in_default_set': {'key': 'properties.isInDefaultSet', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(EventType, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.schema_url = kwargs.get('schema_url', None) + self.is_in_default_set = kwargs.get('is_in_default_set', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type_paged.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type_paged.py new file mode 100644 index 000000000000..18fad1e1f3e4 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class EventTypePaged(Paged): + """ + A paging container for iterating over a list of :class:`EventType ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EventType]'} + } + + def __init__(self, *args, **kwargs): + + super(EventTypePaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type_py3.py new file mode 100644 index 000000000000..ba779720ebf8 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_type_py3.py @@ -0,0 +1,58 @@ +# 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_py3 import Resource + + +class EventType(Resource): + """Event Type for a subject under a topic. + + 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 + :param display_name: Display name of the event type. + :type display_name: str + :param description: Description of the event type. + :type description: str + :param schema_url: Url of the schema for this event type. + :type schema_url: str + :param is_in_default_set: IsInDefaultSet flag of the event type. + :type is_in_default_set: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'schema_url': {'key': 'properties.schemaUrl', 'type': 'str'}, + 'is_in_default_set': {'key': 'properties.isInDefaultSet', 'type': 'bool'}, + } + + def __init__(self, *, display_name: str=None, description: str=None, schema_url: str=None, is_in_default_set: bool=None, **kwargs) -> None: + super(EventType, self).__init__(**kwargs) + self.display_name = display_name + self.description = description + self.schema_url = schema_url + self.is_in_default_set = is_in_default_set diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination.py new file mode 100644 index 000000000000..a28228db5fa0 --- /dev/null +++ b/sdk/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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/hybrid_connection_event_subscription_destination_py3.py new file mode 100644 index 000000000000..cbc2c2800399 --- /dev/null +++ b/sdk/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_py3 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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter.py new file mode 100644 index 000000000000..10436cd38c83 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class NumberGreaterThanAdvancedFilter(AdvancedFilter): + """NumberGreaterThan Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The filter value. + :type value: float + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(NumberGreaterThanAdvancedFilter, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.operator_type = 'NumberGreaterThan' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter_py3.py new file mode 100644 index 000000000000..19159f6bfaff --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class NumberGreaterThanAdvancedFilter(AdvancedFilter): + """NumberGreaterThan Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The filter value. + :type value: float + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, *, key: str=None, value: float=None, **kwargs) -> None: + super(NumberGreaterThanAdvancedFilter, self).__init__(key=key, **kwargs) + self.value = value + self.operator_type = 'NumberGreaterThan' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter.py new file mode 100644 index 000000000000..788b24944d39 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class NumberGreaterThanOrEqualsAdvancedFilter(AdvancedFilter): + """NumberGreaterThanOrEquals Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The filter value. + :type value: float + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(NumberGreaterThanOrEqualsAdvancedFilter, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.operator_type = 'NumberGreaterThanOrEquals' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter_py3.py new file mode 100644 index 000000000000..c4b6e30da7e8 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class NumberGreaterThanOrEqualsAdvancedFilter(AdvancedFilter): + """NumberGreaterThanOrEquals Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The filter value. + :type value: float + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, *, key: str=None, value: float=None, **kwargs) -> None: + super(NumberGreaterThanOrEqualsAdvancedFilter, self).__init__(key=key, **kwargs) + self.value = value + self.operator_type = 'NumberGreaterThanOrEquals' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter.py new file mode 100644 index 000000000000..e44bc777d29b --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class NumberInAdvancedFilter(AdvancedFilter): + """NumberIn Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[float] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[float]'}, + } + + def __init__(self, **kwargs): + super(NumberInAdvancedFilter, self).__init__(**kwargs) + self.values = kwargs.get('values', None) + self.operator_type = 'NumberIn' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter_py3.py new file mode 100644 index 000000000000..de1bc1e7ec09 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class NumberInAdvancedFilter(AdvancedFilter): + """NumberIn Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[float] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[float]'}, + } + + def __init__(self, *, key: str=None, values=None, **kwargs) -> None: + super(NumberInAdvancedFilter, self).__init__(key=key, **kwargs) + self.values = values + self.operator_type = 'NumberIn' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter.py new file mode 100644 index 000000000000..b3ede5c3b7a5 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class NumberLessThanAdvancedFilter(AdvancedFilter): + """NumberLessThan Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The filter value. + :type value: float + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(NumberLessThanAdvancedFilter, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.operator_type = 'NumberLessThan' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter_py3.py new file mode 100644 index 000000000000..8f46f001dec4 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class NumberLessThanAdvancedFilter(AdvancedFilter): + """NumberLessThan Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The filter value. + :type value: float + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, *, key: str=None, value: float=None, **kwargs) -> None: + super(NumberLessThanAdvancedFilter, self).__init__(key=key, **kwargs) + self.value = value + self.operator_type = 'NumberLessThan' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter.py new file mode 100644 index 000000000000..602bff830850 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class NumberLessThanOrEqualsAdvancedFilter(AdvancedFilter): + """NumberLessThanOrEquals Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The filter value. + :type value: float + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(NumberLessThanOrEqualsAdvancedFilter, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.operator_type = 'NumberLessThanOrEquals' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter_py3.py new file mode 100644 index 000000000000..82826657c30a --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class NumberLessThanOrEqualsAdvancedFilter(AdvancedFilter): + """NumberLessThanOrEquals Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The filter value. + :type value: float + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, *, key: str=None, value: float=None, **kwargs) -> None: + super(NumberLessThanOrEqualsAdvancedFilter, self).__init__(key=key, **kwargs) + self.value = value + self.operator_type = 'NumberLessThanOrEquals' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter.py new file mode 100644 index 000000000000..8a506a7da5c5 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class NumberNotInAdvancedFilter(AdvancedFilter): + """NumberNotIn Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[float] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[float]'}, + } + + def __init__(self, **kwargs): + super(NumberNotInAdvancedFilter, self).__init__(**kwargs) + self.values = kwargs.get('values', None) + self.operator_type = 'NumberNotIn' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter_py3.py new file mode 100644 index 000000000000..5341e58be5bb --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class NumberNotInAdvancedFilter(AdvancedFilter): + """NumberNotIn Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[float] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[float]'}, + } + + def __init__(self, *, key: str=None, values=None, **kwargs) -> None: + super(NumberNotInAdvancedFilter, self).__init__(key=key, **kwargs) + self.values = values + self.operator_type = 'NumberNotIn' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation.py new file mode 100644 index 000000000000..eb3f843485e7 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation.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 msrest.serialization import Model + + +class Operation(Model): + """Represents an operation returned by the GetOperations request. + + :param name: Name of the operation + :type name: str + :param display: Display name of the operation + :type display: ~azure.mgmt.eventgrid.models.OperationInfo + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_info.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_info.py new file mode 100644 index 000000000000..20c7286c095b --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_info.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 msrest.serialization import Model + + +class OperationInfo(Model): + """Information about an operation. + + :param provider: Name of the provider + :type provider: str + :param resource: Name of the resource type + :type resource: str + :param operation: Name of the operation + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationInfo, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_info_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_info_py3.py new file mode 100644 index 000000000000..66fb1fe94a2d --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_info_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 msrest.serialization import Model + + +class OperationInfo(Model): + """Information about an operation. + + :param provider: Name of the provider + :type provider: str + :param resource: Name of the resource type + :type resource: str + :param operation: Name of the operation + :type operation: str + :param description: Description of the operation + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationInfo, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_paged.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_paged.py new file mode 100644 index 000000000000..097349fa5db5 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_py3.py new file mode 100644 index 000000000000..cfe331cc61df --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/operation_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 msrest.serialization import Model + + +class Operation(Model): + """Represents an operation returned by the GetOperations request. + + :param name: Name of the operation + :type name: str + :param display: Display name of the operation + :type display: ~azure.mgmt.eventgrid.models.OperationInfo + :param origin: Origin of the operation + :type origin: str + :param properties: Properties of the operation + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/resource.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/resource.py new file mode 100644 index 000000000000..98c7040f0350 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/resource.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 Resource(Model): + """Definition of a Resource. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/resource_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/resource_py3.py new file mode 100644 index 000000000000..b8ac5f18a8d4 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/resource_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 Resource(Model): + """Definition of a Resource. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy.py new file mode 100644 index 000000000000..7b0b7c04141c --- /dev/null +++ b/sdk/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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/retry_policy_py3.py new file mode 100644 index 000000000000..12a366226399 --- /dev/null +++ b/sdk/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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/service_bus_queue_event_subscription_destination.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/service_bus_queue_event_subscription_destination.py new file mode 100644 index 000000000000..aae5c7e3eb6b --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/service_bus_queue_event_subscription_destination.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 .event_subscription_destination import EventSubscriptionDestination + + +class ServiceBusQueueEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the service bus 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 that represents the endpoint of + the Service Bus 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(ServiceBusQueueEventSubscriptionDestination, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.endpoint_type = 'ServiceBusQueue' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/service_bus_queue_event_subscription_destination_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/service_bus_queue_event_subscription_destination_py3.py new file mode 100644 index 000000000000..8eb780cb7c3e --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/service_bus_queue_event_subscription_destination_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 .event_subscription_destination_py3 import EventSubscriptionDestination + + +class ServiceBusQueueEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the service bus 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 that represents the endpoint of + the Service Bus 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(ServiceBusQueueEventSubscriptionDestination, self).__init__(**kwargs) + self.resource_id = resource_id + self.endpoint_type = 'ServiceBusQueue' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination.py new file mode 100644 index 000000000000..aadbe4e08efa --- /dev/null +++ b/sdk/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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_blob_dead_letter_destination_py3.py new file mode 100644 index 000000000000..65e0813f852e --- /dev/null +++ b/sdk/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_py3 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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination.py new file mode 100644 index 000000000000..620fea9145e9 --- /dev/null +++ b/sdk/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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/storage_queue_event_subscription_destination_py3.py new file mode 100644 index 000000000000..0804b774727a --- /dev/null +++ b/sdk/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_py3 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/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter.py new file mode 100644 index 000000000000..e45cfd1741f1 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class StringBeginsWithAdvancedFilter(AdvancedFilter): + """StringBeginsWith Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(StringBeginsWithAdvancedFilter, self).__init__(**kwargs) + self.values = kwargs.get('values', None) + self.operator_type = 'StringBeginsWith' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter_py3.py new file mode 100644 index 000000000000..c6692bb765a5 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class StringBeginsWithAdvancedFilter(AdvancedFilter): + """StringBeginsWith Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, *, key: str=None, values=None, **kwargs) -> None: + super(StringBeginsWithAdvancedFilter, self).__init__(key=key, **kwargs) + self.values = values + self.operator_type = 'StringBeginsWith' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter.py new file mode 100644 index 000000000000..e39dceecb55b --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class StringContainsAdvancedFilter(AdvancedFilter): + """StringContains Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(StringContainsAdvancedFilter, self).__init__(**kwargs) + self.values = kwargs.get('values', None) + self.operator_type = 'StringContains' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter_py3.py new file mode 100644 index 000000000000..b66328c7f883 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class StringContainsAdvancedFilter(AdvancedFilter): + """StringContains Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, *, key: str=None, values=None, **kwargs) -> None: + super(StringContainsAdvancedFilter, self).__init__(key=key, **kwargs) + self.values = values + self.operator_type = 'StringContains' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter.py new file mode 100644 index 000000000000..ba70983a8303 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class StringEndsWithAdvancedFilter(AdvancedFilter): + """StringEndsWith Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(StringEndsWithAdvancedFilter, self).__init__(**kwargs) + self.values = kwargs.get('values', None) + self.operator_type = 'StringEndsWith' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter_py3.py new file mode 100644 index 000000000000..3ed41a492f8b --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class StringEndsWithAdvancedFilter(AdvancedFilter): + """StringEndsWith Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, *, key: str=None, values=None, **kwargs) -> None: + super(StringEndsWithAdvancedFilter, self).__init__(key=key, **kwargs) + self.values = values + self.operator_type = 'StringEndsWith' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter.py new file mode 100644 index 000000000000..0d75dd8d7ac8 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class StringInAdvancedFilter(AdvancedFilter): + """StringIn Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(StringInAdvancedFilter, self).__init__(**kwargs) + self.values = kwargs.get('values', None) + self.operator_type = 'StringIn' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter_py3.py new file mode 100644 index 000000000000..6ffd7e8c839d --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class StringInAdvancedFilter(AdvancedFilter): + """StringIn Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, *, key: str=None, values=None, **kwargs) -> None: + super(StringInAdvancedFilter, self).__init__(key=key, **kwargs) + self.values = values + self.operator_type = 'StringIn' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter.py new file mode 100644 index 000000000000..0b7924b7046e --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter import AdvancedFilter + + +class StringNotInAdvancedFilter(AdvancedFilter): + """StringNotIn Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(StringNotInAdvancedFilter, self).__init__(**kwargs) + self.values = kwargs.get('values', None) + self.operator_type = 'StringNotIn' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter_py3.py new file mode 100644 index 000000000000..001b5b42da1c --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter_py3.py @@ -0,0 +1,42 @@ +# 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 .advanced_filter_py3 import AdvancedFilter + + +class StringNotInAdvancedFilter(AdvancedFilter): + """StringNotIn Advanced Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The field/property in the event based on which you want to + filter. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param values: The set of filter values. + :type values: list[str] + """ + + _validation = { + 'operator_type': {'required': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'operator_type': {'key': 'operatorType', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + } + + def __init__(self, *, key: str=None, values=None, **kwargs) -> None: + super(StringNotInAdvancedFilter, self).__init__(key=key, **kwargs) + self.values = values + self.operator_type = 'StringNotIn' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic.py new file mode 100644 index 000000000000..21dfede3186c --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic.py @@ -0,0 +1,64 @@ +# 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 .tracked_resource import TrackedResource + + +class Topic(TrackedResource): + """EventGrid Topic. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :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 + :param location: Required. Location of the resource. + :type location: str + :param tags: Tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state of the topic. Possible values + include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.eventgrid.models.TopicProvisioningState + :ivar endpoint: Endpoint for the topic. + :vartype endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Topic, self).__init__(**kwargs) + self.provisioning_state = None + self.endpoint = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_paged.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_paged.py new file mode 100644 index 000000000000..ff520ebd8f22 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class TopicPaged(Paged): + """ + A paging container for iterating over a list of :class:`Topic ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Topic]'} + } + + def __init__(self, *args, **kwargs): + + super(TopicPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_py3.py new file mode 100644 index 000000000000..98751fa42f8c --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_py3.py @@ -0,0 +1,64 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class Topic(TrackedResource): + """EventGrid Topic. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :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 + :param location: Required. Location of the resource. + :type location: str + :param tags: Tags of the resource. + :type tags: dict[str, str] + :ivar provisioning_state: Provisioning state of the topic. Possible values + include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Canceled', + 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.eventgrid.models.TopicProvisioningState + :ivar endpoint: Endpoint for the topic. + :vartype endpoint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'endpoint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Topic, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.endpoint = None diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request.py new file mode 100644 index 000000000000..3335abcd735a --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request.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 TopicRegenerateKeyRequest(Model): + """Topic regenerate share access key request. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Key name to regenerate key1 or key2 + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TopicRegenerateKeyRequest, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request_py3.py new file mode 100644 index 000000000000..348236358bf9 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_regenerate_key_request_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 TopicRegenerateKeyRequest(Model): + """Topic regenerate share access key request. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. Key name to regenerate key1 or key2 + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(TopicRegenerateKeyRequest, self).__init__(**kwargs) + self.key_name = key_name diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_shared_access_keys.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_shared_access_keys.py new file mode 100644 index 000000000000..ce6addd82f12 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_shared_access_keys.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 TopicSharedAccessKeys(Model): + """Shared access keys of the Topic. + + :param key1: Shared access key1 for the topic. + :type key1: str + :param key2: Shared access key2 for the topic. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TopicSharedAccessKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_shared_access_keys_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_shared_access_keys_py3.py new file mode 100644 index 000000000000..33da4d09b90e --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_shared_access_keys_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 TopicSharedAccessKeys(Model): + """Shared access keys of the Topic. + + :param key1: Shared access key1 for the topic. + :type key1: str + :param key2: Shared access key2 for the topic. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(TopicSharedAccessKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info.py new file mode 100644 index 000000000000..30f84e5c3664 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info.py @@ -0,0 +1,72 @@ +# 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 TopicTypeInfo(Resource): + """Properties of a topic type info. + + 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 + :param provider: Namespace of the provider of the topic type. + :type provider: str + :param display_name: Display Name for the topic type. + :type display_name: str + :param description: Description of the topic type. + :type description: str + :param resource_region_type: Region type of the resource. Possible values + include: 'RegionalResource', 'GlobalResource' + :type resource_region_type: str or + ~azure.mgmt.eventgrid.models.ResourceRegionType + :param provisioning_state: Provisioning state of the topic type. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Canceled', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.eventgrid.models.TopicTypeProvisioningState + :param supported_locations: List of locations supported by this topic + type. + :type supported_locations: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'resource_region_type': {'key': 'properties.resourceRegionType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'supported_locations': {'key': 'properties.supportedLocations', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(TopicTypeInfo, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.resource_region_type = kwargs.get('resource_region_type', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.supported_locations = kwargs.get('supported_locations', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info_paged.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info_paged.py new file mode 100644 index 000000000000..e66d5826938c --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class TopicTypeInfoPaged(Paged): + """ + A paging container for iterating over a list of :class:`TopicTypeInfo ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TopicTypeInfo]'} + } + + def __init__(self, *args, **kwargs): + + super(TopicTypeInfoPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info_py3.py new file mode 100644 index 000000000000..857812caa7e7 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_type_info_py3.py @@ -0,0 +1,72 @@ +# 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_py3 import Resource + + +class TopicTypeInfo(Resource): + """Properties of a topic type info. + + 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 + :param provider: Namespace of the provider of the topic type. + :type provider: str + :param display_name: Display Name for the topic type. + :type display_name: str + :param description: Description of the topic type. + :type description: str + :param resource_region_type: Region type of the resource. Possible values + include: 'RegionalResource', 'GlobalResource' + :type resource_region_type: str or + ~azure.mgmt.eventgrid.models.ResourceRegionType + :param provisioning_state: Provisioning state of the topic type. Possible + values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + 'Canceled', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.eventgrid.models.TopicTypeProvisioningState + :param supported_locations: List of locations supported by this topic + type. + :type supported_locations: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provider': {'key': 'properties.provider', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'resource_region_type': {'key': 'properties.resourceRegionType', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'supported_locations': {'key': 'properties.supportedLocations', 'type': '[str]'}, + } + + def __init__(self, *, provider: str=None, display_name: str=None, description: str=None, resource_region_type=None, provisioning_state=None, supported_locations=None, **kwargs) -> None: + super(TopicTypeInfo, self).__init__(**kwargs) + self.provider = provider + self.display_name = display_name + self.description = description + self.resource_region_type = resource_region_type + self.provisioning_state = provisioning_state + self.supported_locations = supported_locations diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_update_parameters.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_update_parameters.py new file mode 100644 index 000000000000..cda279e1b7f3 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_update_parameters.py @@ -0,0 +1,28 @@ +# 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 TopicUpdateParameters(Model): + """Properties of the Topic update. + + :param tags: Tags of the resource + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TopicUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_update_parameters_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_update_parameters_py3.py new file mode 100644 index 000000000000..8e26e58fa901 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/topic_update_parameters_py3.py @@ -0,0 +1,28 @@ +# 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 TopicUpdateParameters(Model): + """Properties of the Topic update. + + :param tags: Tags of the resource + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(TopicUpdateParameters, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/tracked_resource.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/tracked_resource.py new file mode 100644 index 000000000000..cdd27c52cbf6 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/tracked_resource.py @@ -0,0 +1,53 @@ +# 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 TrackedResource(Resource): + """Definition of a Tracked Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :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 + :param location: Required. Location of the resource. + :type location: str + :param tags: Tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/tracked_resource_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/tracked_resource_py3.py new file mode 100644 index 000000000000..58c772bdd51b --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/tracked_resource_py3.py @@ -0,0 +1,53 @@ +# 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_py3 import Resource + + +class TrackedResource(Resource): + """Definition of a Tracked Resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :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 + :param location: Required. Location of the resource. + :type location: str + :param tags: Tags of the resource. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/web_hook_event_subscription_destination.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/web_hook_event_subscription_destination.py new file mode 100644 index 000000000000..3151fe821403 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/web_hook_event_subscription_destination.py @@ -0,0 +1,48 @@ +# 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 WebHookEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the webhook destination for an event subscription. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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 endpoint_url: The URL that represents the endpoint of the + destination of an event subscription. + :type endpoint_url: str + :ivar endpoint_base_url: The base URL that represents the endpoint of the + destination of an event subscription. + :vartype endpoint_base_url: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + 'endpoint_base_url': {'readonly': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'endpoint_url': {'key': 'properties.endpointUrl', 'type': 'str'}, + 'endpoint_base_url': {'key': 'properties.endpointBaseUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WebHookEventSubscriptionDestination, self).__init__(**kwargs) + self.endpoint_url = kwargs.get('endpoint_url', None) + self.endpoint_base_url = None + self.endpoint_type = 'WebHook' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/web_hook_event_subscription_destination_py3.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/web_hook_event_subscription_destination_py3.py new file mode 100644 index 000000000000..2aa7e58c0cf3 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/web_hook_event_subscription_destination_py3.py @@ -0,0 +1,48 @@ +# 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_py3 import EventSubscriptionDestination + + +class WebHookEventSubscriptionDestination(EventSubscriptionDestination): + """Information about the webhook destination for an event subscription. + + Variables are only populated by the server, and will be ignored when + sending a request. + + 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 endpoint_url: The URL that represents the endpoint of the + destination of an event subscription. + :type endpoint_url: str + :ivar endpoint_base_url: The base URL that represents the endpoint of the + destination of an event subscription. + :vartype endpoint_base_url: str + """ + + _validation = { + 'endpoint_type': {'required': True}, + 'endpoint_base_url': {'readonly': True}, + } + + _attribute_map = { + 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, + 'endpoint_url': {'key': 'properties.endpointUrl', 'type': 'str'}, + 'endpoint_base_url': {'key': 'properties.endpointBaseUrl', 'type': 'str'}, + } + + def __init__(self, *, endpoint_url: str=None, **kwargs) -> None: + super(WebHookEventSubscriptionDestination, self).__init__(**kwargs) + self.endpoint_url = endpoint_url + self.endpoint_base_url = None + self.endpoint_type = 'WebHook' diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/__init__.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/__init__.py new file mode 100644 index 000000000000..809a02494719 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/__init__.py @@ -0,0 +1,26 @@ +# 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 .domains_operations import DomainsOperations +from .domain_topics_operations import DomainTopicsOperations +from .event_subscriptions_operations import EventSubscriptionsOperations +from .operations import Operations +from .topics_operations import TopicsOperations +from .topic_types_operations import TopicTypesOperations + +__all__ = [ + 'DomainsOperations', + 'DomainTopicsOperations', + 'EventSubscriptionsOperations', + 'Operations', + 'TopicsOperations', + 'TopicTypesOperations', +] diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domain_topics_operations.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domain_topics_operations.py new file mode 100644 index 000000000000..7cc064f4006e --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domain_topics_operations.py @@ -0,0 +1,386 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DomainTopicsOperations(object): + """DomainTopicsOperations operations. + + :param client: Client for service requests. + :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: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def get( + self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, **operation_config): + """Get a domain topic. + + Get properties of a domain topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain_topic_name: Name of the topic. + :type domain_topic_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DomainTopic or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.DomainTopic or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'domainTopicName': self._serialize.url("domain_topic_name", domain_topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DomainTopic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'} + + + def _create_or_update_initial( + self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'domainTopicName': self._serialize.url("domain_topic_name", domain_topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('DomainTopic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a domain topic. + + Asynchronously creates or updates a new domain topic with the specified + parameters. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain_topic_name: Name of the domain topic. + :type domain_topic_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DomainTopic or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.DomainTopic] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.DomainTopic]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + domain_topic_name=domain_topic_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DomainTopic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'} + + + def _delete_initial( + self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'domainTopicName': self._serialize.url("domain_topic_name", domain_topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, domain_name, domain_topic_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a domain topic. + + Delete existing domain topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param domain_topic_name: Name of the domain topic. + :type domain_topic_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + domain_topic_name=domain_topic_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{domainTopicName}'} + + def list_by_domain( + self, resource_group_name, domain_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List domain topics. + + List all the topics in a domain. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Domain name. + :type domain_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DomainTopic + :rtype: + ~azure.mgmt.eventgrid.models.DomainTopicPaged[~azure.mgmt.eventgrid.models.DomainTopic] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_domain.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DomainTopicPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DomainTopicPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_domain.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics'} diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py new file mode 100644 index 000000000000..3ba9aa92b37d --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py @@ -0,0 +1,711 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DomainsOperations(object): + """DomainsOperations operations. + + :param client: Client for service requests. + :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: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def get( + self, resource_group_name, domain_name, custom_headers=None, raw=False, **operation_config): + """Get a domain. + + Get properties of a domain. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Domain or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.Domain or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Domain', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'} + + + def _create_or_update_initial( + self, resource_group_name, domain_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + domain_info = models.Domain(location=location, tags=tags) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(domain_info, 'Domain') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Domain', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, domain_name, location, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a domain. + + Asynchronously creates or updates a new domain with the specified + parameters. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param location: Location of the resource. + :type location: str + :param tags: Tags of the resource. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Domain or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Domain] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.Domain]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + location=location, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Domain', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'} + + + def _delete_initial( + self, resource_group_name, domain_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, domain_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a domain. + + Delete existing domain. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'} + + + def _update_initial( + self, resource_group_name, domain_name, tags=None, custom_headers=None, raw=False, **operation_config): + domain_update_parameters = models.DomainUpdateParameters(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(domain_update_parameters, 'DomainUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Domain', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, domain_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a domain. + + Asynchronously updates a domain with the specified parameters. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param tags: Tags of the domains resource. + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Domain or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Domain] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.Domain]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + domain_name=domain_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Domain', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}'} + + def list_by_subscription( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List domains under an Azure subscription. + + List all the domains under an Azure subscription. + + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Domain + :rtype: + ~azure.mgmt.eventgrid.models.DomainPaged[~azure.mgmt.eventgrid.models.Domain] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DomainPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DomainPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/domains'} + + def list_by_resource_group( + self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List domains under a resource group. + + List all the domains under a resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Domain + :rtype: + ~azure.mgmt.eventgrid.models.DomainPaged[~azure.mgmt.eventgrid.models.Domain] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DomainPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DomainPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains'} + + def list_shared_access_keys( + self, resource_group_name, domain_name, custom_headers=None, raw=False, **operation_config): + """List keys for a domain. + + List the two keys used to publish to a domain. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DomainSharedAccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.DomainSharedAccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_shared_access_keys.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DomainSharedAccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_shared_access_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/listKeys'} + + def regenerate_key( + self, resource_group_name, domain_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerate key for a domain. + + Regenerate a shared access key for a domain. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the domain. + :type domain_name: str + :param key_name: Key name to regenerate key1 or key2. + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DomainSharedAccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.DomainSharedAccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key_request = models.DomainRegenerateKeyRequest(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(regenerate_key_request, 'DomainRegenerateKeyRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DomainSharedAccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/regenerateKey'} diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py new file mode 100644 index 000000000000..569bcfaf9159 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py @@ -0,0 +1,1421 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class EventSubscriptionsOperations(object): + """EventSubscriptionsOperations operations. + + :param client: Client for service requests. + :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: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def get( + self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get an event subscription. + + Get properties of an event subscription. + + :param scope: The scope of the event subscription. The scope can be a + subscription, or a resource group, or a top level resource belonging + to a resource provider namespace, or an EventGrid topic. For example, + use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription. + :type event_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventSubscription or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.EventSubscription or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} + + + def _create_or_update_initial( + self, scope, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(event_subscription_info, 'EventSubscription') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, scope, event_subscription_name, event_subscription_info, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update an event subscription. + + Asynchronously creates a new event subscription or updates an existing + event subscription based on the specified scope. + + :param scope: The identifier of the resource to which the event + subscription needs to be created or updated. The scope can be a + subscription, or a resource group, or a top level resource belonging + to a resource provider namespace, or an EventGrid topic. For example, + use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription. Event + subscription names must be between 3 and 64 characters in length and + should use alphanumeric letters only. + :type event_subscription_name: str + :param event_subscription_info: Event subscription properties + containing the destination and filter information. + :type event_subscription_info: + ~azure.mgmt.eventgrid.models.EventSubscription + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns EventSubscription or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.EventSubscription]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + scope=scope, + event_subscription_name=event_subscription_name, + event_subscription_info=event_subscription_info, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} + + + def _delete_initial( + self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, scope, event_subscription_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete an event subscription. + + Delete an existing event subscription. + + :param scope: The scope of the event subscription. The scope can be a + subscription, or a resource group, or a top level resource belonging + to a resource provider namespace, or an EventGrid topic. For example, + use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription. + :type event_subscription_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + scope=scope, + event_subscription_name=event_subscription_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} + + + def _update_initial( + self, scope, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(event_subscription_update_parameters, 'EventSubscriptionUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, scope, event_subscription_name, event_subscription_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Update an event subscription. + + Asynchronously updates an existing event subscription. + + :param scope: The scope of existing event subscription. The scope can + be a subscription, or a resource group, or a top level resource + belonging to a resource provider namespace, or an EventGrid topic. For + example, use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription to be + updated. + :type event_subscription_name: str + :param event_subscription_update_parameters: Updated event + subscription information. + :type event_subscription_update_parameters: + ~azure.mgmt.eventgrid.models.EventSubscriptionUpdateParameters + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns EventSubscription or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.EventSubscription] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.EventSubscription]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + scope=scope, + event_subscription_name=event_subscription_name, + event_subscription_update_parameters=event_subscription_update_parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EventSubscription', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}'} + + def get_full_url( + self, scope, event_subscription_name, custom_headers=None, raw=False, **operation_config): + """Get full URL of an event subscription. + + Get the full endpoint URL for an event subscription. + + :param scope: The scope of the event subscription. The scope can be a + subscription, or a resource group, or a top level resource belonging + to a resource provider namespace, or an EventGrid topic. For example, + use '/subscriptions/{subscriptionId}/' for a subscription, + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' + for a resource group, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}' + for a resource, and + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}' + for an EventGrid topic. + :type scope: str + :param event_subscription_name: Name of the event subscription. + :type event_subscription_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EventSubscriptionFullUrl or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.EventSubscriptionFullUrl or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get_full_url.metadata['url'] + path_format_arguments = { + 'scope': self._serialize.url("scope", scope, 'str', skip_quote=True), + 'eventSubscriptionName': self._serialize.url("event_subscription_name", event_subscription_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('EventSubscriptionFullUrl', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_full_url.metadata = {'url': '/{scope}/providers/Microsoft.EventGrid/eventSubscriptions/{eventSubscriptionName}/getFullUrl'} + + def list_global_by_subscription( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """Get an aggregated list of all global event subscriptions under an Azure + subscription. + + List all aggregated global event subscriptions under a specific Azure + subscription. + + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_global_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_global_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/eventSubscriptions'} + + def list_global_by_subscription_for_topic_type( + self, topic_type_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all global event subscriptions for a topic type. + + List all global event subscriptions under an Azure subscription for a + topic type. + + :param topic_type_name: Name of the topic type. + :type topic_type_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_global_by_subscription_for_topic_type.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_global_by_subscription_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'} + + def list_global_by_resource_group( + self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all global event subscriptions under an Azure subscription and + resource group. + + List all global event subscriptions under a specific Azure subscription + and resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_global_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_global_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/eventSubscriptions'} + + def list_global_by_resource_group_for_topic_type( + self, resource_group_name, topic_type_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all global event subscriptions under a resource group for a topic + type. + + List all global event subscriptions under a resource group for a + specific topic type. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_type_name: Name of the topic type. + :type topic_type_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_global_by_resource_group_for_topic_type.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_global_by_resource_group_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventSubscriptions'} + + def list_regional_by_subscription( + self, location, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all regional event subscriptions under an Azure subscription. + + List all event subscriptions from the given location under a specific + Azure subscription. + + :param location: Name of the location. + :type location: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_regional_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_regional_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'} + + def list_regional_by_resource_group( + self, resource_group_name, location, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all regional event subscriptions under an Azure subscription and + resource group. + + List all event subscriptions from the given location under a specific + Azure subscription and resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param location: Name of the location. + :type location: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_regional_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_regional_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/eventSubscriptions'} + + def list_regional_by_subscription_for_topic_type( + self, location, topic_type_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all regional event subscriptions under an Azure subscription for a + topic type. + + List all event subscriptions from the given location under a specific + Azure subscription and topic type. + + :param location: Name of the location. + :type location: str + :param topic_type_name: Name of the topic type. + :type topic_type_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_regional_by_subscription_for_topic_type.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_regional_by_subscription_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'} + + def list_regional_by_resource_group_for_topic_type( + self, resource_group_name, location, topic_type_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all regional event subscriptions under an Azure subscription and + resource group for a topic type. + + List all event subscriptions from the given location under a specific + Azure subscription and resource group and topic type. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param location: Name of the location. + :type location: str + :param topic_type_name: Name of the topic type. + :type topic_type_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_regional_by_resource_group_for_topic_type.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_regional_by_resource_group_for_topic_type.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/locations/{location}/topicTypes/{topicTypeName}/eventSubscriptions'} + + def list_by_resource( + self, resource_group_name, provider_namespace, resource_type_name, resource_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all event subscriptions for a specific topic. + + List all event subscriptions that have been created for a specific + topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param provider_namespace: Namespace of the provider of the topic. + :type provider_namespace: str + :param resource_type_name: Name of the resource type. + :type resource_type_name: str + :param resource_name: Name of the resource. + :type resource_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'providerNamespace': self._serialize.url("provider_namespace", provider_namespace, 'str'), + 'resourceTypeName': self._serialize.url("resource_type_name", resource_type_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventSubscriptions'} + + def list_by_domain_topic( + self, resource_group_name, domain_name, topic_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List all event subscriptions for a specific domain topic. + + List all event subscriptions that have been created for a specific + domain topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param domain_name: Name of the top level domain. + :type domain_name: str + :param topic_name: Name of the domain topic. + :type topic_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventSubscription + :rtype: + ~azure.mgmt.eventgrid.models.EventSubscriptionPaged[~azure.mgmt.eventgrid.models.EventSubscription] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_domain_topic.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'domainName': self._serialize.url("domain_name", domain_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventSubscriptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_domain_topic.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/providers/Microsoft.EventGrid/eventSubscriptions'} diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py new file mode 100644 index 000000000000..8b96334cfa65 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py @@ -0,0 +1,101 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :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: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List available operations. + + List the available operations supported by the Microsoft.EventGrid + resource provider. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.eventgrid.models.OperationPaged[~azure.mgmt.eventgrid.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.EventGrid/operations'} diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py new file mode 100644 index 000000000000..a3c8825d49d3 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py @@ -0,0 +1,228 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TopicTypesOperations(object): + """TopicTypesOperations operations. + + :param client: Client for service requests. + :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: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List topic types. + + List all registered topic types. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TopicTypeInfo + :rtype: + ~azure.mgmt.eventgrid.models.TopicTypeInfoPaged[~azure.mgmt.eventgrid.models.TopicTypeInfo] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TopicTypeInfoPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TopicTypeInfoPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes'} + + def get( + self, topic_type_name, custom_headers=None, raw=False, **operation_config): + """Get a topic type. + + Get information about a topic type. + + :param topic_type_name: Name of the topic type. + :type topic_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TopicTypeInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.TopicTypeInfo or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TopicTypeInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}'} + + def list_event_types( + self, topic_type_name, custom_headers=None, raw=False, **operation_config): + """List event types. + + List event types for a topic type. + + :param topic_type_name: Name of the topic type. + :type topic_type_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventType + :rtype: + ~azure.mgmt.eventgrid.models.EventTypePaged[~azure.mgmt.eventgrid.models.EventType] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_event_types.metadata['url'] + path_format_arguments = { + 'topicTypeName': self._serialize.url("topic_type_name", topic_type_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventTypePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventTypePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_event_types.metadata = {'url': '/providers/Microsoft.EventGrid/topicTypes/{topicTypeName}/eventTypes'} diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py new file mode 100644 index 000000000000..cd872c8e9cd7 --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py @@ -0,0 +1,789 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class TopicsOperations(object): + """TopicsOperations operations. + + :param client: Client for service requests. + :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: "2019-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def get( + self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): + """Get a topic. + + Get properties of a topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic. + :type topic_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Topic or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.Topic or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} + + + 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) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(topic_info, 'Topic') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, topic_name, location, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a topic. + + Asynchronously creates a new topic with the specified parameters. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :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 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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Topic or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Topic] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.Topic]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + topic_name=topic_name, + location=location, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} + + + def _delete_initial( + self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, topic_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Delete a topic. + + Delete existing topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic. + :type topic_name: str + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + topic_name=topic_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} + + + def _update_initial( + self, resource_group_name, topic_name, tags=None, custom_headers=None, raw=False, **operation_config): + topic_update_parameters = models.TopicUpdateParameters(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(topic_update_parameters, 'TopicUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, topic_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Update a topic. + + Asynchronously updates a topic with the specified parameters. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic. + :type topic_name: str + :param tags: Tags of the resource + :type tags: dict[str, str] + :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 + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Topic or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.eventgrid.models.Topic] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.eventgrid.models.Topic]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + topic_name=topic_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Topic', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'} + + def list_by_subscription( + self, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List topics under an Azure subscription. + + List all the topics under an Azure subscription. + + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Topic + :rtype: + ~azure.mgmt.eventgrid.models.TopicPaged[~azure.mgmt.eventgrid.models.Topic] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TopicPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TopicPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/topics'} + + def list_by_resource_group( + self, resource_group_name, filter=None, top=None, custom_headers=None, raw=False, **operation_config): + """List topics under a resource group. + + List all the topics under a resource group. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param filter: The query used to filter the search results using OData + syntax. Filtering is permitted on the 'name' property only and with + limited number of OData operations. These operations are: the + 'contains' function as well as the following logical operations: not, + and, or, eq (for equal), and ne (for not equal). No arithmetic + operations are supported. The following is a valid filter example: + $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The + following is not a valid filter example: $filter=location eq 'westus'. + :type filter: str + :param top: The number of results to return per page for the list + operation. Valid range for top parameter is 1 to 100. If not + specified, the default number of results to be returned is 20 items + per page. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Topic + :rtype: + ~azure.mgmt.eventgrid.models.TopicPaged[~azure.mgmt.eventgrid.models.Topic] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.TopicPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.TopicPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics'} + + def list_shared_access_keys( + self, resource_group_name, topic_name, custom_headers=None, raw=False, **operation_config): + """List keys for a topic. + + List the two keys used to publish to a topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic. + :type topic_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TopicSharedAccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.TopicSharedAccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_shared_access_keys.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TopicSharedAccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_shared_access_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/listKeys'} + + def regenerate_key( + self, resource_group_name, topic_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerate key for a topic. + + Regenerate a shared access key for a topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param topic_name: Name of the topic. + :type topic_name: str + :param key_name: Key name to regenerate key1 or key2 + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TopicSharedAccessKeys or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.eventgrid.models.TopicSharedAccessKeys or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + regenerate_key_request = models.TopicRegenerateKeyRequest(key_name=key_name) + + # Construct URL + url = self.regenerate_key.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'topicName': self._serialize.url("topic_name", topic_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(regenerate_key_request, 'TopicRegenerateKeyRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('TopicSharedAccessKeys', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/regenerateKey'} + + def list_event_types( + self, resource_group_name, provider_namespace, resource_type_name, resource_name, custom_headers=None, raw=False, **operation_config): + """List topic event types. + + List event types for a topic. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param provider_namespace: Namespace of the provider of the topic. + :type provider_namespace: str + :param resource_type_name: Name of the topic type. + :type resource_type_name: str + :param resource_name: Name of the topic. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EventType + :rtype: + ~azure.mgmt.eventgrid.models.EventTypePaged[~azure.mgmt.eventgrid.models.EventType] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_event_types.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'providerNamespace': self._serialize.url("provider_namespace", provider_namespace, 'str'), + 'resourceTypeName': self._serialize.url("resource_type_name", resource_type_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.EventTypePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EventTypePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_event_types.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerNamespace}/{resourceTypeName}/{resourceName}/providers/Microsoft.EventGrid/eventTypes'} diff --git a/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/version.py b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/version.py new file mode 100644 index 000000000000..a39916c162ce --- /dev/null +++ b/sdk/azure-mgmt-eventgrid/azure/mgmt/eventgrid/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0" +