Skip to content

Commit 48298bf

Browse files
[AutoRelease] t2-frontdoor-2024-04-15-87058(can only be merged by SDK owner) (#35200)
* code and test * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 0ea4389 commit 48298bf

File tree

76 files changed

+1474
-2274
lines changed

Some content is hidden

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

76 files changed

+1474
-2274
lines changed

sdk/network/azure-mgmt-frontdoor/CHANGELOG.md

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

3+
## 1.2.0 (2024-04-15)
4+
5+
### Features Added
6+
7+
- Model CustomRule has a new parameter group_by
8+
- Model PolicySettings has a new parameter javascript_challenge_expiration_in_minutes
9+
- Model PolicySettings has a new parameter scrubbing_rules
10+
- Model PolicySettings has a new parameter state
11+
312
## 1.1.0 (2023-05-19)
413

514
### Features Added

sdk/network/azure-mgmt-frontdoor/README.md

Lines changed: 2 additions & 5 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 Front Door Service 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
@@ -59,6 +59,3 @@ Code samples for this package can be found at:
5959
If you encounter any bugs or have suggestions, please file an issue in the
6060
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6161
section of the project.
62-
63-
64-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-frontdoor%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "7a65f22cf67826187f75981e914c7e679039257b",
2+
"commit": "b54ffc9278eff071455b1dbb4ad2e772afce885d",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.4.8",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/frontdoor/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.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/frontdoor/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/frontdoor/resource-manager/readme.md"
1111
}

sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/_configuration.py

Lines changed: 3 additions & 4 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 FrontDoorManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class FrontDoorManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for FrontDoorManagementClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -33,7 +32,6 @@ class FrontDoorManagementClientConfiguration(Configuration): # pylint: disable=
3332
"""
3433

3534
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36-
super(FrontDoorManagementClientConfiguration, self).__init__(**kwargs)
3735
if credential is None:
3836
raise ValueError("Parameter 'credential' must not be None.")
3937
if subscription_id is None:
@@ -43,6 +41,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4341
self.subscription_id = subscription_id
4442
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4543
kwargs.setdefault("sdk_moniker", "mgmt-frontdoor/{}".format(VERSION))
44+
self.polling_interval = kwargs.get("polling_interval", 30)
4645
self._configure(**kwargs)
4746

4847
def _configure(self, **kwargs: Any) -> None:
@@ -51,9 +50,9 @@ def _configure(self, **kwargs: Any) -> None:
5150
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5251
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5352
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
54-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5553
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
5654
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
55+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
5756
self.authentication_policy = kwargs.get("authentication_policy")
5857
if self.credential and not self.authentication_policy:
5958
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/_front_door_management_client.py

Lines changed: 23 additions & 3 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 FrontDoorManagementClientConfiguration
@@ -88,7 +90,25 @@ def __init__(
8890
self._config = FrontDoorManagementClientConfiguration(
8991
credential=credential, subscription_id=subscription_id, **kwargs
9092
)
91-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
93+
_policies = kwargs.pop("policies", None)
94+
if _policies is None:
95+
_policies = [
96+
policies.RequestIdPolicy(**kwargs),
97+
self._config.headers_policy,
98+
self._config.user_agent_policy,
99+
self._config.proxy_policy,
100+
policies.ContentDecodePolicy(**kwargs),
101+
ARMAutoResourceProviderRegistrationPolicy(),
102+
self._config.redirect_policy,
103+
self._config.retry_policy,
104+
self._config.authentication_policy,
105+
self._config.custom_hook_policy,
106+
self._config.logging_policy,
107+
policies.DistributedTracingPolicy(**kwargs),
108+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
109+
self._config.http_logging_policy,
110+
]
111+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
92112

93113
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
94114
self._serialize = Serializer(client_models)
@@ -119,7 +139,7 @@ def __init__(
119139
self.experiments = ExperimentsOperations(self._client, self._config, self._serialize, self._deserialize)
120140
self.reports = ReportsOperations(self._client, self._config, self._serialize, self._deserialize)
121141

122-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
142+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
123143
"""Runs the network request through the client's chained policies.
124144
125145
>>> from azure.core.rest import HttpRequest
@@ -139,7 +159,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
139159

140160
request_copy = deepcopy(request)
141161
request_copy.url = self._client.format_url(request_copy.url)
142-
return self._client.send_request(request_copy, **kwargs)
162+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
143163

144164
def close(self) -> None:
145165
self._client.close()

0 commit comments

Comments
 (0)