Skip to content

Commit 012bbfb

Browse files
author
SDKAuto
committed
CodeGen from PR 33826 in Azure/azure-rest-api-specs
Merge 1f0b86e46eb04220d15b7c62d0891d9d12b67fff into 908f30f83295f8afe862310153344468510e3b88
1 parent 1310d7e commit 012bbfb

File tree

6 files changed

+41
-23
lines changed

6 files changed

+41
-23
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "525c8c6cebc5837606cb14cfcb0afdb4f2f17fa9",
2+
"commit": "aba277781380092d0a72c1f58f1d89d39af64066",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/standbypool/StandbyPool.Management",
5-
"@azure-tools/typespec-python": "0.42.3"
5+
"@azure-tools/typespec-python": "0.43.0"
66
}

sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_client.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
# --------------------------------------------------------------------------
88

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

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from ._configuration import StandbyPoolMgmtClientConfiguration
1921
from ._serialization import Deserializer, Serializer
@@ -56,7 +58,7 @@ class StandbyPoolMgmtClient:
5658
:type credential: ~azure.core.credentials.TokenCredential
5759
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5860
:type subscription_id: str
59-
:param base_url: Service host. Default value is "https://management.azure.com".
61+
:param base_url: Service host. Default value is None.
6062
:type base_url: str
6163
:keyword api_version: The API version to use for this operation. Default value is "2025-03-01".
6264
Note that overriding this default value may result in unsupported behavior.
@@ -66,16 +68,22 @@ class StandbyPoolMgmtClient:
6668
"""
6769

6870
def __init__(
69-
self,
70-
credential: "TokenCredential",
71-
subscription_id: str,
72-
base_url: str = "https://management.azure.com",
73-
**kwargs: Any
71+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
7472
) -> None:
7573
_endpoint = "{endpoint}"
74+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
75+
_endpoints = get_arm_endpoints(_cloud)
76+
if not base_url:
77+
base_url = _endpoints["resource_manager"]
78+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
7679
self._config = StandbyPoolMgmtClientConfiguration(
77-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
80+
credential=credential,
81+
subscription_id=subscription_id,
82+
base_url=cast(str, base_url),
83+
credential_scopes=credential_scopes,
84+
**kwargs
7885
)
86+
7987
_policies = kwargs.pop("policies", None)
8088
if _policies is None:
8189
_policies = [
@@ -94,7 +102,7 @@ def __init__(
94102
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
95103
self._config.http_logging_policy,
96104
]
97-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
105+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
98106

99107
self._serialize = Serializer()
100108
self._deserialize = Deserializer()

sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "2.0.0"
9+
VERSION = "1.0.0b1"

sdk/standbypool/azure-mgmt-standbypool/azure/mgmt/standbypool/aio/_client.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, Awaitable, TYPE_CHECKING
10+
from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import AsyncHttpResponse, HttpRequest
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import AsyncARMPipelineClient
1617
from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from .._serialization import Deserializer, Serializer
1921
from ._configuration import StandbyPoolMgmtClientConfiguration
@@ -56,7 +58,7 @@ class StandbyPoolMgmtClient:
5658
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
5759
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5860
:type subscription_id: str
59-
:param base_url: Service host. Default value is "https://management.azure.com".
61+
:param base_url: Service host. Default value is None.
6062
:type base_url: str
6163
:keyword api_version: The API version to use for this operation. Default value is "2025-03-01".
6264
Note that overriding this default value may result in unsupported behavior.
@@ -66,16 +68,22 @@ class StandbyPoolMgmtClient:
6668
"""
6769

6870
def __init__(
69-
self,
70-
credential: "AsyncTokenCredential",
71-
subscription_id: str,
72-
base_url: str = "https://management.azure.com",
73-
**kwargs: Any
71+
self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
7472
) -> None:
7573
_endpoint = "{endpoint}"
74+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
75+
_endpoints = get_arm_endpoints(_cloud)
76+
if not base_url:
77+
base_url = _endpoints["resource_manager"]
78+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
7679
self._config = StandbyPoolMgmtClientConfiguration(
77-
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
80+
credential=credential,
81+
subscription_id=subscription_id,
82+
base_url=cast(str, base_url),
83+
credential_scopes=credential_scopes,
84+
**kwargs
7885
)
86+
7987
_policies = kwargs.pop("policies", None)
8088
if _policies is None:
8189
_policies = [
@@ -94,7 +102,9 @@ def __init__(
94102
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
95103
self._config.http_logging_policy,
96104
]
97-
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
105+
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(
106+
base_url=cast(str, _endpoint), policies=_policies, **kwargs
107+
)
98108

99109
self._serialize = Serializer()
100110
self._deserialize = Deserializer()

sdk/standbypool/azure-mgmt-standbypool/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"isodate>=0.6.1",
7777
"typing-extensions>=4.6.0",
7878
"azure-common>=1.1",
79-
"azure-mgmt-core>=1.3.2",
79+
"azure-mgmt-core>=1.5.0",
8080
],
8181
python_requires=">=3.9",
8282
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
directory: specification/standbypool/StandbyPool.Management
2-
commit: 525c8c6cebc5837606cb14cfcb0afdb4f2f17fa9
2+
commit: aba277781380092d0a72c1f58f1d89d39af64066
33
repo: Azure/azure-rest-api-specs
44
additionalDirectories:

0 commit comments

Comments
 (0)