7
7
# --------------------------------------------------------------------------
8
8
9
9
from copy import deepcopy
10
- from typing import Any , TYPE_CHECKING
10
+ from typing import Any , Optional , TYPE_CHECKING , cast
11
11
from typing_extensions import Self
12
12
13
13
from azure .core .pipeline import policies
14
14
from azure .core .rest import HttpRequest , HttpResponse
15
+ from azure .core .settings import settings
15
16
from azure .mgmt .core import ARMPipelineClient
16
17
from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
18
+ from azure .mgmt .core .tools import get_arm_endpoints
17
19
18
20
from . import models as _models
19
21
from ._configuration import AppConfigurationManagementClientConfiguration
20
- from ._serialization import Deserializer , Serializer
22
+ from ._utils . serialization import Deserializer , Serializer
21
23
from .operations import (
22
24
ConfigurationStoresOperations ,
25
+ ExperimentationOperations ,
23
26
KeyValuesOperations ,
24
27
Operations ,
25
28
PrivateEndpointConnectionsOperations ,
29
32
)
30
33
31
34
if TYPE_CHECKING :
32
- # pylint: disable=unused-import,ungrouped-imports
33
35
from azure .core .credentials import TokenCredential
34
36
35
37
36
- class AppConfigurationManagementClient : # pylint: disable=client-accepts-api-version-keyword, too-many-instance-attributes
38
+ class AppConfigurationManagementClient : # pylint: disable=too-many-instance-attributes
37
39
"""AppConfigurationManagementClient.
38
40
39
41
:ivar configuration_stores: ConfigurationStoresOperations operations
@@ -53,29 +55,33 @@ class AppConfigurationManagementClient: # pylint: disable=client-accepts-api-ve
53
55
:vartype replicas: azure.mgmt.appconfiguration.operations.ReplicasOperations
54
56
:ivar snapshots: SnapshotsOperations operations
55
57
:vartype snapshots: azure.mgmt.appconfiguration.operations.SnapshotsOperations
58
+ :ivar experimentation: ExperimentationOperations operations
59
+ :vartype experimentation: azure.mgmt.appconfiguration.operations.ExperimentationOperations
56
60
:param credential: Credential needed for the client to connect to Azure. Required.
57
61
:type credential: ~azure.core.credentials.TokenCredential
58
62
:param subscription_id: The Microsoft Azure subscription ID. Required.
59
63
: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 .
61
65
: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.
64
68
:paramtype api_version: str
65
69
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
66
70
Retry-After header is present.
67
71
"""
68
72
69
73
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
75
75
) -> 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" ])
76
81
self ._config = AppConfigurationManagementClientConfiguration (
77
- credential = credential , subscription_id = subscription_id , ** kwargs
82
+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
78
83
)
84
+
79
85
_policies = kwargs .pop ("policies" , None )
80
86
if _policies is None :
81
87
_policies = [
@@ -94,7 +100,7 @@ def __init__(
94
100
policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
95
101
self ._config .http_logging_policy ,
96
102
]
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 )
98
104
99
105
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
100
106
self ._serialize = Serializer (client_models )
@@ -113,6 +119,7 @@ def __init__(
113
119
self .key_values = KeyValuesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
114
120
self .replicas = ReplicasOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
115
121
self .snapshots = SnapshotsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
122
+ self .experimentation = ExperimentationOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
116
123
117
124
def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
118
125
"""Runs the network request through the client's chained policies.
0 commit comments