Skip to content

Commit 60e113a

Browse files
author
SDKAuto
committed
CodeGen from PR 31028 in Azure/azure-rest-api-specs
Merge 9cf37b863d4abad123a7122493e5537225d1e076 into ae950a4d68bd5bae23f85a8d575a213e9b0442d3
1 parent 18e11ed commit 60e113a

File tree

310 files changed

+16477
-74443
lines changed

Some content is hidden

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

310 files changed

+16477
-74443
lines changed
Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
{
2-
"commit": "a013dabbe84aeb3f5d48b0e30d15fdfbb6a8d062",
2+
"commit": "97590f95923101678d499d67f6fd4371b8d5f23e",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.7",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/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/[email protected] --use=@autorest/[email protected] --version=3.9.7 --version-tolerant=False",
10-
"readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md",
11-
"package-2023-06-preview": "2024-04-17 10:47:28 +0800 c4e661cdf92c8f579574008d0cd11874cc303da0 preview/2023-06-15-preview/fleets.json",
12-
"package-2023-03-preview": "2024-04-17 10:47:28 +0800 c4e661cdf92c8f579574008d0cd11874cc303da0 preview/2023-03-15-preview/fleets.json",
13-
"package-2022-09-preview": "2024-04-03 11:54:30 -0700 aaf40b00d0d15db7d3252beeeac634da9dc09099 preview/2022-09-02-preview/fleets.json",
14-
"package-2022-07-preview": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-07-02-preview/fleets.json",
15-
"package-2022-06-preview": "2023-02-15 15:17:59 +0800 67527326606bd3c71700e2b96ff3c9ce9e655e29 preview/2022-06-02-preview/fleets.json",
16-
"package-2023-08-preview": "2024-04-23 16:19:44 -0700 bce261b592674cd74a6603ea65b8561fb20ed154 preview/2023-08-15-preview/fleets.json",
17-
"package-2023-10": "2024-04-23 16:19:44 -0700 bce261b592674cd74a6603ea65b8561fb20ed154 stable/2023-10-15/fleets.json",
18-
"package-2024-02-preview": "2024-04-23 16:19:44 -0700 bce261b592674cd74a6603ea65b8561fb20ed154 preview/2024-02-02-preview/fleets.json",
19-
"package-2024-04": "2024-04-23 16:19:44 -0700 bce261b592674cd74a6603ea65b8561fb20ed154 stable/2024-04-01/fleets.json"
4+
"typespec_src": "specification/containerservice/Fleet.Management",
5+
"@azure-tools/typespec-python": "0.36.0"
206
}

sdk/containerservice/azure-mgmt-containerservicefleet/azure/mgmt/containerservicefleet/__init__.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,25 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from ._container_service_fleet_mgmt_client import ContainerServiceFleetMgmtClient
10-
__all__ = ['ContainerServiceFleetMgmtClient']
9+
from ._client import ContainerServiceFleetMgmtClient
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
1113

1214
try:
13-
from ._patch import patch_sdk # type: ignore
14-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1517
except ImportError:
16-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
1720

18-
from ._version import VERSION
21+
__all__ = [
22+
"ContainerServiceFleetMgmtClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
1925

20-
__version__ = VERSION
26+
_patch_sdk()
Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
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
1415
from azure.mgmt.core import ARMPipelineClient
1516
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1617

17-
from . import models as _models
18-
from .._serialization import Deserializer, Serializer
1918
from ._configuration import ContainerServiceFleetMgmtClientConfiguration
19+
from ._serialization import Deserializer, Serializer
2020
from .operations import (
21+
AutoUpgradeProfilesOperations,
2122
FleetMembersOperations,
2223
FleetUpdateStrategiesOperations,
2324
FleetsOperations,
@@ -26,34 +27,35 @@
2627
)
2728

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

3232

33-
class ContainerServiceFleetMgmtClient: # pylint: disable=client-accepts-api-version-keyword
33+
class ContainerServiceFleetMgmtClient:
3434
"""Azure Kubernetes Fleet Manager api client.
3535
3636
:ivar operations: Operations operations
37-
:vartype operations: azure.mgmt.containerservicefleet.v2023_10_15.operations.Operations
37+
:vartype operations: azure.mgmt.containerservicefleet.operations.Operations
3838
:ivar fleets: FleetsOperations operations
39-
:vartype fleets: azure.mgmt.containerservicefleet.v2023_10_15.operations.FleetsOperations
39+
:vartype fleets: azure.mgmt.containerservicefleet.operations.FleetsOperations
4040
:ivar fleet_members: FleetMembersOperations operations
41-
:vartype fleet_members:
42-
azure.mgmt.containerservicefleet.v2023_10_15.operations.FleetMembersOperations
41+
:vartype fleet_members: azure.mgmt.containerservicefleet.operations.FleetMembersOperations
4342
:ivar update_runs: UpdateRunsOperations operations
44-
:vartype update_runs:
45-
azure.mgmt.containerservicefleet.v2023_10_15.operations.UpdateRunsOperations
43+
:vartype update_runs: azure.mgmt.containerservicefleet.operations.UpdateRunsOperations
4644
:ivar fleet_update_strategies: FleetUpdateStrategiesOperations operations
4745
:vartype fleet_update_strategies:
48-
azure.mgmt.containerservicefleet.v2023_10_15.operations.FleetUpdateStrategiesOperations
49-
:param credential: Credential needed for the client to connect to Azure. Required.
46+
azure.mgmt.containerservicefleet.operations.FleetUpdateStrategiesOperations
47+
:ivar auto_upgrade_profiles: AutoUpgradeProfilesOperations operations
48+
:vartype auto_upgrade_profiles:
49+
azure.mgmt.containerservicefleet.operations.AutoUpgradeProfilesOperations
50+
:param credential: Credential used to authenticate requests to the service. Required.
5051
:type credential: ~azure.core.credentials.TokenCredential
51-
:param subscription_id: The ID of the target subscription. Required.
52+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
5253
:type subscription_id: str
53-
:param base_url: Service URL. Default value is "https://management.azure.com".
54+
:param base_url: Service host. Default value is "https://management.azure.com".
5455
:type base_url: str
55-
:keyword api_version: Api Version. Default value is "2023-10-15". Note that overriding this
56-
default value may result in unsupported behavior.
56+
:keyword api_version: The API version to use for this operation. Default value is
57+
"2024-05-02-preview". Note that overriding this default value may result in unsupported
58+
behavior.
5759
:paramtype api_version: str
5860
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
5961
Retry-After header is present.
@@ -66,8 +68,9 @@ def __init__(
6668
base_url: str = "https://management.azure.com",
6769
**kwargs: Any
6870
) -> None:
71+
_endpoint = "{endpoint}"
6972
self._config = ContainerServiceFleetMgmtClientConfiguration(
70-
credential=credential, subscription_id=subscription_id, **kwargs
73+
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
7174
)
7275
_policies = kwargs.pop("policies", None)
7376
if _policies is None:
@@ -87,31 +90,29 @@ def __init__(
8790
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
8891
self._config.http_logging_policy,
8992
]
90-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
93+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
9194

92-
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
93-
self._serialize = Serializer(client_models)
94-
self._deserialize = Deserializer(client_models)
95+
self._serialize = Serializer()
96+
self._deserialize = Deserializer()
9597
self._serialize.client_side_validation = False
96-
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize, "2023-10-15")
97-
self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize, "2023-10-15")
98-
self.fleet_members = FleetMembersOperations(
99-
self._client, self._config, self._serialize, self._deserialize, "2023-10-15"
100-
)
101-
self.update_runs = UpdateRunsOperations(
102-
self._client, self._config, self._serialize, self._deserialize, "2023-10-15"
103-
)
98+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
99+
self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize)
100+
self.fleet_members = FleetMembersOperations(self._client, self._config, self._serialize, self._deserialize)
101+
self.update_runs = UpdateRunsOperations(self._client, self._config, self._serialize, self._deserialize)
104102
self.fleet_update_strategies = FleetUpdateStrategiesOperations(
105-
self._client, self._config, self._serialize, self._deserialize, "2023-10-15"
103+
self._client, self._config, self._serialize, self._deserialize
104+
)
105+
self.auto_upgrade_profiles = AutoUpgradeProfilesOperations(
106+
self._client, self._config, self._serialize, self._deserialize
106107
)
107108

108-
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
109+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
109110
"""Runs the network request through the client's chained policies.
110111
111112
>>> from azure.core.rest import HttpRequest
112113
>>> request = HttpRequest("GET", "https://www.example.org/")
113114
<HttpRequest [GET], url: 'https://www.example.org/'>
114-
>>> response = client._send_request(request)
115+
>>> response = client.send_request(request)
115116
<HttpResponse: 200 OK>
116117
117118
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -124,13 +125,17 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
124125
"""
125126

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

130135
def close(self) -> None:
131136
self._client.close()
132137

133-
def __enter__(self) -> "ContainerServiceFleetMgmtClient":
138+
def __enter__(self) -> Self:
134139
self._client.__enter__()
135140
return self
136141

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
#
7-
# Code generated by Microsoft (R) AutoRest Code Generator.
8-
# Changes may cause incorrect behavior and will be lost if the code is
9-
# regenerated.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
107
# --------------------------------------------------------------------------
8+
119
from typing import Any, TYPE_CHECKING
1210

1311
from azure.core.pipeline import policies
@@ -16,51 +14,61 @@
1614
from ._version import VERSION
1715

1816
if TYPE_CHECKING:
19-
# pylint: disable=unused-import,ungrouped-imports
2017
from azure.core.credentials import TokenCredential
2118

22-
class ContainerServiceFleetMgmtClientConfiguration:
19+
20+
class ContainerServiceFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2321
"""Configuration for ContainerServiceFleetMgmtClient.
2422
2523
Note that all parameters used to create this instance are saved as instance
2624
attributes.
2725
28-
:param credential: Credential needed for the client to connect to Azure. Required.
26+
:param credential: Credential used to authenticate requests to the service. Required.
2927
:type credential: ~azure.core.credentials.TokenCredential
30-
: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.
3129
:type subscription_id: str
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
33+
"2024-05-02-preview". Note that overriding this default value may result in unsupported
34+
behavior.
35+
:paramtype api_version: str
3236
"""
3337

3438
def __init__(
3539
self,
3640
credential: "TokenCredential",
3741
subscription_id: str,
42+
base_url: str = "https://management.azure.com",
3843
**kwargs: Any
39-
):
44+
) -> None:
45+
api_version: str = kwargs.pop("api_version", "2024-05-02-preview")
46+
4047
if credential is None:
4148
raise ValueError("Parameter 'credential' must not be None.")
4249
if subscription_id is None:
4350
raise ValueError("Parameter 'subscription_id' must not be None.")
4451

4552
self.credential = credential
4653
self.subscription_id = subscription_id
47-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
48-
kwargs.setdefault('sdk_moniker', 'azure-mgmt-containerservicefleet/{}'.format(VERSION))
54+
self.base_url = base_url
55+
self.api_version = api_version
56+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
57+
kwargs.setdefault("sdk_moniker", "mgmt-containerservicefleet/{}".format(VERSION))
4958
self.polling_interval = kwargs.get("polling_interval", 30)
5059
self._configure(**kwargs)
5160

52-
def _configure(
53-
self,
54-
**kwargs: Any
55-
):
56-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
57-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
58-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
59-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
60-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
61-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
62-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
63-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
64-
self.authentication_policy = kwargs.get('authentication_policy')
61+
def _configure(self, **kwargs: Any) -> None:
62+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
63+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
64+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
65+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
66+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
67+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
68+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
69+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
70+
self.authentication_policy = kwargs.get("authentication_policy")
6571
if self.credential and not self.authentication_policy:
66-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
72+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
73+
self.credential, *self.credential_scopes, **kwargs
74+
)

0 commit comments

Comments
 (0)