diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py index b5a272315294..b0378dea2479 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/event_grid_management_client.py @@ -13,6 +13,8 @@ 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 @@ -60,6 +62,10 @@ class EventGridManagementClient(SDKClient): :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 @@ -86,10 +92,14 @@ def __init__( super(EventGridManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2018-05-01-preview' + self.api_version = '2018-09-15-preview' 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( diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py index 633b89b64252..9a4da95511c0 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/__init__.py @@ -10,12 +10,31 @@ # -------------------------------------------------------------------------- try: + from .input_schema_mapping_py3 import InputSchemaMapping + 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 .resource_py3 import Resource + 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 @@ -25,7 +44,6 @@ from .event_subscription_full_url_py3 import EventSubscriptionFullUrl from .operation_info_py3 import OperationInfo from .operation_py3 import Operation - from .input_schema_mapping_py3 import InputSchemaMapping from .json_field_py3 import JsonField from .json_field_with_default_py3 import JsonFieldWithDefault from .json_input_schema_mapping_py3 import JsonInputSchemaMapping @@ -37,12 +55,31 @@ from .event_type_py3 import EventType from .topic_type_info_py3 import TopicTypeInfo except (SyntaxError, ImportError): + from .input_schema_mapping import InputSchemaMapping + 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 .resource import Resource + 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 @@ -52,7 +89,6 @@ from .event_subscription_full_url import EventSubscriptionFullUrl from .operation_info import OperationInfo from .operation import Operation - from .input_schema_mapping import InputSchemaMapping from .json_field import JsonField from .json_field_with_default import JsonFieldWithDefault from .json_input_schema_mapping import JsonInputSchemaMapping @@ -63,27 +99,49 @@ 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, + InputSchema, EventSubscriptionProvisioningState, EventDeliverySchema, TopicProvisioningState, - InputSchema, ResourceRegionType, TopicTypeProvisioningState, ) __all__ = [ + 'InputSchemaMapping', + 'Domain', + 'DomainUpdateParameters', + 'DomainSharedAccessKeys', + 'DomainRegenerateKeyRequest', + 'DomainTopic', 'EventSubscriptionDestination', + 'AdvancedFilter', 'EventSubscriptionFilter', 'RetryPolicy', 'DeadLetterDestination', 'Resource', + 'NumberInAdvancedFilter', 'StorageBlobDeadLetterDestination', + 'NumberNotInAdvancedFilter', + 'NumberLessThanAdvancedFilter', + 'NumberGreaterThanAdvancedFilter', + 'NumberLessThanOrEqualsAdvancedFilter', + 'NumberGreaterThanOrEqualsAdvancedFilter', + 'BoolEqualsAdvancedFilter', + 'StringInAdvancedFilter', + 'StringNotInAdvancedFilter', + 'StringBeginsWithAdvancedFilter', + 'StringEndsWithAdvancedFilter', + 'StringContainsAdvancedFilter', 'WebHookEventSubscriptionDestination', 'EventHubEventSubscriptionDestination', 'StorageQueueEventSubscriptionDestination', @@ -93,7 +151,6 @@ 'EventSubscriptionFullUrl', 'OperationInfo', 'Operation', - 'InputSchemaMapping', 'JsonField', 'JsonFieldWithDefault', 'JsonInputSchemaMapping', @@ -104,15 +161,18 @@ 'TopicRegenerateKeyRequest', 'EventType', 'TopicTypeInfo', + 'DomainPaged', + 'DomainTopicPaged', 'EventSubscriptionPaged', 'OperationPaged', 'TopicPaged', 'EventTypePaged', 'TopicTypeInfoPaged', + 'DomainProvisioningState', + 'InputSchema', 'EventSubscriptionProvisioningState', 'EventDeliverySchema', 'TopicProvisioningState', - 'InputSchema', 'ResourceRegionType', 'TopicTypeProvisioningState', ] diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter.py new file mode 100644 index 000000000000..0b166b4a1015 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter.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 msrest.serialization import Model + + +class AdvancedFilter(Model): + """Represents an advanced filter that can be used to filter events based on + various event envelope/data fields. + + 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 filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter_py3.py new file mode 100644 index 000000000000..1330bddfa4fa --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/advanced_filter_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 msrest.serialization import Model + + +class AdvancedFilter(Model): + """Represents an advanced filter that can be used to filter events based on + various event envelope/data fields. + + 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 filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter.py new file mode 100644 index 000000000000..ac55b0091505 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The 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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/bool_equals_advanced_filter_py3.py new file mode 100644 index 000000000000..c648cc1db73f --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :type key: str + :param operator_type: Required. Constant filled by server. + :type operator_type: str + :param value: The 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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain.py new file mode 100644 index 000000000000..868394ac75f0 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain.py @@ -0,0 +1,76 @@ +# 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 + :param input_schema: This determines the format that Event Grid should + expect for incoming events published to the domain. Possible values + include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema' + :type input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema + :param input_schema_mapping: Information about the InputSchemaMapping + which specified the info about mapping event payload. + :type input_schema_mapping: + ~azure.mgmt.eventgrid.models.InputSchemaMapping + """ + + _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'}, + 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, + 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, + } + + def __init__(self, **kwargs): + super(Domain, self).__init__(**kwargs) + self.provisioning_state = None + self.endpoint = None + self.input_schema = kwargs.get('input_schema', None) + self.input_schema_mapping = kwargs.get('input_schema_mapping', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_paged.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_paged.py new file mode 100644 index 000000000000..ed7fa29c5786 --- /dev/null +++ b/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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_py3.py new file mode 100644 index 000000000000..3ad4d5ed9b64 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_py3.py @@ -0,0 +1,76 @@ +# 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 + :param input_schema: This determines the format that Event Grid should + expect for incoming events published to the domain. Possible values + include: 'EventGridSchema', 'CustomEventSchema', 'CloudEventV01Schema' + :type input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema + :param input_schema_mapping: Information about the InputSchemaMapping + which specified the info about mapping event payload. + :type input_schema_mapping: + ~azure.mgmt.eventgrid.models.InputSchemaMapping + """ + + _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'}, + 'input_schema': {'key': 'properties.inputSchema', 'type': 'str'}, + 'input_schema_mapping': {'key': 'properties.inputSchemaMapping', 'type': 'InputSchemaMapping'}, + } + + def __init__(self, *, location: str, tags=None, input_schema=None, input_schema_mapping=None, **kwargs) -> None: + super(Domain, self).__init__(location=location, tags=tags, **kwargs) + self.provisioning_state = None + self.endpoint = None + self.input_schema = input_schema + self.input_schema_mapping = input_schema_mapping diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request.py new file mode 100644 index 000000000000..cacf0e74fb26 --- /dev/null +++ b/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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_regenerate_key_request_py3.py new file mode 100644 index 000000000000..9d024c87c0c6 --- /dev/null +++ b/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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys.py new file mode 100644 index 000000000000..d04032da4981 --- /dev/null +++ b/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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_shared_access_keys_py3.py new file mode 100644 index 000000000000..2c13d4ab0367 --- /dev/null +++ b/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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic.py new file mode 100644 index 000000000000..df6ae9d607d4 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic.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 .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 + """ + + _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(DomainTopic, self).__init__(**kwargs) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_paged.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_paged.py new file mode 100644 index 000000000000..b5f599064d3e --- /dev/null +++ b/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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_py3.py new file mode 100644 index 000000000000..04e31b7eae80 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_topic_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 .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 + """ + + _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(DomainTopic, self).__init__(**kwargs) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters.py new file mode 100644 index 000000000000..1bc4fca2bc30 --- /dev/null +++ b/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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/domain_update_parameters_py3.py new file mode 100644 index 000000000000..f876c6e4adbd --- /dev/null +++ b/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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py index 3a265b2304c5..2c766d90cdb4 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_grid_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class EventSubscriptionProvisioningState(str, Enum): +class DomainProvisioningState(str, Enum): creating = "Creating" updating = "Updating" @@ -20,17 +20,16 @@ class EventSubscriptionProvisioningState(str, Enum): succeeded = "Succeeded" canceled = "Canceled" failed = "Failed" - awaiting_manual_action = "AwaitingManualAction" -class EventDeliverySchema(str, Enum): +class InputSchema(str, Enum): event_grid_schema = "EventGridSchema" - input_event_schema = "InputEventSchema" + custom_event_schema = "CustomEventSchema" cloud_event_v01_schema = "CloudEventV01Schema" -class TopicProvisioningState(str, Enum): +class EventSubscriptionProvisioningState(str, Enum): creating = "Creating" updating = "Updating" @@ -38,13 +37,24 @@ class TopicProvisioningState(str, Enum): succeeded = "Succeeded" canceled = "Canceled" failed = "Failed" + awaiting_manual_action = "AwaitingManualAction" -class InputSchema(str, Enum): +class EventDeliverySchema(str, Enum): event_grid_schema = "EventGridSchema" - custom_event_schema = "CustomEventSchema" cloud_event_v01_schema = "CloudEventV01Schema" + custom_input_schema = "CustomInputSchema" + + +class TopicProvisioningState(str, Enum): + + creating = "Creating" + updating = "Updating" + deleting = "Deleting" + succeeded = "Succeeded" + canceled = "Canceled" + failed = "Failed" class ResourceRegionType(str, Enum): diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py index 6e7fb83355d4..fb5f0a3419ce 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription.py @@ -39,10 +39,11 @@ class EventSubscription(Resource): :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 event_delivery_schema: The event delivery schema for the event subscription. Possible values include: 'EventGridSchema', - 'InputEventSchema', 'CloudEventV01Schema'. Default value: - "InputEventSchema" . + 'CloudEventV01Schema', 'CustomInputSchema' :type event_delivery_schema: str or ~azure.mgmt.eventgrid.models.EventDeliverySchema :param retry_policy: The retry policy for events. This can be used to @@ -71,6 +72,7 @@ class EventSubscription(Resource): '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'}, 'event_delivery_schema': {'key': 'properties.eventDeliverySchema', 'type': 'str'}, 'retry_policy': {'key': 'properties.retryPolicy', 'type': 'RetryPolicy'}, 'dead_letter_destination': {'key': 'properties.deadLetterDestination', 'type': 'DeadLetterDestination'}, @@ -83,6 +85,7 @@ def __init__(self, **kwargs): self.destination = kwargs.get('destination', None) self.filter = kwargs.get('filter', None) self.labels = kwargs.get('labels', None) - self.event_delivery_schema = kwargs.get('event_delivery_schema', "InputEventSchema") + self.expiration_time_utc = kwargs.get('expiration_time_utc', None) + self.event_delivery_schema = kwargs.get('event_delivery_schema', None) self.retry_policy = kwargs.get('retry_policy', None) self.dead_letter_destination = kwargs.get('dead_letter_destination', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter.py index 0b2466b19281..df5e5050e604 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter.py @@ -33,6 +33,8 @@ class EventSubscriptionFilter(Model): 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: A list of advanced filters. + :type advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter] """ _attribute_map = { @@ -40,6 +42,7 @@ class EventSubscriptionFilter(Model): '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): @@ -48,3 +51,4 @@ def __init__(self, **kwargs): 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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter_py3.py index cc9ddbce65d2..16c946cd2363 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter_py3.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_filter_py3.py @@ -33,6 +33,8 @@ class EventSubscriptionFilter(Model): 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: A list of advanced filters. + :type advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter] """ _attribute_map = { @@ -40,11 +42,13 @@ class EventSubscriptionFilter(Model): '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, **kwargs) -> None: + 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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py index 59cb87e4c9f5..246622ce3702 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_py3.py @@ -39,10 +39,11 @@ class EventSubscription(Resource): :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 event_delivery_schema: The event delivery schema for the event subscription. Possible values include: 'EventGridSchema', - 'InputEventSchema', 'CloudEventV01Schema'. Default value: - "InputEventSchema" . + 'CloudEventV01Schema', 'CustomInputSchema' :type event_delivery_schema: str or ~azure.mgmt.eventgrid.models.EventDeliverySchema :param retry_policy: The retry policy for events. This can be used to @@ -71,18 +72,20 @@ class EventSubscription(Resource): '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'}, 'event_delivery_schema': {'key': 'properties.eventDeliverySchema', 'type': 'str'}, 'retry_policy': {'key': 'properties.retryPolicy', 'type': 'RetryPolicy'}, 'dead_letter_destination': {'key': 'properties.deadLetterDestination', 'type': 'DeadLetterDestination'}, } - def __init__(self, *, destination=None, filter=None, labels=None, event_delivery_schema="InputEventSchema", retry_policy=None, dead_letter_destination=None, **kwargs) -> None: + def __init__(self, *, destination=None, filter=None, labels=None, expiration_time_utc=None, event_delivery_schema=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.event_delivery_schema = event_delivery_schema self.retry_policy = retry_policy self.dead_letter_destination = dead_letter_destination diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py index 07b295319084..5371a06679cc 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters.py @@ -23,9 +23,12 @@ class EventSubscriptionUpdateParameters(Model): :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 event_delivery_schema: The event delivery schema for the event subscription. Possible values include: 'EventGridSchema', - 'InputEventSchema', 'CloudEventV01Schema' + 'CloudEventV01Schema', 'CustomInputSchema' :type event_delivery_schema: str or ~azure.mgmt.eventgrid.models.EventDeliverySchema :param retry_policy: The retry policy for events. This can be used to @@ -41,6 +44,7 @@ class EventSubscriptionUpdateParameters(Model): 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, 'filter': {'key': 'filter', 'type': 'EventSubscriptionFilter'}, 'labels': {'key': 'labels', 'type': '[str]'}, + 'expiration_time_utc': {'key': 'expirationTimeUtc', 'type': 'iso-8601'}, 'event_delivery_schema': {'key': 'eventDeliverySchema', 'type': 'str'}, 'retry_policy': {'key': 'retryPolicy', 'type': 'RetryPolicy'}, 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, @@ -51,6 +55,7 @@ def __init__(self, **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.event_delivery_schema = kwargs.get('event_delivery_schema', None) self.retry_policy = kwargs.get('retry_policy', None) self.dead_letter_destination = kwargs.get('dead_letter_destination', None) diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py index f88ad534e83f..3f415aa3e8cb 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/event_subscription_update_parameters_py3.py @@ -23,9 +23,12 @@ class EventSubscriptionUpdateParameters(Model): :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 event_delivery_schema: The event delivery schema for the event subscription. Possible values include: 'EventGridSchema', - 'InputEventSchema', 'CloudEventV01Schema' + 'CloudEventV01Schema', 'CustomInputSchema' :type event_delivery_schema: str or ~azure.mgmt.eventgrid.models.EventDeliverySchema :param retry_policy: The retry policy for events. This can be used to @@ -41,16 +44,18 @@ class EventSubscriptionUpdateParameters(Model): 'destination': {'key': 'destination', 'type': 'EventSubscriptionDestination'}, 'filter': {'key': 'filter', 'type': 'EventSubscriptionFilter'}, 'labels': {'key': 'labels', 'type': '[str]'}, + 'expiration_time_utc': {'key': 'expirationTimeUtc', 'type': 'iso-8601'}, 'event_delivery_schema': {'key': 'eventDeliverySchema', 'type': 'str'}, 'retry_policy': {'key': 'retryPolicy', 'type': 'RetryPolicy'}, 'dead_letter_destination': {'key': 'deadLetterDestination', 'type': 'DeadLetterDestination'}, } - def __init__(self, *, destination=None, filter=None, labels=None, event_delivery_schema=None, retry_policy=None, dead_letter_destination=None, **kwargs) -> None: + def __init__(self, *, destination=None, filter=None, labels=None, expiration_time_utc=None, event_delivery_schema=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.event_delivery_schema = event_delivery_schema self.retry_policy = retry_policy self.dead_letter_destination = dead_letter_destination diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter.py new file mode 100644 index 000000000000..d613515b9528 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_advanced_filter_py3.py new file mode 100644 index 000000000000..29a878af007f --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter.py new file mode 100644 index 000000000000..47e4bf38b609 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_greater_than_or_equals_advanced_filter_py3.py new file mode 100644 index 000000000000..07597f50cf46 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter.py new file mode 100644 index 000000000000..ab5211aa1247 --- /dev/null +++ b/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 filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_in_advanced_filter_py3.py new file mode 100644 index 000000000000..5358d30a87df --- /dev/null +++ b/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 filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter.py new file mode 100644 index 000000000000..f2f24e157e32 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_advanced_filter_py3.py new file mode 100644 index 000000000000..f1e2d64c692f --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter.py new file mode 100644 index 000000000000..fc563b5f1480 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_less_than_or_equals_advanced_filter_py3.py new file mode 100644 index 000000000000..d0cb3a127cec --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter.py new file mode 100644 index 000000000000..790f5f48697f --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter_py3.py new file mode 100644 index 000000000000..8fa0af24af0e --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter.py new file mode 100644 index 000000000000..a6d1f91f8eaa --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_begins_with_advanced_filter_py3.py new file mode 100644 index 000000000000..4b33c1bf1bd1 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter.py new file mode 100644 index 000000000000..04667aeeb31d --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_contains_advanced_filter_py3.py new file mode 100644 index 000000000000..53b7a530d9ed --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter.py new file mode 100644 index 000000000000..8413d1ae330d --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_ends_with_advanced_filter_py3.py new file mode 100644 index 000000000000..47b469c98e79 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter.py new file mode 100644 index 000000000000..52b480d90433 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_in_advanced_filter_py3.py new file mode 100644 index 000000000000..1da9dc34ac6b --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter.py new file mode 100644 index 000000000000..0621f0f9dfc4 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter_py3.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/string_not_in_advanced_filter_py3.py new file mode 100644 index 000000000000..d115f4c12266 --- /dev/null +++ b/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 Filter. + + All required parameters must be populated in order to send to Azure. + + :param key: The filter key. Represents an event property with upto two + levels of nesting. + :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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/__init__.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/__init__.py index db9b4311e47c..809a02494719 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/__init__.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/__init__.py @@ -9,12 +9,16 @@ # 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', diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domain_topics_operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domain_topics_operations.py new file mode 100644 index 000000000000..8c89845989e1 --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domain_topics_operations.py @@ -0,0 +1,179 @@ +# 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 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: "2018-09-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-15-preview" + + self.config = config + + def get( + self, resource_group_name, domain_name, 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 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: 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'), + '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('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/{topicName}'} + + def list_by_domain( + self, resource_group_name, domain_name, 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 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') + + 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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py new file mode 100644 index 000000000000..f7f9bd42690d --- /dev/null +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/domains_operations.py @@ -0,0 +1,669 @@ +# 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: "2018-09-15-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-09-15-preview" + + 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, domain_info, 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') + } + 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, domain_info, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a domain. + + Asynchronously creates 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 domain_info: Domain information + :type domain_info: ~azure.mgmt.eventgrid.models.Domain + :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, + domain_info=domain_info, + 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, custom_headers=None, raw=False, **operation_config): + """List domains under an Azure subscription. + + List all the domains under an Azure subscription. + + :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') + + 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, 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 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') + + 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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py index 413ca68989b7..e0babad2bffc 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/event_subscriptions_operations.py @@ -25,7 +25,7 @@ class EventSubscriptionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-09-15-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-05-01-preview" + self.api_version = "2018-09-15-preview" self.config = config @@ -1162,3 +1162,80 @@ def internal_paging(next_link=None, raw=False): 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, 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 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') + + 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/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py index dc9600e337bb..d7e84f37b171 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-09-15-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-05-01-preview" + self.api_version = "2018-09-15-preview" self.config = config diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py index ab63c82604f6..a1bb6fb80e13 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topic_types_operations.py @@ -23,7 +23,7 @@ class TopicTypesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-09-15-preview". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-05-01-preview" + self.api_version = "2018-09-15-preview" self.config = config diff --git a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py index 9b739c76d128..7c58f7ef1a5a 100644 --- a/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py +++ b/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/topics_operations.py @@ -25,7 +25,7 @@ class TopicsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-05-01-preview". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-09-15-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-05-01-preview" + self.api_version = "2018-09-15-preview" self.config = config