Skip to content

Commit 7be173c

Browse files
author
SDKAuto
committed
CodeGen from PR 28957 in Azure/azure-rest-api-specs
Merge d89e28b92b4e7b10cd23d3972267eb50857f81c8 into 1ed0f496f998d7418ad9780813f7ef283a243e50
1 parent 7c624e0 commit 7be173c

File tree

354 files changed

+7467
-40045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

354 files changed

+7467
-40045
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "01a71545e82bb98b8137d3038150c436d46a59ed",
2+
"commit": "401d29f449b07b4173301a0536f6d89a8a25f9be",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.7.1",
7-
"@autorest/modelerfour@4.26.2"
6+
"@autorest/python@6.13.7",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
9+
"autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.13.7 --use=@autorest/modelerfour@4.27.0 --version=3.9.7 --version-tolerant=False",
1010
"readme": "specification/cosmos-db/resource-manager/readme.md"
1111
}

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1413

@@ -19,7 +18,7 @@
1918
from azure.core.credentials import TokenCredential
2019

2120

22-
class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
2322
"""Configuration for CosmosDBManagementClient.
2423
2524
Note that all parameters used to create this instance are saved as instance
@@ -29,14 +28,13 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t
2928
:type credential: ~azure.core.credentials.TokenCredential
3029
:param subscription_id: The ID of the target subscription. Required.
3130
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2024-02-15-preview". Note that overriding
33-
this default value may result in unsupported behavior.
31+
:keyword api_version: Api Version. Default value is "2024-05-15". Note that overriding this
32+
default value may result in unsupported behavior.
3433
:paramtype api_version: str
3534
"""
3635

3736
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2024-02-15-preview")
37+
api_version: str = kwargs.pop("api_version", "2024-05-15")
4038

4139
if credential is None:
4240
raise ValueError("Parameter 'credential' must not be None.")
@@ -48,6 +46,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4846
self.api_version = api_version
4947
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5048
kwargs.setdefault("sdk_moniker", "mgmt-cosmosdb/{}".format(VERSION))
49+
self.polling_interval = kwargs.get("polling_interval", 30)
5150
self._configure(**kwargs)
5251

5352
def _configure(self, **kwargs: Any) -> None:
@@ -56,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
5655
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
5756
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
5857
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6058
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6159
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
60+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6261
self.authentication_policy = kwargs.get("authentication_policy")
6362
if self.credential and not self.authentication_policy:
6463
self.authentication_policy = ARMChallengeAuthenticationPolicy(

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12+
from azure.core.pipeline import policies
1213
from azure.core.rest import HttpRequest, HttpResponse
1314
from azure.mgmt.core import ARMPipelineClient
15+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1416

1517
from . import models as _models
1618
from ._configuration import CosmosDBManagementClientConfiguration
@@ -23,14 +25,11 @@
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,
@@ -56,10 +55,6 @@
5655
ServiceOperations,
5756
SqlResourcesOperations,
5857
TableResourcesOperations,
59-
ThroughputPoolAccountOperations,
60-
ThroughputPoolAccountsOperations,
61-
ThroughputPoolOperations,
62-
ThroughputPoolsOperations,
6358
)
6459

6560
if 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

Comments
 (0)