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
99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
11+ from typing_extensions import Self
1112
1213from azure .core .pipeline import policies
1314from azure .core .rest import HttpRequest , HttpResponse
1415from azure .mgmt .core import ARMPipelineClient
1516from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1617
17- from . import models as _models
18- from .._serialization import Deserializer , Serializer
1918from ._configuration import ContainerServiceFleetMgmtClientConfiguration
19+ from ._serialization import Deserializer , Serializer
2020from .operations import (
21+ AutoUpgradeProfilesOperations ,
2122 FleetMembersOperations ,
2223 FleetUpdateStrategiesOperations ,
2324 FleetsOperations ,
2627)
2728
2829if 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
0 commit comments