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
1820from . import models as _models
1921from ._configuration import AppConfigurationManagementClientConfiguration
20- from ._serialization import Deserializer , Serializer
22+ from ._utils . serialization import Deserializer , Serializer
2123from .operations import (
2224 ConfigurationStoresOperations ,
25+ ExperimentationOperations ,
2326 KeyValuesOperations ,
2427 Operations ,
2528 PrivateEndpointConnectionsOperations ,
2932)
3033
3134if TYPE_CHECKING :
32- # pylint: disable=unused-import,ungrouped-imports
3335 from azure .core .credentials import TokenCredential
3436
3537
36- class AppConfigurationManagementClient : # pylint: disable=client-accepts-api-version-keyword, too-many-instance-attributes
38+ class AppConfigurationManagementClient : # pylint: disable=too-many-instance-attributes
3739 """AppConfigurationManagementClient.
3840
3941 :ivar configuration_stores: ConfigurationStoresOperations operations
@@ -53,29 +55,33 @@ class AppConfigurationManagementClient: # pylint: disable=client-accepts-api-ve
5355 :vartype replicas: azure.mgmt.appconfiguration.operations.ReplicasOperations
5456 :ivar snapshots: SnapshotsOperations operations
5557 :vartype snapshots: azure.mgmt.appconfiguration.operations.SnapshotsOperations
58+ :ivar experimentation: ExperimentationOperations operations
59+ :vartype experimentation: azure.mgmt.appconfiguration.operations.ExperimentationOperations
5660 :param credential: Credential needed for the client to connect to Azure. Required.
5761 :type credential: ~azure.core.credentials.TokenCredential
5862 :param subscription_id: The Microsoft Azure subscription ID. Required.
5963 :type subscription_id: str
60- :param base_url: Service URL. Default value is "https://management.azure.com" .
64+ :param base_url: Service URL. Default value is None .
6165 :type base_url: str
62- :keyword api_version: Api Version. Default value is "2024-05 -01". Note that overriding this
63- default value may result in unsupported behavior.
66+ :keyword api_version: Api Version. Default value is "2025-02 -01-preview ". Note that overriding
67+ this default value may result in unsupported behavior.
6468 :paramtype api_version: str
6569 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
6670 Retry-After header is present.
6771 """
6872
6973 def __init__ (
70- self ,
71- credential : "TokenCredential" ,
72- subscription_id : str ,
73- base_url : str = "https://management.azure.com" ,
74- ** kwargs : Any
74+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
7575 ) -> None :
76+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
77+ _endpoints = get_arm_endpoints (_cloud )
78+ if not base_url :
79+ base_url = _endpoints ["resource_manager" ]
80+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
7681 self ._config = AppConfigurationManagementClientConfiguration (
77- credential = credential , subscription_id = subscription_id , ** kwargs
82+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
7883 )
84+
7985 _policies = kwargs .pop ("policies" , None )
8086 if _policies is None :
8187 _policies = [
@@ -94,7 +100,7 @@ def __init__(
94100 policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
95101 self ._config .http_logging_policy ,
96102 ]
97- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
103+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
98104
99105 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
100106 self ._serialize = Serializer (client_models )
@@ -113,6 +119,7 @@ def __init__(
113119 self .key_values = KeyValuesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
114120 self .replicas = ReplicasOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
115121 self .snapshots = SnapshotsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
122+ self .experimentation = ExperimentationOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
116123
117124 def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
118125 """Runs the network request through the client's chained policies.
0 commit comments