99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
1111
12+ from azure .core .pipeline import policies
1213from azure .core .rest import HttpRequest , HttpResponse
1314from azure .mgmt .core import ARMPipelineClient
15+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1416
1517from . import models as _models
1618from ._configuration import CosmosDBManagementClientConfiguration
2325 CollectionPartitionOperations ,
2426 CollectionPartitionRegionOperations ,
2527 CollectionRegionOperations ,
26- DataTransferJobsOperations ,
2728 DatabaseAccountRegionOperations ,
2829 DatabaseAccountsOperations ,
2930 DatabaseOperations ,
30- GraphResourcesOperations ,
3131 GremlinResourcesOperations ,
3232 LocationsOperations ,
33- MongoClustersOperations ,
3433 MongoDBResourcesOperations ,
3534 NotebookWorkspacesOperations ,
3635 Operations ,
5655 ServiceOperations ,
5756 SqlResourcesOperations ,
5857 TableResourcesOperations ,
59- ThroughputPoolAccountOperations ,
60- ThroughputPoolAccountsOperations ,
61- ThroughputPoolOperations ,
62- ThroughputPoolsOperations ,
6358)
6459
6560if TYPE_CHECKING :
@@ -100,8 +95,6 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
10095 :ivar partition_key_range_id_region: PartitionKeyRangeIdRegionOperations operations
10196 :vartype partition_key_range_id_region:
10297 azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdRegionOperations
103- :ivar graph_resources: GraphResourcesOperations operations
104- :vartype graph_resources: azure.mgmt.cosmosdb.operations.GraphResourcesOperations
10598 :ivar sql_resources: SqlResourcesOperations operations
10699 :vartype sql_resources: azure.mgmt.cosmosdb.operations.SqlResourcesOperations
107100 :ivar mongo_db_resources: MongoDBResourcesOperations operations
@@ -114,14 +107,10 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
114107 :vartype gremlin_resources: azure.mgmt.cosmosdb.operations.GremlinResourcesOperations
115108 :ivar locations: LocationsOperations operations
116109 :vartype locations: azure.mgmt.cosmosdb.operations.LocationsOperations
117- :ivar data_transfer_jobs: DataTransferJobsOperations operations
118- :vartype data_transfer_jobs: azure.mgmt.cosmosdb.operations.DataTransferJobsOperations
119110 :ivar cassandra_clusters: CassandraClustersOperations operations
120111 :vartype cassandra_clusters: azure.mgmt.cosmosdb.operations.CassandraClustersOperations
121112 :ivar cassandra_data_centers: CassandraDataCentersOperations operations
122113 :vartype cassandra_data_centers: azure.mgmt.cosmosdb.operations.CassandraDataCentersOperations
123- :ivar mongo_clusters: MongoClustersOperations operations
124- :vartype mongo_clusters: azure.mgmt.cosmosdb.operations.MongoClustersOperations
125114 :ivar notebook_workspaces: NotebookWorkspacesOperations operations
126115 :vartype notebook_workspaces: azure.mgmt.cosmosdb.operations.NotebookWorkspacesOperations
127116 :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
@@ -166,24 +155,14 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
166155 azure.mgmt.cosmosdb.operations.RestorableTableResourcesOperations
167156 :ivar service: ServiceOperations operations
168157 :vartype service: azure.mgmt.cosmosdb.operations.ServiceOperations
169- :ivar throughput_pools: ThroughputPoolsOperations operations
170- :vartype throughput_pools: azure.mgmt.cosmosdb.operations.ThroughputPoolsOperations
171- :ivar throughput_pool: ThroughputPoolOperations operations
172- :vartype throughput_pool: azure.mgmt.cosmosdb.operations.ThroughputPoolOperations
173- :ivar throughput_pool_accounts: ThroughputPoolAccountsOperations operations
174- :vartype throughput_pool_accounts:
175- azure.mgmt.cosmosdb.operations.ThroughputPoolAccountsOperations
176- :ivar throughput_pool_account: ThroughputPoolAccountOperations operations
177- :vartype throughput_pool_account:
178- azure.mgmt.cosmosdb.operations.ThroughputPoolAccountOperations
179158 :param credential: Credential needed for the client to connect to Azure. Required.
180159 :type credential: ~azure.core.credentials.TokenCredential
181160 :param subscription_id: The ID of the target subscription. Required.
182161 :type subscription_id: str
183162 :param base_url: Service URL. Default value is "https://management.azure.com".
184163 :type base_url: str
185- :keyword api_version: Api Version. Default value is "2024-02 -15-preview ". Note that overriding
186- this default value may result in unsupported behavior.
164+ :keyword api_version: Api Version. Default value is "2024-05 -15". Note that overriding this
165+ default value may result in unsupported behavior.
187166 :paramtype api_version: str
188167 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
189168 Retry-After header is present.
@@ -199,7 +178,25 @@ def __init__(
199178 self ._config = CosmosDBManagementClientConfiguration (
200179 credential = credential , subscription_id = subscription_id , ** kwargs
201180 )
202- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
181+ _policies = kwargs .pop ("policies" , None )
182+ if _policies is None :
183+ _policies = [
184+ policies .RequestIdPolicy (** kwargs ),
185+ self ._config .headers_policy ,
186+ self ._config .user_agent_policy ,
187+ self ._config .proxy_policy ,
188+ policies .ContentDecodePolicy (** kwargs ),
189+ ARMAutoResourceProviderRegistrationPolicy (),
190+ self ._config .redirect_policy ,
191+ self ._config .retry_policy ,
192+ self ._config .authentication_policy ,
193+ self ._config .custom_hook_policy ,
194+ self ._config .logging_policy ,
195+ policies .DistributedTracingPolicy (** kwargs ),
196+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
197+ self ._config .http_logging_policy ,
198+ ]
199+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
203200
204201 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
205202 self ._serialize = Serializer (client_models )
@@ -236,7 +233,6 @@ def __init__(
236233 self .partition_key_range_id_region = PartitionKeyRangeIdRegionOperations (
237234 self ._client , self ._config , self ._serialize , self ._deserialize
238235 )
239- self .graph_resources = GraphResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
240236 self .sql_resources = SqlResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
241237 self .mongo_db_resources = MongoDBResourcesOperations (
242238 self ._client , self ._config , self ._serialize , self ._deserialize
@@ -249,16 +245,12 @@ def __init__(
249245 self ._client , self ._config , self ._serialize , self ._deserialize
250246 )
251247 self .locations = LocationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
252- self .data_transfer_jobs = DataTransferJobsOperations (
253- self ._client , self ._config , self ._serialize , self ._deserialize
254- )
255248 self .cassandra_clusters = CassandraClustersOperations (
256249 self ._client , self ._config , self ._serialize , self ._deserialize
257250 )
258251 self .cassandra_data_centers = CassandraDataCentersOperations (
259252 self ._client , self ._config , self ._serialize , self ._deserialize
260253 )
261- self .mongo_clusters = MongoClustersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
262254 self .notebook_workspaces = NotebookWorkspacesOperations (
263255 self ._client , self ._config , self ._serialize , self ._deserialize
264256 )
@@ -305,18 +297,8 @@ def __init__(
305297 self ._client , self ._config , self ._serialize , self ._deserialize
306298 )
307299 self .service = ServiceOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
308- self .throughput_pools = ThroughputPoolsOperations (
309- self ._client , self ._config , self ._serialize , self ._deserialize
310- )
311- self .throughput_pool = ThroughputPoolOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
312- self .throughput_pool_accounts = ThroughputPoolAccountsOperations (
313- self ._client , self ._config , self ._serialize , self ._deserialize
314- )
315- self .throughput_pool_account = ThroughputPoolAccountOperations (
316- self ._client , self ._config , self ._serialize , self ._deserialize
317- )
318300
319- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
301+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
320302 """Runs the network request through the client's chained policies.
321303
322304 >>> from azure.core.rest import HttpRequest
@@ -336,7 +318,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
336318
337319 request_copy = deepcopy (request )
338320 request_copy .url = self ._client .format_url (request_copy .url )
339- return self ._client .send_request (request_copy , ** kwargs )
321+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
340322
341323 def close (self ) -> None :
342324 self ._client .close ()
0 commit comments