99# regenerated.
1010# --------------------------------------------------------------------------
1111
12- from typing import Any , Optional , TYPE_CHECKING
12+ from typing import Any , Optional , TYPE_CHECKING , cast
1313from typing_extensions import Self
1414
1515from azure .core .pipeline import policies
16+ from azure .core .settings import settings
1617from azure .mgmt .core import ARMPipelineClient
1718from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
19+ from azure .mgmt .core .tools import get_arm_endpoints
1820from azure .profiles import KnownProfiles , ProfileDefinition
1921from azure .profiles .multiapiclient import MultiApiClientMixin
2022
2123from ._configuration import KeyVaultManagementClientConfiguration
22- from ._serialization import Deserializer , Serializer
24+ from ._utils . serialization import Deserializer , Serializer
2325
2426if TYPE_CHECKING :
2527 # pylint: disable=unused-import,ungrouped-imports
2628 from azure .core .credentials import TokenCredential
2729
2830class _SDKClient (object ):
2931 def __init__ (self , * args , ** kwargs ):
30- """This is a fake class to support current implemetation of MultiApiClientMixin."
32+ """This is a fake class to support current implementation of MultiApiClientMixin."
3133 Will be removed in final version of multiapi azure-core based client
3234 """
3335 pass
@@ -70,13 +72,18 @@ def __init__(
7072 credential : "TokenCredential" ,
7173 subscription_id : str ,
7274 api_version : Optional [str ]= None ,
73- base_url : str = "https://management.azure.com" ,
75+ base_url : Optional [ str ] = None ,
7476 profile : KnownProfiles = KnownProfiles .default ,
7577 ** kwargs : Any
7678 ):
7779 if api_version :
7880 kwargs .setdefault ('api_version' , api_version )
79- self ._config = KeyVaultManagementClientConfiguration (credential , subscription_id , ** kwargs )
81+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
82+ _endpoints = get_arm_endpoints (_cloud )
83+ if not base_url :
84+ base_url = _endpoints ["resource_manager" ]
85+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
86+ self ._config = KeyVaultManagementClientConfiguration (credential , subscription_id , credential_scopes = credential_scopes , ** kwargs )
8087 _policies = kwargs .pop ("policies" , None )
8188 if _policies is None :
8289 _policies = [
@@ -95,7 +102,7 @@ def __init__(
95102 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
96103 self ._config .http_logging_policy ,
97104 ]
98- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
105+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
99106 super (KeyVaultManagementClient , self ).__init__ (
100107 api_version = api_version ,
101108 profile = profile
0 commit comments