Skip to content

Commit 2941184

Browse files
author
SDKAuto
committed
CodeGen from PR 34447 in Azure/azure-rest-api-specs
Merge 7864c57651856184a47ae5550b299f0db5e547fd into ebabd96a91be0af107cc66f3149b0b41d7d44a8f
1 parent 659ceb1 commit 2941184

File tree

106 files changed

+3677
-1420
lines changed

Some content is hidden

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

106 files changed

+3677
-1420
lines changed

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

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

3+
## 2.0.0 (2025-05-05)
4+
5+
### Features Added
6+
7+
- Enum `ActionType` added member `CAPTCHA`
8+
- Enum `MatchProcessingBehavior` added member `CONTINUE`
9+
- Model `PolicySettings` added property `captcha_expiration_in_minutes`
10+
11+
### Breaking Changes
12+
13+
- Deleted or renamed enum value `MatchProcessingBehavior.CONTINUE_ENUM`
14+
315
## 1.2.0 (2024-04-15)
416

517
### Features Added

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

+3-3
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.8+.
4+
This package has been tested with Python 3.9+.
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.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "b54ffc9278eff071455b1dbb4ad2e772afce885d",
2+
"commit": "0358f2e912fbe62d7e827062a008ae3b842254bb",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.13.7",
6+
"@autorest/python@6.34.1",
77
"@autorest/[email protected]"
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.13.7 --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/frontdoor/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.34.1 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/frontdoor/resource-manager/readme.md"
1111
}

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

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._front_door_management_client import FrontDoorManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._front_door_management_client import FrontDoorManagementClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"FrontDoorManagementClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

21-
class FrontDoorManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
20+
class FrontDoorManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
2221
"""Configuration for FrontDoorManagementClient.
2322
2423
Note that all parameters used to create this instance are saved as instance

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

+16-12
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1416
from azure.mgmt.core import ARMPipelineClient
1517
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1619

1720
from . import models as _models
1821
from ._configuration import FrontDoorManagementClientConfiguration
19-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2023
from .operations import (
2124
EndpointsOperations,
2225
ExperimentsOperations,
@@ -33,7 +36,6 @@
3336
)
3437

3538
if TYPE_CHECKING:
36-
# pylint: disable=unused-import,ungrouped-imports
3739
from azure.core.credentials import TokenCredential
3840

3941

@@ -74,22 +76,24 @@ class FrontDoorManagementClient: # pylint: disable=client-accepts-api-version-k
7476
:param subscription_id: The subscription credentials which uniquely identify the Microsoft
7577
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
7678
:type subscription_id: str
77-
:param base_url: Service URL. Default value is "https://management.azure.com".
79+
:param base_url: Service URL. Default value is None.
7880
:type base_url: str
7981
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
8082
Retry-After header is present.
8183
"""
8284

8385
def __init__(
84-
self,
85-
credential: "TokenCredential",
86-
subscription_id: str,
87-
base_url: str = "https://management.azure.com",
88-
**kwargs: Any
86+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
8987
) -> None:
88+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
89+
_endpoints = get_arm_endpoints(_cloud)
90+
if not base_url:
91+
base_url = _endpoints["resource_manager"]
92+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
9093
self._config = FrontDoorManagementClientConfiguration(
91-
credential=credential, subscription_id=subscription_id, **kwargs
94+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
9295
)
96+
9397
_policies = kwargs.pop("policies", None)
9498
if _policies is None:
9599
_policies = [
@@ -108,7 +112,7 @@ def __init__(
108112
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
109113
self._config.http_logging_policy,
110114
]
111-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
115+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
112116

113117
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
114118
self._serialize = Serializer(client_models)
@@ -164,7 +168,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
164168
def close(self) -> None:
165169
self._client.close()
166170

167-
def __enter__(self) -> "FrontDoorManagementClient":
171+
def __enter__(self) -> Self:
168172
self._client.__enter__()
169173
return self
170174

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

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#
2626
# --------------------------------------------------------------------------
2727

28+
2829
# This file is used for handwritten extensions to the generated code. Example:
2930
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3031
def patch_sdk():

sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/_vendor.py renamed to sdk/network/azure-mgmt-frontdoor/azure/mgmt/frontdoor/_utils/__init__.py

-10
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,3 @@
44
# Code generated by Microsoft (R) AutoRest Code Generator.
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
7-
8-
from azure.core.pipeline.transport import HttpRequest
9-
10-
11-
def _convert_request(request, files=None):
12-
data = request.content if not files else None
13-
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
14-
if files:
15-
request.set_formdata_body(files)
16-
return request

0 commit comments

Comments
 (0)