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) Python Code Generator.
5+ # Code generated by Microsoft (R) AutoRest 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 ._configuration import HealthDataAIServicesMgmtClientConfiguration
19- from ._serialization import Deserializer , Serializer
20+ from . import models as _models
21+ from ._configuration import MicrosoftHealthDataAIServicesConfiguration
22+ from ._utils .serialization import Deserializer , Serializer
2023from .operations import DeidServicesOperations , Operations , PrivateEndpointConnectionsOperations , PrivateLinksOperations
2124
2225if TYPE_CHECKING :
2326 from azure .core .credentials import TokenCredential
2427
2528
26- class HealthDataAIServicesMgmtClient :
27- """HealthDataAIServicesMgmtClient .
29+ class MicrosoftHealthDataAIServices :
30+ """MicrosoftHealthDataAIServices .
2831
2932 :ivar operations: Operations operations
3033 :vartype operations: azure.mgmt.healthdataaiservices.operations.Operations
@@ -35,30 +38,31 @@ class HealthDataAIServicesMgmtClient:
3538 azure.mgmt.healthdataaiservices.operations.PrivateEndpointConnectionsOperations
3639 :ivar private_links: PrivateLinksOperations operations
3740 :vartype private_links: azure.mgmt.healthdataaiservices.operations.PrivateLinksOperations
38- :param credential: Credential used to authenticate requests to the service . Required.
41+ :param credential: Credential needed for the client to connect to Azure . Required.
3942 :type credential: ~azure.core.credentials.TokenCredential
4043 :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4144 :type subscription_id: str
42- :param base_url: Service host . Default value is "https://management.azure.com" .
45+ :param base_url: Service URL . Default value is None .
4346 :type base_url: str
44- :keyword api_version: The API version to use for this operation . Default value is "2024-09-20".
45- Note that overriding this default value may result in unsupported behavior.
47+ :keyword api_version: Api Version . Default value is "2024-09-20". Note that overriding this
48+ default value may result in unsupported behavior.
4649 :paramtype api_version: str
4750 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4851 Retry-After header is present.
4952 """
5053
5154 def __init__ (
52- self ,
53- credential : "TokenCredential" ,
54- subscription_id : str ,
55- base_url : str = "https://management.azure.com" ,
56- ** kwargs : Any
55+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
5756 ) -> None :
58- _endpoint = "{endpoint}"
59- self ._config = HealthDataAIServicesMgmtClientConfiguration (
60- credential = credential , subscription_id = subscription_id , base_url = base_url , ** kwargs
57+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
58+ _endpoints = get_arm_endpoints (_cloud )
59+ if not base_url :
60+ base_url = _endpoints ["resource_manager" ]
61+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
62+ self ._config = MicrosoftHealthDataAIServicesConfiguration (
63+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
6164 )
65+
6266 _policies = kwargs .pop ("policies" , None )
6367 if _policies is None :
6468 _policies = [
@@ -77,10 +81,11 @@ def __init__(
7781 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
7882 self ._config .http_logging_policy ,
7983 ]
80- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = _endpoint , policies = _policies , ** kwargs )
84+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
8185
82- self ._serialize = Serializer ()
83- self ._deserialize = Deserializer ()
86+ client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
87+ self ._serialize = Serializer (client_models )
88+ self ._deserialize = Deserializer (client_models )
8489 self ._serialize .client_side_validation = False
8590 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
8691 self .deid_services = DeidServicesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
@@ -89,13 +94,13 @@ def __init__(
8994 )
9095 self .private_links = PrivateLinksOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
9196
92- def send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
97+ def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
9398 """Runs the network request through the client's chained policies.
9499
95100 >>> from azure.core.rest import HttpRequest
96101 >>> request = HttpRequest("GET", "https://www.example.org/")
97102 <HttpRequest [GET], url: 'https://www.example.org/'>
98- >>> response = client.send_request (request)
103+ >>> response = client._send_request (request)
99104 <HttpResponse: 200 OK>
100105
101106 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -108,11 +113,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
108113 """
109114
110115 request_copy = deepcopy (request )
111- path_format_arguments = {
112- "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
113- }
114-
115- request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
116+ request_copy .url = self ._client .format_url (request_copy .url )
116117 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
117118
118119 def close (self ) -> None :
0 commit comments