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
10- from typing import Any , TYPE_CHECKING
10+ from typing import Any , Optional , TYPE_CHECKING , cast
1111from typing_extensions import Self
1212
1313from azure .core .pipeline import policies
1414from azure .core .rest import HttpRequest , HttpResponse
15+ from azure .core .settings import settings
1516from azure .mgmt .core import ARMPipelineClient
1617from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
18+ from azure .mgmt .core .tools import get_arm_endpoints
1719
18- from . import models as _models
1920from ._configuration import ServiceFabricManagedClustersManagementClientConfiguration
20- from ._serialization import Deserializer , Serializer
21+ from ._utils . serialization import Deserializer , Serializer
2122from .operations import (
2223 ApplicationTypeVersionsOperations ,
2324 ApplicationTypesOperations ,
4344class ServiceFabricManagedClustersManagementClient : # pylint: disable=too-many-instance-attributes,name-too-long
4445 """Service Fabric Managed Clusters Management Client.
4546
47+ :ivar operations: Operations operations
48+ :vartype operations: azure.mgmt.servicefabricmanagedclusters.operations.Operations
49+ :ivar applications: ApplicationsOperations operations
50+ :vartype applications:
51+ azure.mgmt.servicefabricmanagedclusters.operations.ApplicationsOperations
4652 :ivar application_types: ApplicationTypesOperations operations
4753 :vartype application_types:
4854 azure.mgmt.servicefabricmanagedclusters.operations.ApplicationTypesOperations
4955 :ivar application_type_versions: ApplicationTypeVersionsOperations operations
5056 :vartype application_type_versions:
5157 azure.mgmt.servicefabricmanagedclusters.operations.ApplicationTypeVersionsOperations
52- :ivar applications: ApplicationsOperations operations
53- :vartype applications:
54- azure.mgmt.servicefabricmanagedclusters.operations.ApplicationsOperations
5558 :ivar services: ServicesOperations operations
5659 :vartype services: azure.mgmt.servicefabricmanagedclusters.operations.ServicesOperations
60+ :ivar managed_cluster_version: ManagedClusterVersionOperations operations
61+ :vartype managed_cluster_version:
62+ azure.mgmt.servicefabricmanagedclusters.operations.ManagedClusterVersionOperations
63+ :ivar managed_unsupported_vm_sizes: ManagedUnsupportedVMSizesOperations operations
64+ :vartype managed_unsupported_vm_sizes:
65+ azure.mgmt.servicefabricmanagedclusters.operations.ManagedUnsupportedVMSizesOperations
5766 :ivar managed_clusters: ManagedClustersOperations operations
5867 :vartype managed_clusters:
5968 azure.mgmt.servicefabricmanagedclusters.operations.ManagedClustersOperations
6069 :ivar managed_az_resiliency_status: ManagedAzResiliencyStatusOperations operations
6170 :vartype managed_az_resiliency_status:
6271 azure.mgmt.servicefabricmanagedclusters.operations.ManagedAzResiliencyStatusOperations
63- :ivar managed_maintenance_window_status: ManagedMaintenanceWindowStatusOperations operations
64- :vartype managed_maintenance_window_status:
65- azure.mgmt.servicefabricmanagedclusters.operations.ManagedMaintenanceWindowStatusOperations
6672 :ivar managed_apply_maintenance_window: ManagedApplyMaintenanceWindowOperations operations
6773 :vartype managed_apply_maintenance_window:
6874 azure.mgmt.servicefabricmanagedclusters.operations.ManagedApplyMaintenanceWindowOperations
69- :ivar managed_cluster_version: ManagedClusterVersionOperations operations
70- :vartype managed_cluster_version:
71- azure.mgmt.servicefabricmanagedclusters.operations.ManagedClusterVersionOperations
72- :ivar managed_unsupported_vm_sizes: ManagedUnsupportedVMSizesOperations operations
73- :vartype managed_unsupported_vm_sizes:
74- azure.mgmt.servicefabricmanagedclusters.operations.ManagedUnsupportedVMSizesOperations
75- :ivar operation_status: OperationStatusOperations operations
76- :vartype operation_status:
77- azure.mgmt.servicefabricmanagedclusters.operations.OperationStatusOperations
78- :ivar operation_results: OperationResultsOperations operations
79- :vartype operation_results:
80- azure.mgmt.servicefabricmanagedclusters.operations.OperationResultsOperations
81- :ivar operations: Operations operations
82- :vartype operations: azure.mgmt.servicefabricmanagedclusters.operations.Operations
75+ :ivar managed_maintenance_window_status: ManagedMaintenanceWindowStatusOperations operations
76+ :vartype managed_maintenance_window_status:
77+ azure.mgmt.servicefabricmanagedclusters.operations.ManagedMaintenanceWindowStatusOperations
8378 :ivar node_types: NodeTypesOperations operations
8479 :vartype node_types: azure.mgmt.servicefabricmanagedclusters.operations.NodeTypesOperations
8580 :ivar node_type_skus: NodeTypeSkusOperations operations
8681 :vartype node_type_skus:
8782 azure.mgmt.servicefabricmanagedclusters.operations.NodeTypeSkusOperations
88- :param credential: Credential needed for the client to connect to Azure. Required.
83+ :ivar operation_results: OperationResultsOperations operations
84+ :vartype operation_results:
85+ azure.mgmt.servicefabricmanagedclusters.operations.OperationResultsOperations
86+ :ivar operation_status: OperationStatusOperations operations
87+ :vartype operation_status:
88+ azure.mgmt.servicefabricmanagedclusters.operations.OperationStatusOperations
89+ :param credential: Credential used to authenticate requests to the service. Required.
8990 :type credential: ~azure.core.credentials.TokenCredential
90- :param subscription_id: The customer subscription identifier . Required.
91+ :param subscription_id: The ID of the target subscription. The value must be an UUID . Required.
9192 :type subscription_id: str
92- :param base_url: Service URL . Default value is "https://management.azure.com" .
93+ :param base_url: Service host . Default value is None .
9394 :type base_url: str
94- :keyword api_version: Api Version. Default value is "2024-09-01-preview". Note that overriding
95- this default value may result in unsupported behavior.
95+ :keyword api_version: The API version to use for this operation. Default value is
96+ "2025-03-01-preview". Note that overriding this default value may result in unsupported
97+ behavior.
9698 :paramtype api_version: str
9799 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
98100 Retry-After header is present.
99101 """
100102
101103 def __init__ (
102- self ,
103- credential : "TokenCredential" ,
104- subscription_id : str ,
105- base_url : str = "https://management.azure.com" ,
106- ** kwargs : Any
104+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
107105 ) -> None :
106+ _endpoint = "{endpoint}"
107+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
108+ _endpoints = get_arm_endpoints (_cloud )
109+ if not base_url :
110+ base_url = _endpoints ["resource_manager" ]
111+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
108112 self ._config = ServiceFabricManagedClustersManagementClientConfiguration (
109- credential = credential , subscription_id = subscription_id , ** kwargs
113+ credential = credential ,
114+ subscription_id = subscription_id ,
115+ base_url = cast (str , base_url ),
116+ credential_scopes = credential_scopes ,
117+ ** kwargs
110118 )
119+
111120 _policies = kwargs .pop ("policies" , None )
112121 if _policies is None :
113122 _policies = [
@@ -126,55 +135,54 @@ def __init__(
126135 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
127136 self ._config .http_logging_policy ,
128137 ]
129- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
138+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , _endpoint ) , policies = _policies , ** kwargs )
130139
131- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
132- self ._serialize = Serializer (client_models )
133- self ._deserialize = Deserializer (client_models )
140+ self ._serialize = Serializer ()
141+ self ._deserialize = Deserializer ()
134142 self ._serialize .client_side_validation = False
143+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
144+ self .applications = ApplicationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
135145 self .application_types = ApplicationTypesOperations (
136146 self ._client , self ._config , self ._serialize , self ._deserialize
137147 )
138148 self .application_type_versions = ApplicationTypeVersionsOperations (
139149 self ._client , self ._config , self ._serialize , self ._deserialize
140150 )
141- self .applications = ApplicationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
142151 self .services = ServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
143- self .managed_clusters = ManagedClustersOperations (
152+ self .managed_cluster_version = ManagedClusterVersionOperations (
144153 self ._client , self ._config , self ._serialize , self ._deserialize
145154 )
146- self .managed_az_resiliency_status = ManagedAzResiliencyStatusOperations (
155+ self .managed_unsupported_vm_sizes = ManagedUnsupportedVMSizesOperations (
147156 self ._client , self ._config , self ._serialize , self ._deserialize
148157 )
149- self .managed_maintenance_window_status = ManagedMaintenanceWindowStatusOperations (
158+ self .managed_clusters = ManagedClustersOperations (
150159 self ._client , self ._config , self ._serialize , self ._deserialize
151160 )
152- self .managed_apply_maintenance_window = ManagedApplyMaintenanceWindowOperations (
161+ self .managed_az_resiliency_status = ManagedAzResiliencyStatusOperations (
153162 self ._client , self ._config , self ._serialize , self ._deserialize
154163 )
155- self .managed_cluster_version = ManagedClusterVersionOperations (
164+ self .managed_apply_maintenance_window = ManagedApplyMaintenanceWindowOperations (
156165 self ._client , self ._config , self ._serialize , self ._deserialize
157166 )
158- self .managed_unsupported_vm_sizes = ManagedUnsupportedVMSizesOperations (
167+ self .managed_maintenance_window_status = ManagedMaintenanceWindowStatusOperations (
159168 self ._client , self ._config , self ._serialize , self ._deserialize
160169 )
161- self .operation_status = OperationStatusOperations (
170+ self .node_types = NodeTypesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
171+ self .node_type_skus = NodeTypeSkusOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
172+ self .operation_results = OperationResultsOperations (
162173 self ._client , self ._config , self ._serialize , self ._deserialize
163174 )
164- self .operation_results = OperationResultsOperations (
175+ self .operation_status = OperationStatusOperations (
165176 self ._client , self ._config , self ._serialize , self ._deserialize
166177 )
167- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
168- self .node_types = NodeTypesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
169- self .node_type_skus = NodeTypeSkusOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
170178
171- def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
179+ def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
172180 """Runs the network request through the client's chained policies.
173181
174182 >>> from azure.core.rest import HttpRequest
175183 >>> request = HttpRequest("GET", "https://www.example.org/")
176184 <HttpRequest [GET], url: 'https://www.example.org/'>
177- >>> response = client._send_request (request)
185+ >>> response = client.send_request (request)
178186 <HttpResponse: 200 OK>
179187
180188 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -187,7 +195,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
187195 """
188196
189197 request_copy = deepcopy (request )
190- request_copy .url = self ._client .format_url (request_copy .url )
198+ path_format_arguments = {
199+ "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
200+ }
201+
202+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
191203 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
192204
193205 def close (self ) -> None :
0 commit comments