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 InformaticaDataMgmtClientConfiguration
2021from ._serialization import Deserializer , Serializer
2122from .operations import Operations , OrganizationsOperations , ServerlessRuntimesOperations
2223
2324if TYPE_CHECKING :
24- # pylint: disable=unused-import,ungrouped-imports
2525 from azure .core .credentials import TokenCredential
2626
2727
28- class InformaticaDataMgmtClient : # pylint: disable=client-accepts-api-version-keyword
28+ class InformaticaDataMgmtClient :
2929 """InformaticaDataMgmtClient.
3030
3131 :ivar operations: Operations operations
@@ -35,29 +35,36 @@ class InformaticaDataMgmtClient: # pylint: disable=client-accepts-api-version-k
3535 :ivar serverless_runtimes: ServerlessRuntimesOperations operations
3636 :vartype serverless_runtimes:
3737 azure.mgmt.informaticadatamanagement.operations.ServerlessRuntimesOperations
38- :param credential: Credential needed for the client to connect to Azure . Required.
38+ :param credential: Credential used to authenticate requests to the service . Required.
3939 :type credential: ~azure.core.credentials.TokenCredential
40- :param subscription_id: The ID of the target subscription. Required.
40+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
4141 :type subscription_id: str
42- :param base_url: Service URL . Default value is "https://management.azure.com" .
42+ :param base_url: Service host . Default value is None .
4343 :type base_url: str
44- :keyword api_version: Api Version . Default value is "2024-05-08". Note that overriding this
45- default value may result in unsupported behavior.
44+ :keyword api_version: The API version to use for this operation . Default value is "2024-05-08".
45+ Note that overriding this default value may result in unsupported behavior.
4646 :paramtype api_version: str
4747 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4848 Retry-After header is present.
4949 """
5050
5151 def __init__ (
52- self ,
53- credential : "TokenCredential" ,
54- subscription_id : str ,
55- base_url : str = "https://management.azure.com" ,
56- ** kwargs : Any
52+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
5753 ) -> None :
54+ _endpoint = "{endpoint}"
55+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
56+ _endpoints = get_arm_endpoints (_cloud )
57+ if not base_url :
58+ base_url = _endpoints ["resource_manager" ]
59+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
5860 self ._config = InformaticaDataMgmtClientConfiguration (
59- credential = credential , subscription_id = subscription_id , ** kwargs
61+ credential = credential ,
62+ subscription_id = subscription_id ,
63+ base_url = cast (str , base_url ),
64+ credential_scopes = credential_scopes ,
65+ ** kwargs
6066 )
67+
6168 _policies = kwargs .pop ("policies" , None )
6269 if _policies is None :
6370 _policies = [
@@ -76,25 +83,24 @@ def __init__(
7683 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
7784 self ._config .http_logging_policy ,
7885 ]
79- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
86+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , _endpoint ) , policies = _policies , ** kwargs )
8087
81- client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
82- self ._serialize = Serializer (client_models )
83- self ._deserialize = Deserializer (client_models )
88+ self ._serialize = Serializer ()
89+ self ._deserialize = Deserializer ()
8490 self ._serialize .client_side_validation = False
8591 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
8692 self .organizations = OrganizationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
8793 self .serverless_runtimes = ServerlessRuntimesOperations (
8894 self ._client , self ._config , self ._serialize , self ._deserialize
8995 )
9096
91- 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 :
9298 """Runs the network request through the client's chained policies.
9399
94100 >>> from azure.core.rest import HttpRequest
95101 >>> request = HttpRequest("GET", "https://www.example.org/")
96102 <HttpRequest [GET], url: 'https://www.example.org/'>
97- >>> response = client._send_request (request)
103+ >>> response = client.send_request (request)
98104 <HttpResponse: 200 OK>
99105
100106 For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
@@ -107,7 +113,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
107113 """
108114
109115 request_copy = deepcopy (request )
110- request_copy .url = self ._client .format_url (request_copy .url )
116+ path_format_arguments = {
117+ "endpoint" : self ._serialize .url ("self._config.base_url" , self ._config .base_url , "str" , skip_quote = True ),
118+ }
119+
120+ request_copy .url = self ._client .format_url (request_copy .url , ** path_format_arguments )
111121 return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
112122
113123 def close (self ) -> None :
0 commit comments