From 51b511f3790b42bb37e96b9bc961673791a98478 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 17 Jan 2020 05:08:46 +0000 Subject: [PATCH] Generated from 743fe428402054a1d35ba99da95e97a8f2ee7cd5 fix prettier checks on examples & evergrid swagger --- .../azure/mgmt/eventgrid/models/_models.py | 36 ++++++++++++--- .../mgmt/eventgrid/models/_models_py3.py | 44 ++++++++++++++----- .../operations/_domains_operations.py | 13 +++--- .../operations/_topic_types_operations.py | 2 +- .../operations/_topics_operations.py | 13 +++--- 5 files changed, 77 insertions(+), 31 deletions(-) diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models.py b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models.py index 974bf4c7b8ab..a5cd04e53aaf 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models.py +++ b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models.py @@ -307,8 +307,8 @@ class Domain(TrackedResource): which specified the info about mapping event payload. :type input_schema_mapping: ~azure.mgmt.eventgrid.models.InputSchemaMapping - :param metric_resource_id: Metric resource id for the domain. - :type metric_resource_id: str + :ivar metric_resource_id: Metric resource id for the domain. + :vartype metric_resource_id: str :param allow_traffic_from_all_ips: This determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. @@ -325,6 +325,7 @@ class Domain(TrackedResource): 'location': {'required': True}, 'provisioning_state': {'readonly': True}, 'endpoint': {'readonly': True}, + 'metric_resource_id': {'readonly': True}, } _attribute_map = { @@ -348,7 +349,7 @@ def __init__(self, **kwargs): self.endpoint = None self.input_schema = kwargs.get('input_schema', "EventGridSchema") self.input_schema_mapping = kwargs.get('input_schema_mapping', None) - self.metric_resource_id = kwargs.get('metric_resource_id', None) + self.metric_resource_id = None self.allow_traffic_from_all_ips = kwargs.get('allow_traffic_from_all_ips', None) self.inbound_ip_rules = kwargs.get('inbound_ip_rules', None) @@ -437,15 +438,26 @@ class DomainUpdateParameters(Model): :param tags: Tags of the domains resource :type tags: dict[str, str] + :param allow_traffic_from_all_ips: This determines if IP filtering rules + ought to be evaluated or not. By default it will not evaluate and will + allow traffic from all IPs. + :type allow_traffic_from_all_ips: bool + :param inbound_ip_rules: This determines the IP filtering rules that ought + be applied when events are received on this domain. + :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'allow_traffic_from_all_ips': {'key': 'allowTrafficFromAllIPs', 'type': 'bool'}, + 'inbound_ip_rules': {'key': 'inboundIpRules', 'type': '[InboundIpRule]'}, } def __init__(self, **kwargs): super(DomainUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.allow_traffic_from_all_ips = kwargs.get('allow_traffic_from_all_ips', None) + self.inbound_ip_rules = kwargs.get('inbound_ip_rules', None) class EventHubEventSubscriptionDestination(EventSubscriptionDestination): @@ -1456,8 +1468,8 @@ class Topic(TrackedResource): schema. :type input_schema_mapping: ~azure.mgmt.eventgrid.models.InputSchemaMapping - :param metric_resource_id: Metric resource id for the topic. - :type metric_resource_id: str + :ivar metric_resource_id: Metric resource id for the topic. + :vartype metric_resource_id: str :param allow_traffic_from_all_ips: This determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. @@ -1474,6 +1486,7 @@ class Topic(TrackedResource): 'location': {'required': True}, 'provisioning_state': {'readonly': True}, 'endpoint': {'readonly': True}, + 'metric_resource_id': {'readonly': True}, } _attribute_map = { @@ -1497,7 +1510,7 @@ def __init__(self, **kwargs): self.endpoint = None self.input_schema = kwargs.get('input_schema', "EventGridSchema") self.input_schema_mapping = kwargs.get('input_schema_mapping', None) - self.metric_resource_id = kwargs.get('metric_resource_id', None) + self.metric_resource_id = None self.allow_traffic_from_all_ips = kwargs.get('allow_traffic_from_all_ips', None) self.inbound_ip_rules = kwargs.get('inbound_ip_rules', None) @@ -1613,15 +1626,26 @@ class TopicUpdateParameters(Model): :param tags: Tags of the resource. :type tags: dict[str, str] + :param allow_traffic_from_all_ips: This determines if IP filtering rules + ought to be evaluated or not. By default it will not evaluate and will + allow traffic from all IPs. + :type allow_traffic_from_all_ips: bool + :param inbound_ip_rules: This determines the IP filtering rules that ought + be applied when events are received on this domain. + :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'allow_traffic_from_all_ips': {'key': 'allowTrafficFromAllIPs', 'type': 'bool'}, + 'inbound_ip_rules': {'key': 'inboundIpRules', 'type': '[InboundIpRule]'}, } def __init__(self, **kwargs): super(TopicUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) + self.allow_traffic_from_all_ips = kwargs.get('allow_traffic_from_all_ips', None) + self.inbound_ip_rules = kwargs.get('inbound_ip_rules', None) class WebHookEventSubscriptionDestination(EventSubscriptionDestination): diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models_py3.py b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models_py3.py index 63a61c89c4a5..ffcf536a1600 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models_py3.py +++ b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/_models_py3.py @@ -307,8 +307,8 @@ class Domain(TrackedResource): which specified the info about mapping event payload. :type input_schema_mapping: ~azure.mgmt.eventgrid.models.InputSchemaMapping - :param metric_resource_id: Metric resource id for the domain. - :type metric_resource_id: str + :ivar metric_resource_id: Metric resource id for the domain. + :vartype metric_resource_id: str :param allow_traffic_from_all_ips: This determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. @@ -325,6 +325,7 @@ class Domain(TrackedResource): 'location': {'required': True}, 'provisioning_state': {'readonly': True}, 'endpoint': {'readonly': True}, + 'metric_resource_id': {'readonly': True}, } _attribute_map = { @@ -342,13 +343,13 @@ class Domain(TrackedResource): 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, } - def __init__(self, *, location: str, tags=None, input_schema="EventGridSchema", input_schema_mapping=None, metric_resource_id: str=None, allow_traffic_from_all_ips: bool=None, inbound_ip_rules=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, input_schema="EventGridSchema", input_schema_mapping=None, allow_traffic_from_all_ips: bool=None, inbound_ip_rules=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 - self.metric_resource_id = metric_resource_id + self.metric_resource_id = None self.allow_traffic_from_all_ips = allow_traffic_from_all_ips self.inbound_ip_rules = inbound_ip_rules @@ -437,15 +438,26 @@ class DomainUpdateParameters(Model): :param tags: Tags of the domains resource :type tags: dict[str, str] + :param allow_traffic_from_all_ips: This determines if IP filtering rules + ought to be evaluated or not. By default it will not evaluate and will + allow traffic from all IPs. + :type allow_traffic_from_all_ips: bool + :param inbound_ip_rules: This determines the IP filtering rules that ought + be applied when events are received on this domain. + :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'allow_traffic_from_all_ips': {'key': 'allowTrafficFromAllIPs', 'type': 'bool'}, + 'inbound_ip_rules': {'key': 'inboundIpRules', 'type': '[InboundIpRule]'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__(self, *, tags=None, allow_traffic_from_all_ips: bool=None, inbound_ip_rules=None, **kwargs) -> None: super(DomainUpdateParameters, self).__init__(**kwargs) self.tags = tags + self.allow_traffic_from_all_ips = allow_traffic_from_all_ips + self.inbound_ip_rules = inbound_ip_rules class EventHubEventSubscriptionDestination(EventSubscriptionDestination): @@ -1456,8 +1468,8 @@ class Topic(TrackedResource): schema. :type input_schema_mapping: ~azure.mgmt.eventgrid.models.InputSchemaMapping - :param metric_resource_id: Metric resource id for the topic. - :type metric_resource_id: str + :ivar metric_resource_id: Metric resource id for the topic. + :vartype metric_resource_id: str :param allow_traffic_from_all_ips: This determines if IP filtering rules ought to be evaluated or not. By default it will not evaluate and will allow traffic from all IPs. @@ -1474,6 +1486,7 @@ class Topic(TrackedResource): 'location': {'required': True}, 'provisioning_state': {'readonly': True}, 'endpoint': {'readonly': True}, + 'metric_resource_id': {'readonly': True}, } _attribute_map = { @@ -1491,13 +1504,13 @@ class Topic(TrackedResource): 'inbound_ip_rules': {'key': 'properties.inboundIpRules', 'type': '[InboundIpRule]'}, } - def __init__(self, *, location: str, tags=None, input_schema="EventGridSchema", input_schema_mapping=None, metric_resource_id: str=None, allow_traffic_from_all_ips: bool=None, inbound_ip_rules=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, input_schema="EventGridSchema", input_schema_mapping=None, allow_traffic_from_all_ips: bool=None, inbound_ip_rules=None, **kwargs) -> None: super(Topic, self).__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.endpoint = None self.input_schema = input_schema self.input_schema_mapping = input_schema_mapping - self.metric_resource_id = metric_resource_id + self.metric_resource_id = None self.allow_traffic_from_all_ips = allow_traffic_from_all_ips self.inbound_ip_rules = inbound_ip_rules @@ -1613,15 +1626,26 @@ class TopicUpdateParameters(Model): :param tags: Tags of the resource. :type tags: dict[str, str] + :param allow_traffic_from_all_ips: This determines if IP filtering rules + ought to be evaluated or not. By default it will not evaluate and will + allow traffic from all IPs. + :type allow_traffic_from_all_ips: bool + :param inbound_ip_rules: This determines the IP filtering rules that ought + be applied when events are received on this domain. + :type inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule] """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, + 'allow_traffic_from_all_ips': {'key': 'allowTrafficFromAllIPs', 'type': 'bool'}, + 'inbound_ip_rules': {'key': 'inboundIpRules', 'type': '[InboundIpRule]'}, } - def __init__(self, *, tags=None, **kwargs) -> None: + def __init__(self, *, tags=None, allow_traffic_from_all_ips: bool=None, inbound_ip_rules=None, **kwargs) -> None: super(TopicUpdateParameters, self).__init__(**kwargs) self.tags = tags + self.allow_traffic_from_all_ips = allow_traffic_from_all_ips + self.inbound_ip_rules = inbound_ip_rules class WebHookEventSubscriptionDestination(EventSubscriptionDestination): diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_domains_operations.py b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_domains_operations.py index 47346449d647..47cfdd92a297 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_domains_operations.py +++ b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_domains_operations.py @@ -293,9 +293,7 @@ def get_long_running_output(response): 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) - + self, resource_group_name, domain_name, domain_update_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -344,7 +342,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, domain_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, domain_name, domain_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Update a domain. Asynchronously updates a domain with the specified parameters. @@ -354,8 +352,9 @@ def update( :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 domain_update_parameters: Domain update information. + :type domain_update_parameters: + ~azure.mgmt.eventgrid.models.DomainUpdateParameters :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 @@ -372,7 +371,7 @@ def update( raw_result = self._update_initial( resource_group_name=resource_group_name, domain_name=domain_name, - tags=tags, + domain_update_parameters=domain_update_parameters, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_topic_types_operations.py b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_topic_types_operations.py index dcb730f5a466..c9222e00b384 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_topic_types_operations.py +++ b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_topic_types_operations.py @@ -168,7 +168,7 @@ def list_event_types( List event types for a topic type. - :param topic_type_name: Name of the topic type + :param topic_type_name: Name of the topic type. :type topic_type_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_topics_operations.py b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_topics_operations.py index 75237c439b62..bc4dcd964055 100644 --- a/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_topics_operations.py +++ b/sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/operations/_topics_operations.py @@ -292,9 +292,7 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, topic_name, tags=None, custom_headers=None, raw=False, **operation_config): - topic_update_parameters = models.TopicUpdateParameters(tags=tags) - + self, resource_group_name, topic_name, topic_update_parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -343,7 +341,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, topic_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, topic_name, topic_update_parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Update a topic. Asynchronously updates a topic with the specified parameters. @@ -353,8 +351,9 @@ def update( :type resource_group_name: str :param topic_name: Name of the topic. :type topic_name: str - :param tags: Tags of the resource. - :type tags: dict[str, str] + :param topic_update_parameters: Topic update information. + :type topic_update_parameters: + ~azure.mgmt.eventgrid.models.TopicUpdateParameters :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 @@ -371,7 +370,7 @@ def update( raw_result = self._update_initial( resource_group_name=resource_group_name, topic_name=topic_name, - tags=tags, + topic_update_parameters=topic_update_parameters, custom_headers=custom_headers, raw=True, **operation_config