Skip to content

Commit a9e829c

Browse files
[AutoRelease] t2-eventgrid-2024-04-28-12984(can only be merged by SDK owner) (#35407)
* code and test * Update CHANGELOG.md * Update assets.json --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 4d480ca commit a9e829c

File tree

293 files changed

+5860
-9487
lines changed

Some content is hidden

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

293 files changed

+5860
-9487
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Release History
22

3+
## 10.3.0b4 (2024-04-29)
4+
5+
### Features Added
6+
7+
- Added operation NamespaceTopicEventSubscriptionsOperations.get_full_url
8+
- Added operation NamespacesOperations.begin_validate_custom_domain_ownership
9+
- Model ClientAuthenticationSettings has a new parameter custom_jwt_authentication
10+
- Model NamespaceUpdateParameters has a new parameter topics_configuration
11+
- Model PushInfo has a new parameter destination
12+
- Model Subscription has a new parameter expiration_time_utc
13+
- Model SubscriptionUpdateParameters has a new parameter expiration_time_utc
14+
- Model TopicSpacesConfiguration has a new parameter custom_domains
15+
- Model TopicsConfiguration has a new parameter custom_domains
16+
- Model UpdateTopicSpacesConfigurationInfo has a new parameter custom_domains
17+
318
## 10.3.0b3 (2023-12-04)
419

520
### Features Added

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Event Grid Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "78eac0bd58633028293cb1ec1709baa200bed9e2",
2+
"commit": "edbae6fb086224abd5b744edc7b833fec0909617",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.7.1",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/eventgrid/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/eventgrid/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/eventgrid/resource-manager/readme.md"
1111
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/eventgrid/azure-mgmt-eventgrid",
5-
"Tag": "python/eventgrid/azure-mgmt-eventgrid_03d59b46e4"
5+
"Tag": "python/eventgrid/azure-mgmt-eventgrid_cf1f9ef41d"
66
}

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

@@ -19,7 +18,7 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class EventGridManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class EventGridManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for EventGridManagementClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -30,14 +29,13 @@ class EventGridManagementClientConfiguration(Configuration): # pylint: disable=
3029
:param subscription_id: Subscription credentials that uniquely identify a Microsoft Azure
3130
subscription. The subscription ID forms part of the URI for every service call. Required.
3231
:type subscription_id: str
33-
:keyword api_version: Api Version. Default value is "2023-12-15-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2024-06-01-preview". Note that overriding
3433
this default value may result in unsupported behavior.
3534
:paramtype api_version: str
3635
"""
3736

3837
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
39-
super(EventGridManagementClientConfiguration, self).__init__(**kwargs)
40-
api_version: str = kwargs.pop("api_version", "2023-12-15-preview")
38+
api_version: str = kwargs.pop("api_version", "2024-06-01-preview")
4139

4240
if credential is None:
4341
raise ValueError("Parameter 'credential' must not be None.")
@@ -49,6 +47,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4947
self.api_version = api_version
5048
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5149
kwargs.setdefault("sdk_moniker", "mgmt-eventgrid/{}".format(VERSION))
50+
self.polling_interval = kwargs.get("polling_interval", 30)
5251
self._configure(**kwargs)
5352

5453
def _configure(self, **kwargs: Any) -> None:
@@ -57,9 +56,9 @@ def _configure(self, **kwargs: Any) -> None:
5756
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5857
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5958
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
60-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6159
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6260
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
61+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6362
self.authentication_policy = kwargs.get("authentication_policy")
6463
if self.credential and not self.authentication_policy:
6564
self.authentication_policy = ARMChallengeAuthenticationPolicy(

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12+
from azure.core.pipeline import policies
1213
from azure.core.rest import HttpRequest, HttpResponse
1314
from azure.mgmt.core import ARMPipelineClient
15+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1416

1517
from . import models as _models
1618
from ._configuration import EventGridManagementClientConfiguration
@@ -137,7 +139,7 @@ class EventGridManagementClient: # pylint: disable=client-accepts-api-version-k
137139
:type subscription_id: str
138140
:param base_url: Service URL. Default value is "https://management.azure.com".
139141
:type base_url: str
140-
:keyword api_version: Api Version. Default value is "2023-12-15-preview". Note that overriding
142+
:keyword api_version: Api Version. Default value is "2024-06-01-preview". Note that overriding
141143
this default value may result in unsupported behavior.
142144
:paramtype api_version: str
143145
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -154,7 +156,25 @@ def __init__(
154156
self._config = EventGridManagementClientConfiguration(
155157
credential=credential, subscription_id=subscription_id, **kwargs
156158
)
157-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
159+
_policies = kwargs.pop("policies", None)
160+
if _policies is None:
161+
_policies = [
162+
policies.RequestIdPolicy(**kwargs),
163+
self._config.headers_policy,
164+
self._config.user_agent_policy,
165+
self._config.proxy_policy,
166+
policies.ContentDecodePolicy(**kwargs),
167+
ARMAutoResourceProviderRegistrationPolicy(),
168+
self._config.redirect_policy,
169+
self._config.retry_policy,
170+
self._config.authentication_policy,
171+
self._config.custom_hook_policy,
172+
self._config.logging_policy,
173+
policies.DistributedTracingPolicy(**kwargs),
174+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
175+
self._config.http_logging_policy,
176+
]
177+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
158178

159179
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
160180
self._serialize = Serializer(client_models)
@@ -228,7 +248,7 @@ def __init__(
228248
self._client, self._config, self._serialize, self._deserialize
229249
)
230250

231-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
251+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
232252
"""Runs the network request through the client's chained policies.
233253
234254
>>> from azure.core.rest import HttpRequest
@@ -248,7 +268,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
248268

249269
request_copy = deepcopy(request)
250270
request_copy.url = self._client.format_url(request_copy.url)
251-
return self._client.send_request(request_copy, **kwargs)
271+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
252272

253273
def close(self) -> None:
254274
self._client.close()

0 commit comments

Comments
 (0)