Skip to content

Commit b6ac1d6

Browse files
author
SDKAuto
committed
CodeGen from PR 30473 in Azure/azure-rest-api-specs
Merge 05a2b33d9218414332b32e1ee974513bfa8bc26d into 30615d5ca38b2065ac4937f12a18c77568587647
1 parent 89cdab7 commit b6ac1d6

25 files changed

+1966
-13373
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"commit": "c1cea38fb7e5cec9afe223a2ed15cbe2fbeecbdb",
2+
"commit": "20b41bd6868fdf5b1336dee5e85a5cbfce51a4d3",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"typespec_src": "specification/azurefleet/AzureFleet.Management",
5-
"@azure-tools/typespec-python": "0.26.0"
5+
"@azure-tools/typespec-python": "0.32.0"
66
}

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

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyw
3333
:vartype fleets: azure.mgmt.computefleet.operations.FleetsOperations
3434
:param credential: Credential used to authenticate requests to the service. Required.
3535
:type credential: ~azure.core.credentials.TokenCredential
36-
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
37-
:type subscription_id: str
3836
:param base_url: Service host. Default value is "https://management.azure.com".
3937
:type base_url: str
4038
:keyword api_version: The API version to use for this operation. Default value is
@@ -46,15 +44,10 @@ class ComputeFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyw
4644
"""
4745

4846
def __init__(
49-
self,
50-
credential: "TokenCredential",
51-
subscription_id: str,
52-
base_url: str = "https://management.azure.com",
53-
**kwargs: Any
47+
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
5448
) -> None:
55-
self._config = ComputeFleetMgmtClientConfiguration(
56-
credential=credential, subscription_id=subscription_id, **kwargs
57-
)
49+
_endpoint = "{endpoint}"
50+
self._config = ComputeFleetMgmtClientConfiguration(credential=credential, base_url=base_url, **kwargs)
5851
_policies = kwargs.pop("policies", None)
5952
if _policies is None:
6053
_policies = [
@@ -73,7 +66,7 @@ def __init__(
7366
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
7467
self._config.http_logging_policy,
7568
]
76-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
69+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
7770

7871
self._serialize = Serializer()
7972
self._deserialize = Deserializer()
@@ -100,7 +93,11 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
10093
"""
10194

10295
request_copy = deepcopy(request)
103-
request_copy.url = self._client.format_url(request_copy.url)
96+
path_format_arguments = {
97+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
98+
}
99+
100+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
104101
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
105102

106103
def close(self) -> None:

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,24 @@ class ComputeFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-
2626
2727
:param credential: Credential used to authenticate requests to the service. Required.
2828
:type credential: ~azure.core.credentials.TokenCredential
29-
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
30-
:type subscription_id: str
29+
:param base_url: Service host. Default value is "https://management.azure.com".
30+
:type base_url: str
3131
:keyword api_version: The API version to use for this operation. Default value is
3232
"2024-05-01-preview". Note that overriding this default value may result in unsupported
3333
behavior.
3434
:paramtype api_version: str
3535
"""
3636

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
37+
def __init__(
38+
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
39+
) -> None:
3840
api_version: str = kwargs.pop("api_version", "2024-05-01-preview")
3941

4042
if credential is None:
4143
raise ValueError("Parameter 'credential' must not be None.")
42-
if subscription_id is None:
43-
raise ValueError("Parameter 'subscription_id' must not be None.")
4444

4545
self.credential = credential
46-
self.subscription_id = subscription_id
46+
self.base_url = base_url
4747
self.api_version = api_version
4848
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4949
kwargs.setdefault("sdk_moniker", "mgmt-computefleet/{}".format(VERSION))

0 commit comments

Comments
 (0)