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 NetAppManagementClientConfiguration
20
- from ._serialization import Deserializer , Serializer
22
+ from ._utils . serialization import Deserializer , Serializer
21
23
from .operations import (
22
24
AccountsOperations ,
23
25
BackupPoliciesOperations ,
26
28
BackupsUnderAccountOperations ,
27
29
BackupsUnderBackupVaultOperations ,
28
30
BackupsUnderVolumeOperations ,
31
+ BucketsOperations ,
29
32
NetAppResourceOperations ,
33
+ NetAppResourceQuotaLimitsAccountOperations ,
30
34
NetAppResourceQuotaLimitsOperations ,
31
35
NetAppResourceRegionInfosOperations ,
32
36
NetAppResourceUsagesOperations ,
@@ -79,6 +83,10 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
79
83
:vartype subvolumes: azure.mgmt.netapp.operations.SubvolumesOperations
80
84
:ivar backups: BackupsOperations operations
81
85
:vartype backups: azure.mgmt.netapp.operations.BackupsOperations
86
+ :ivar net_app_resource_quota_limits_account: NetAppResourceQuotaLimitsAccountOperations
87
+ operations
88
+ :vartype net_app_resource_quota_limits_account:
89
+ azure.mgmt.netapp.operations.NetAppResourceQuotaLimitsAccountOperations
82
90
:ivar backup_vaults: BackupVaultsOperations operations
83
91
:vartype backup_vaults: azure.mgmt.netapp.operations.BackupVaultsOperations
84
92
:ivar backups_under_backup_vault: BackupsUnderBackupVaultOperations operations
@@ -88,29 +96,33 @@ class NetAppManagementClient: # pylint: disable=too-many-instance-attributes
88
96
:vartype backups_under_volume: azure.mgmt.netapp.operations.BackupsUnderVolumeOperations
89
97
:ivar backups_under_account: BackupsUnderAccountOperations operations
90
98
:vartype backups_under_account: azure.mgmt.netapp.operations.BackupsUnderAccountOperations
99
+ :ivar buckets: BucketsOperations operations
100
+ :vartype buckets: azure.mgmt.netapp.operations.BucketsOperations
91
101
:param credential: Credential needed for the client to connect to Azure. Required.
92
102
:type credential: ~azure.core.credentials.TokenCredential
93
103
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
94
104
:type subscription_id: str
95
- :param base_url: Service URL. Default value is "https://management.azure.com" .
105
+ :param base_url: Service URL. Default value is None .
96
106
:type base_url: str
97
- :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this
98
- default value may result in unsupported behavior.
107
+ :keyword api_version: Api Version. Default value is "2025-01-01-preview ". Note that overriding
108
+ this default value may result in unsupported behavior.
99
109
:paramtype api_version: str
100
110
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
101
111
Retry-After header is present.
102
112
"""
103
113
104
114
def __init__ (
105
- self ,
106
- credential : "TokenCredential" ,
107
- subscription_id : str ,
108
- base_url : str = "https://management.azure.com" ,
109
- ** kwargs : Any
115
+ self , credential : "TokenCredential" , subscription_id : str , base_url : Optional [str ] = None , ** kwargs : Any
110
116
) -> None :
117
+ _cloud = kwargs .pop ("cloud_setting" , None ) or settings .current .azure_cloud # type: ignore
118
+ _endpoints = get_arm_endpoints (_cloud )
119
+ if not base_url :
120
+ base_url = _endpoints ["resource_manager" ]
121
+ credential_scopes = kwargs .pop ("credential_scopes" , _endpoints ["credential_scopes" ])
111
122
self ._config = NetAppManagementClientConfiguration (
112
- credential = credential , subscription_id = subscription_id , ** kwargs
123
+ credential = credential , subscription_id = subscription_id , credential_scopes = credential_scopes , ** kwargs
113
124
)
125
+
114
126
_policies = kwargs .pop ("policies" , None )
115
127
if _policies is None :
116
128
_policies = [
@@ -129,7 +141,7 @@ def __init__(
129
141
policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
130
142
self ._config .http_logging_policy ,
131
143
]
132
- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
144
+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = cast ( str , base_url ) , policies = _policies , ** kwargs )
133
145
134
146
client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
135
147
self ._serialize = Serializer (client_models )
@@ -160,6 +172,9 @@ def __init__(
160
172
self .volume_groups = VolumeGroupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
161
173
self .subvolumes = SubvolumesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
162
174
self .backups = BackupsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
175
+ self .net_app_resource_quota_limits_account = NetAppResourceQuotaLimitsAccountOperations (
176
+ self ._client , self ._config , self ._serialize , self ._deserialize
177
+ )
163
178
self .backup_vaults = BackupVaultsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
164
179
self .backups_under_backup_vault = BackupsUnderBackupVaultOperations (
165
180
self ._client , self ._config , self ._serialize , self ._deserialize
@@ -170,6 +185,7 @@ def __init__(
170
185
self .backups_under_account = BackupsUnderAccountOperations (
171
186
self ._client , self ._config , self ._serialize , self ._deserialize
172
187
)
188
+ self .buckets = BucketsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
173
189
174
190
def _send_request (self , request : HttpRequest , * , stream : bool = False , ** kwargs : Any ) -> HttpResponse :
175
191
"""Runs the network request through the client's chained policies.
0 commit comments