Skip to content

Commit 9a52a4e

Browse files
author
SDKAuto
committed
CodeGen from PR 31564 in Azure/azure-rest-api-specs
Merge 63d4f91316a23ace6a710ac7af35157eed25817e into f06cffbda682a8cd225a8b16bc6f000d26d01612
1 parent 15d3f80 commit 9a52a4e

38 files changed

+2336
-6377
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
2-
"commit": "53bed2dccf392c14a412735c38a0f55645812294",
2+
"commit": "0d67b13c6db72641585997f0252832c2032102fd",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"typespec_src": "specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure",
5-
"@azure-tools/typespec-python": "0.23.12",
6-
"@autorest/python": "6.13.17"
4+
"typespec_src": "specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management",
5+
"@azure-tools/typespec-python": "0.36.4"
76
}

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) Python 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 ._client import DevOpsInfrastructureMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import DevOpsInfrastructureMgmtClient # 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
"DevOpsInfrastructureMgmtClient",
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/devopsinfrastructure/azure-mgmt-devopsinfrastructure/azure/mgmt/devopsinfrastructure/_client.py

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

99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import HttpRequest, HttpResponse
@@ -26,11 +27,10 @@
2627
)
2728

2829
if TYPE_CHECKING:
29-
# pylint: disable=unused-import,ungrouped-imports
3030
from azure.core.credentials import TokenCredential
3131

3232

33-
class DevOpsInfrastructureMgmtClient: # pylint: disable=client-accepts-api-version-keyword
33+
class DevOpsInfrastructureMgmtClient:
3434
"""DevOpsInfrastructureMgmtClient.
3535
3636
:ivar operations: Operations operations
@@ -48,13 +48,12 @@ class DevOpsInfrastructureMgmtClient: # pylint: disable=client-accepts-api-vers
4848
:vartype image_versions: azure.mgmt.devopsinfrastructure.operations.ImageVersionsOperations
4949
:param credential: Credential used to authenticate requests to the service. Required.
5050
:type credential: ~azure.core.credentials.TokenCredential
51-
:param subscription_id: The ID of the target subscription. Required.
51+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5252
:type subscription_id: str
5353
:param base_url: Service host. Default value is "https://management.azure.com".
5454
:type base_url: str
55-
:keyword api_version: The API version to use for this operation. Default value is
56-
"2024-04-04-preview". Note that overriding this default value may result in unsupported
57-
behavior.
55+
:keyword api_version: The API version to use for this operation. Default value is "2024-10-19".
56+
Note that overriding this default value may result in unsupported behavior.
5857
:paramtype api_version: str
5958
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6059
Retry-After header is present.
@@ -67,8 +66,9 @@ def __init__(
6766
base_url: str = "https://management.azure.com",
6867
**kwargs: Any
6968
) -> None:
69+
_endpoint = "{endpoint}"
7070
self._config = DevOpsInfrastructureMgmtClientConfiguration(
71-
credential=credential, subscription_id=subscription_id, **kwargs
71+
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
7272
)
7373
_policies = kwargs.pop("policies", None)
7474
if _policies is None:
@@ -88,7 +88,7 @@ def __init__(
8888
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
8989
self._config.http_logging_policy,
9090
]
91-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
91+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
9292

9393
self._serialize = Serializer()
9494
self._deserialize = Deserializer()
@@ -123,13 +123,17 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
123123
"""
124124

125125
request_copy = deepcopy(request)
126-
request_copy.url = self._client.format_url(request_copy.url)
126+
path_format_arguments = {
127+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
128+
}
129+
130+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
127131
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
128132

129133
def close(self) -> None:
130134
self._client.close()
131135

132-
def __enter__(self) -> "DevOpsInfrastructureMgmtClient":
136+
def __enter__(self) -> Self:
133137
self._client.__enter__()
134138
return self
135139

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
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

@@ -26,16 +25,23 @@ class DevOpsInfrastructureMgmtClientConfiguration: # pylint: disable=too-many-i
2625
2726
:param credential: Credential used to authenticate requests to the service. Required.
2827
:type credential: ~azure.core.credentials.TokenCredential
29-
:param subscription_id: The ID of the target subscription. Required.
28+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3029
:type subscription_id: str
31-
:keyword api_version: The API version to use for this operation. Default value is
32-
"2024-04-04-preview". Note that overriding this default value may result in unsupported
33-
behavior.
30+
:param base_url: Service host. Default value is "https://management.azure.com".
31+
:type base_url: str
32+
:keyword api_version: The API version to use for this operation. Default value is "2024-10-19".
33+
Note that overriding this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
api_version: str = kwargs.pop("api_version", "2024-04-04-preview")
37+
def __init__(
38+
self,
39+
credential: "TokenCredential",
40+
subscription_id: str,
41+
base_url: str = "https://management.azure.com",
42+
**kwargs: Any
43+
) -> None:
44+
api_version: str = kwargs.pop("api_version", "2024-10-19")
3945

4046
if credential is None:
4147
raise ValueError("Parameter 'credential' must not be None.")
@@ -44,6 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4450

4551
self.credential = credential
4652
self.subscription_id = subscription_id
53+
self.base_url = base_url
4754
self.api_version = api_version
4855
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4956
kwargs.setdefault("sdk_moniker", "mgmt-devopsinfrastructure/{}".format(VERSION))

0 commit comments

Comments
 (0)