Skip to content

Commit b506554

Browse files
azclibotSDKAutomsyyc
authored
[AutoRelease] t2-eventgrid-2021-12-11-02977 (#22135)
* CodeGen from PR 16997 in Azure/azure-rest-api-specs Adding missing advanced filters (#16997) * version,CHANGELOG * test * update changelog manually Co-authored-by: SDKAuto <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]> Co-authored-by: msyyc <[email protected]>
1 parent 0c83d21 commit b506554

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+8838
-4746
lines changed

sdk/eventgrid/azure-mgmt-eventgrid/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Release History
22

3+
## 10.1.0 (2021-12-13)
4+
5+
**Features**
6+
7+
- Added model NumberInRangeAdvancedFilter
8+
- Added model StringNotContainsAdvancedFilter
9+
- Added model NumberNotInRangeAdvancedFilter
10+
- Added model IsNullOrUndefinedAdvancedFilter
11+
- Added model IsNotNullAdvancedFilter
12+
- Added model StringNotBeginsWithAdvancedFilter
13+
- Added model StringNotEndsWithAdvancedFilter
14+
315
## 10.0.0 (2021-10-21)
416

517
**Features**
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/[email protected].2"
4+
"@autorest/python@5.12.0",
5+
"@autorest/[email protected].3"
66
],
7-
"commit": "2f9b3758c1308560dd4ca2bebe112e9da9ac227f",
7+
"commit": "f3477bd0a7b6101f9c0af243cc0106c7a8e24c71",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/eventgrid/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/[email protected].2 --version=3.4.5",
9+
"autorest_command": "autorest specification/eventgrid/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
1010
"readme": "specification/eventgrid/resource-manager/readme.md"
1111
}

sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/__init__.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
__version__ = VERSION
1313
__all__ = ['EventGridManagementClient']
1414

15-
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
18-
except ImportError:
19-
pass
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/_configuration.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

@@ -40,11 +40,11 @@ def __init__(
4040
**kwargs # type: Any
4141
):
4242
# type: (...) -> None
43+
super(EventGridManagementClientConfiguration, self).__init__(**kwargs)
4344
if credential is None:
4445
raise ValueError("Parameter 'credential' must not be None.")
4546
if subscription_id is None:
4647
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(EventGridManagementClientConfiguration, self).__init__(**kwargs)
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
@@ -68,4 +68,4 @@ def _configure(
6868
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6969
self.authentication_policy = kwargs.get('authentication_policy')
7070
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
71+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/_event_grid_management_client.py

+54-63
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,22 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9+
from copy import deepcopy
910
from typing import TYPE_CHECKING
1011

1112
from azure.mgmt.core import ARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

15+
from . import models
16+
from ._configuration import EventGridManagementClientConfiguration
17+
from .operations import DomainTopicsOperations, DomainsOperations, EventSubscriptionsOperations, ExtensionTopicsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, SystemTopicEventSubscriptionsOperations, SystemTopicsOperations, TopicTypesOperations, TopicsOperations
18+
1419
if TYPE_CHECKING:
1520
# pylint: disable=unused-import,ungrouped-imports
1621
from typing import Any, Optional
1722

1823
from azure.core.credentials import TokenCredential
19-
from azure.core.pipeline.transport import HttpRequest, HttpResponse
20-
21-
from ._configuration import EventGridManagementClientConfiguration
22-
from .operations import DomainsOperations
23-
from .operations import DomainTopicsOperations
24-
from .operations import EventSubscriptionsOperations
25-
from .operations import SystemTopicEventSubscriptionsOperations
26-
from .operations import Operations
27-
from .operations import TopicsOperations
28-
from .operations import PrivateEndpointConnectionsOperations
29-
from .operations import PrivateLinkResourcesOperations
30-
from .operations import SystemTopicsOperations
31-
from .operations import ExtensionTopicsOperations
32-
from .operations import TopicTypesOperations
33-
from . import models
34-
24+
from azure.core.rest import HttpRequest, HttpResponse
3525

3626
class EventGridManagementClient(object):
3727
"""Azure EventGrid Management Client.
@@ -43,13 +33,15 @@ class EventGridManagementClient(object):
4333
:ivar event_subscriptions: EventSubscriptionsOperations operations
4434
:vartype event_subscriptions: azure.mgmt.eventgrid.operations.EventSubscriptionsOperations
4535
:ivar system_topic_event_subscriptions: SystemTopicEventSubscriptionsOperations operations
46-
:vartype system_topic_event_subscriptions: azure.mgmt.eventgrid.operations.SystemTopicEventSubscriptionsOperations
36+
:vartype system_topic_event_subscriptions:
37+
azure.mgmt.eventgrid.operations.SystemTopicEventSubscriptionsOperations
4738
:ivar operations: Operations operations
4839
:vartype operations: azure.mgmt.eventgrid.operations.Operations
4940
:ivar topics: TopicsOperations operations
5041
:vartype topics: azure.mgmt.eventgrid.operations.TopicsOperations
5142
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
52-
:vartype private_endpoint_connections: azure.mgmt.eventgrid.operations.PrivateEndpointConnectionsOperations
43+
:vartype private_endpoint_connections:
44+
azure.mgmt.eventgrid.operations.PrivateEndpointConnectionsOperations
5345
:ivar private_link_resources: PrivateLinkResourcesOperations operations
5446
:vartype private_link_resources: azure.mgmt.eventgrid.operations.PrivateLinkResourcesOperations
5547
:ivar system_topics: SystemTopicsOperations operations
@@ -60,70 +52,69 @@ class EventGridManagementClient(object):
6052
:vartype topic_types: azure.mgmt.eventgrid.operations.TopicTypesOperations
6153
:param credential: Credential needed for the client to connect to Azure.
6254
:type credential: ~azure.core.credentials.TokenCredential
63-
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
55+
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure
56+
subscription. The subscription ID forms part of the URI for every service call.
6457
:type subscription_id: str
65-
:param str base_url: Service URL
66-
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
58+
:param base_url: Service URL. Default value is 'https://management.azure.com'.
59+
:type base_url: str
60+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
61+
Retry-After header is present.
6762
"""
6863

6964
def __init__(
7065
self,
7166
credential, # type: "TokenCredential"
7267
subscription_id, # type: str
73-
base_url=None, # type: Optional[str]
68+
base_url="https://management.azure.com", # type: str
7469
**kwargs # type: Any
7570
):
7671
# type: (...) -> None
77-
if not base_url:
78-
base_url = 'https://management.azure.com'
79-
self._config = EventGridManagementClientConfiguration(credential, subscription_id, **kwargs)
72+
self._config = EventGridManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
8073
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
8174

8275
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
8376
self._serialize = Serializer(client_models)
84-
self._serialize.client_side_validation = False
8577
self._deserialize = Deserializer(client_models)
86-
87-
self.domains = DomainsOperations(
88-
self._client, self._config, self._serialize, self._deserialize)
89-
self.domain_topics = DomainTopicsOperations(
90-
self._client, self._config, self._serialize, self._deserialize)
91-
self.event_subscriptions = EventSubscriptionsOperations(
92-
self._client, self._config, self._serialize, self._deserialize)
93-
self.system_topic_event_subscriptions = SystemTopicEventSubscriptionsOperations(
94-
self._client, self._config, self._serialize, self._deserialize)
95-
self.operations = Operations(
96-
self._client, self._config, self._serialize, self._deserialize)
97-
self.topics = TopicsOperations(
98-
self._client, self._config, self._serialize, self._deserialize)
99-
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
100-
self._client, self._config, self._serialize, self._deserialize)
101-
self.private_link_resources = PrivateLinkResourcesOperations(
102-
self._client, self._config, self._serialize, self._deserialize)
103-
self.system_topics = SystemTopicsOperations(
104-
self._client, self._config, self._serialize, self._deserialize)
105-
self.extension_topics = ExtensionTopicsOperations(
106-
self._client, self._config, self._serialize, self._deserialize)
107-
self.topic_types = TopicTypesOperations(
108-
self._client, self._config, self._serialize, self._deserialize)
109-
110-
def _send_request(self, http_request, **kwargs):
111-
# type: (HttpRequest, Any) -> HttpResponse
78+
self._serialize.client_side_validation = False
79+
self.domains = DomainsOperations(self._client, self._config, self._serialize, self._deserialize)
80+
self.domain_topics = DomainTopicsOperations(self._client, self._config, self._serialize, self._deserialize)
81+
self.event_subscriptions = EventSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize)
82+
self.system_topic_event_subscriptions = SystemTopicEventSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize)
83+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
84+
self.topics = TopicsOperations(self._client, self._config, self._serialize, self._deserialize)
85+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
86+
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
87+
self.system_topics = SystemTopicsOperations(self._client, self._config, self._serialize, self._deserialize)
88+
self.extension_topics = ExtensionTopicsOperations(self._client, self._config, self._serialize, self._deserialize)
89+
self.topic_types = TopicTypesOperations(self._client, self._config, self._serialize, self._deserialize)
90+
91+
92+
def _send_request(
93+
self,
94+
request, # type: HttpRequest
95+
**kwargs # type: Any
96+
):
97+
# type: (...) -> HttpResponse
11298
"""Runs the network request through the client's chained policies.
11399
114-
:param http_request: The network request you want to make. Required.
115-
:type http_request: ~azure.core.pipeline.transport.HttpRequest
116-
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
100+
>>> from azure.core.rest import HttpRequest
101+
>>> request = HttpRequest("GET", "https://www.example.org/")
102+
<HttpRequest [GET], url: 'https://www.example.org/'>
103+
>>> response = client._send_request(request)
104+
<HttpResponse: 200 OK>
105+
106+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
107+
108+
:param request: The network request you want to make. Required.
109+
:type request: ~azure.core.rest.HttpRequest
110+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
117111
:return: The response of your network call. Does not do error handling on your response.
118-
:rtype: ~azure.core.pipeline.transport.HttpResponse
112+
:rtype: ~azure.core.rest.HttpResponse
119113
"""
120-
path_format_arguments = {
121-
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
122-
}
123-
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
124-
stream = kwargs.pop("stream", True)
125-
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
126-
return pipeline_response.http_response
114+
115+
request_copy = deepcopy(request)
116+
request_copy.url = self._client.format_url(request_copy.url)
117+
return self._client.send_request(request_copy, **kwargs)
127118

128119
def close(self):
129120
# type: () -> None

sdk/eventgrid/azure-mgmt-eventgrid/azure/mgmt/eventgrid/_metadata.json

+10-11
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"name": "EventGridManagementClient",
66
"filename": "_event_grid_management_client",
77
"description": "Azure EventGrid Management Client.",
8-
"base_url": "\u0027https://management.azure.com\u0027",
9-
"custom_base_url": null,
8+
"host_value": "\"https://management.azure.com\"",
9+
"parameterized_host_template": null,
1010
"azure_arm": true,
1111
"has_lro_operations": true,
1212
"client_side_validation": false,
13-
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EventGridManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14-
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EventGridManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EventGridManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"EventGridManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
1515
},
1616
"global_parameters": {
1717
"sync": {
@@ -54,7 +54,7 @@
5454
"required": false
5555
},
5656
"base_url": {
57-
"signature": "base_url=None, # type: Optional[str]",
57+
"signature": "base_url=\"https://management.azure.com\", # type: str",
5858
"description": "Service URL",
5959
"docstring_type": "str",
6060
"required": false
@@ -74,7 +74,7 @@
7474
"required": false
7575
},
7676
"base_url": {
77-
"signature": "base_url: Optional[str] = None,",
77+
"signature": "base_url: str = \"https://management.azure.com\",",
7878
"description": "Service URL",
7979
"docstring_type": "str",
8080
"required": false
@@ -91,11 +91,10 @@
9191
"config": {
9292
"credential": true,
9393
"credential_scopes": ["https://management.azure.com/.default"],
94-
"credential_default_policy_type": "BearerTokenCredentialPolicy",
95-
"credential_default_policy_type_has_async_version": true,
96-
"credential_key_header_name": null,
97-
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
98-
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
94+
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
95+
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
96+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
97+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
9998
},
10099
"operation_groups": {
101100
"domains": "DomainsOperations",

0 commit comments

Comments
 (0)