Skip to content

Commit 7a21c0e

Browse files
committed
Generated python SDK
1 parent ba40bac commit 7a21c0e

File tree

114 files changed

+7464
-4423
lines changed

Some content is hidden

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

114 files changed

+7464
-4423
lines changed

src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/_configuration.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import Any, TYPE_CHECKING
9+
from typing import Any, Optional, TYPE_CHECKING
1010

1111
from azure.core.pipeline import policies
1212
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1313

1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17+
from azure.core import AzureClouds
1718
from azure.core.credentials import TokenCredential
1819

1920

@@ -27,13 +28,22 @@ class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instanc
2728
:type credential: ~azure.core.credentials.TokenCredential
2829
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
2930
:type subscription_id: str
30-
:keyword api_version: Api Version. Default value is "2025-05-01-preview". Note that overriding
31+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
32+
None.
33+
:type cloud_setting: ~azure.core.AzureClouds
34+
:keyword api_version: Api Version. Default value is "2025-11-01-preview". Note that overriding
3135
this default value may result in unsupported behavior.
3236
:paramtype api_version: str
3337
"""
3438

35-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36-
api_version: str = kwargs.pop("api_version", "2025-05-01-preview")
39+
def __init__(
40+
self,
41+
credential: "TokenCredential",
42+
subscription_id: str,
43+
cloud_setting: Optional["AzureClouds"] = None,
44+
**kwargs: Any
45+
) -> None:
46+
api_version: str = kwargs.pop("api_version", "2025-11-01-preview")
3747

3848
if credential is None:
3949
raise ValueError("Parameter 'credential' must not be None.")
@@ -42,6 +52,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4252

4353
self.credential = credential
4454
self.subscription_id = subscription_id
55+
self.cloud_setting = cloud_setting
4556
self.api_version = api_version
4657
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4758
kwargs.setdefault("sdk_moniker", "mgmt-cosmosdb/{}".format(VERSION))

src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/_cosmos_db_management_client.py

Lines changed: 47 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
FleetOperations,
3939
FleetspaceAccountOperations,
4040
FleetspaceOperations,
41+
GarnetClustersOperations,
4142
GraphResourcesOperations,
4243
GremlinResourcesOperations,
4344
LocationsOperations,
@@ -75,12 +76,15 @@
7576
)
7677

7778
if TYPE_CHECKING:
79+
from azure.core import AzureClouds
7880
from azure.core.credentials import TokenCredential
7981

8082

8183
class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes
82-
"""Azure Cosmos DB Chaos Fault REST API.
84+
"""Azure Cosmos DB Role Based Access Control Resource Provider REST API.
8385
86+
:ivar cassandra_resources: CassandraResourcesOperations operations
87+
:vartype cassandra_resources: azure.mgmt.cosmosdb.operations.CassandraResourcesOperations
8488
:ivar chaos_fault: ChaosFaultOperations operations
8589
:vartype chaos_fault: azure.mgmt.cosmosdb.operations.ChaosFaultOperations
8690
:ivar copy_jobs: CopyJobsOperations operations
@@ -123,18 +127,28 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes
123127
:vartype mongo_db_resources: azure.mgmt.cosmosdb.operations.MongoDBResourcesOperations
124128
:ivar table_resources: TableResourcesOperations operations
125129
:vartype table_resources: azure.mgmt.cosmosdb.operations.TableResourcesOperations
126-
:ivar cassandra_resources: CassandraResourcesOperations operations
127-
:vartype cassandra_resources: azure.mgmt.cosmosdb.operations.CassandraResourcesOperations
128130
:ivar gremlin_resources: GremlinResourcesOperations operations
129131
:vartype gremlin_resources: azure.mgmt.cosmosdb.operations.GremlinResourcesOperations
130132
:ivar locations: LocationsOperations operations
131133
:vartype locations: azure.mgmt.cosmosdb.operations.LocationsOperations
132134
:ivar data_transfer_jobs: DataTransferJobsOperations operations
133135
:vartype data_transfer_jobs: azure.mgmt.cosmosdb.operations.DataTransferJobsOperations
136+
:ivar fleet: FleetOperations operations
137+
:vartype fleet: azure.mgmt.cosmosdb.operations.FleetOperations
138+
:ivar fleet_analytics: FleetAnalyticsOperations operations
139+
:vartype fleet_analytics: azure.mgmt.cosmosdb.operations.FleetAnalyticsOperations
140+
:ivar fleetspace: FleetspaceOperations operations
141+
:vartype fleetspace: azure.mgmt.cosmosdb.operations.FleetspaceOperations
142+
:ivar fleetspace_account: FleetspaceAccountOperations operations
143+
:vartype fleetspace_account: azure.mgmt.cosmosdb.operations.FleetspaceAccountOperations
144+
:ivar garnet_clusters: GarnetClustersOperations operations
145+
:vartype garnet_clusters: azure.mgmt.cosmosdb.operations.GarnetClustersOperations
134146
:ivar cassandra_clusters: CassandraClustersOperations operations
135147
:vartype cassandra_clusters: azure.mgmt.cosmosdb.operations.CassandraClustersOperations
136148
:ivar cassandra_data_centers: CassandraDataCentersOperations operations
137149
:vartype cassandra_data_centers: azure.mgmt.cosmosdb.operations.CassandraDataCentersOperations
150+
:ivar mongo_mi_resources: MongoMIResourcesOperations operations
151+
:vartype mongo_mi_resources: azure.mgmt.cosmosdb.operations.MongoMIResourcesOperations
138152
:ivar network_security_perimeter_configurations:
139153
NetworkSecurityPerimeterConfigurationsOperations operations
140154
:vartype network_security_perimeter_configurations:
@@ -193,39 +207,42 @@ class CosmosDBManagementClient: # pylint: disable=too-many-instance-attributes
193207
:ivar throughput_pool_account: ThroughputPoolAccountOperations operations
194208
:vartype throughput_pool_account:
195209
azure.mgmt.cosmosdb.operations.ThroughputPoolAccountOperations
196-
:ivar mongo_mi_resources: MongoMIResourcesOperations operations
197-
:vartype mongo_mi_resources: azure.mgmt.cosmosdb.operations.MongoMIResourcesOperations
198-
:ivar fleet: FleetOperations operations
199-
:vartype fleet: azure.mgmt.cosmosdb.operations.FleetOperations
200-
:ivar fleet_analytics: FleetAnalyticsOperations operations
201-
:vartype fleet_analytics: azure.mgmt.cosmosdb.operations.FleetAnalyticsOperations
202-
:ivar fleetspace: FleetspaceOperations operations
203-
:vartype fleetspace: azure.mgmt.cosmosdb.operations.FleetspaceOperations
204-
:ivar fleetspace_account: FleetspaceAccountOperations operations
205-
:vartype fleetspace_account: azure.mgmt.cosmosdb.operations.FleetspaceAccountOperations
206210
:param credential: Credential needed for the client to connect to Azure. Required.
207211
:type credential: ~azure.core.credentials.TokenCredential
208212
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
209213
:type subscription_id: str
210214
:param base_url: Service URL. Default value is None.
211215
:type base_url: str
212-
:keyword api_version: Api Version. Default value is "2025-05-01-preview". Note that overriding
216+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
217+
None.
218+
:paramtype cloud_setting: ~azure.core.AzureClouds
219+
:keyword api_version: Api Version. Default value is "2025-11-01-preview". Note that overriding
213220
this default value may result in unsupported behavior.
214221
:paramtype api_version: str
215222
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
216223
Retry-After header is present.
217224
"""
218225

219226
def __init__(
220-
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
227+
self,
228+
credential: "TokenCredential",
229+
subscription_id: str,
230+
base_url: Optional[str] = None,
231+
*,
232+
cloud_setting: Optional["AzureClouds"] = None,
233+
**kwargs: Any
221234
) -> None:
222-
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
235+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
223236
_endpoints = get_arm_endpoints(_cloud)
224237
if not base_url:
225238
base_url = _endpoints["resource_manager"]
226239
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
227240
self._config = CosmosDBManagementClientConfiguration(
228-
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
241+
credential=credential,
242+
subscription_id=subscription_id,
243+
cloud_setting=cloud_setting,
244+
credential_scopes=credential_scopes,
245+
**kwargs
229246
)
230247

231248
_policies = kwargs.pop("policies", None)
@@ -252,6 +269,9 @@ def __init__(
252269
self._serialize = Serializer(client_models)
253270
self._deserialize = Deserializer(client_models)
254271
self._serialize.client_side_validation = False
272+
self.cassandra_resources = CassandraResourcesOperations(
273+
self._client, self._config, self._serialize, self._deserialize
274+
)
255275
self.chaos_fault = ChaosFaultOperations(self._client, self._config, self._serialize, self._deserialize)
256276
self.copy_jobs = CopyJobsOperations(self._client, self._config, self._serialize, self._deserialize)
257277
self.database_accounts = DatabaseAccountsOperations(
@@ -291,22 +311,29 @@ def __init__(
291311
self._client, self._config, self._serialize, self._deserialize
292312
)
293313
self.table_resources = TableResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
294-
self.cassandra_resources = CassandraResourcesOperations(
295-
self._client, self._config, self._serialize, self._deserialize
296-
)
297314
self.gremlin_resources = GremlinResourcesOperations(
298315
self._client, self._config, self._serialize, self._deserialize
299316
)
300317
self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize)
301318
self.data_transfer_jobs = DataTransferJobsOperations(
302319
self._client, self._config, self._serialize, self._deserialize
303320
)
321+
self.fleet = FleetOperations(self._client, self._config, self._serialize, self._deserialize)
322+
self.fleet_analytics = FleetAnalyticsOperations(self._client, self._config, self._serialize, self._deserialize)
323+
self.fleetspace = FleetspaceOperations(self._client, self._config, self._serialize, self._deserialize)
324+
self.fleetspace_account = FleetspaceAccountOperations(
325+
self._client, self._config, self._serialize, self._deserialize
326+
)
327+
self.garnet_clusters = GarnetClustersOperations(self._client, self._config, self._serialize, self._deserialize)
304328
self.cassandra_clusters = CassandraClustersOperations(
305329
self._client, self._config, self._serialize, self._deserialize
306330
)
307331
self.cassandra_data_centers = CassandraDataCentersOperations(
308332
self._client, self._config, self._serialize, self._deserialize
309333
)
334+
self.mongo_mi_resources = MongoMIResourcesOperations(
335+
self._client, self._config, self._serialize, self._deserialize
336+
)
310337
self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations(
311338
self._client, self._config, self._serialize, self._deserialize
312339
)
@@ -366,15 +393,6 @@ def __init__(
366393
self.throughput_pool_account = ThroughputPoolAccountOperations(
367394
self._client, self._config, self._serialize, self._deserialize
368395
)
369-
self.mongo_mi_resources = MongoMIResourcesOperations(
370-
self._client, self._config, self._serialize, self._deserialize
371-
)
372-
self.fleet = FleetOperations(self._client, self._config, self._serialize, self._deserialize)
373-
self.fleet_analytics = FleetAnalyticsOperations(self._client, self._config, self._serialize, self._deserialize)
374-
self.fleetspace = FleetspaceOperations(self._client, self._config, self._serialize, self._deserialize)
375-
self.fleetspace_account = FleetspaceAccountOperations(
376-
self._client, self._config, self._serialize, self._deserialize
377-
)
378396

379397
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
380398
"""Runs the network request through the client's chained policies.

src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/_utils/serialization.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import sys
2222
import codecs
2323
from typing import (
24-
Dict,
2524
Any,
2625
cast,
2726
Optional,
@@ -31,7 +30,6 @@
3130
Mapping,
3231
Callable,
3332
MutableMapping,
34-
List,
3533
)
3634

3735
try:
@@ -229,12 +227,12 @@ class Model:
229227
serialization and deserialization.
230228
"""
231229

232-
_subtype_map: Dict[str, Dict[str, Any]] = {}
233-
_attribute_map: Dict[str, Dict[str, Any]] = {}
234-
_validation: Dict[str, Dict[str, Any]] = {}
230+
_subtype_map: dict[str, dict[str, Any]] = {}
231+
_attribute_map: dict[str, dict[str, Any]] = {}
232+
_validation: dict[str, dict[str, Any]] = {}
235233

236234
def __init__(self, **kwargs: Any) -> None:
237-
self.additional_properties: Optional[Dict[str, Any]] = {}
235+
self.additional_properties: Optional[dict[str, Any]] = {}
238236
for k in kwargs: # pylint: disable=consider-using-dict-items
239237
if k not in self._attribute_map:
240238
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
@@ -311,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
311309
def as_dict(
312310
self,
313311
keep_readonly: bool = True,
314-
key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
312+
key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer,
315313
**kwargs: Any
316314
) -> JSON:
317315
"""Return a dict that can be serialized using json.dump.
@@ -380,7 +378,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self:
380378
def from_dict(
381379
cls,
382380
data: Any,
383-
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
381+
key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None,
384382
content_type: Optional[str] = None,
385383
) -> Self:
386384
"""Parse a dict using given key extractor return a model.
@@ -414,7 +412,7 @@ def _flatten_subtype(cls, key, objects):
414412
return {}
415413
result = dict(cls._subtype_map[key])
416414
for valuetype in cls._subtype_map[key].values():
417-
result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access
415+
result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access
418416
return result
419417

420418
@classmethod
@@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
528526
"[]": self.serialize_iter,
529527
"{}": self.serialize_dict,
530528
}
531-
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
529+
self.dependencies: dict[str, type] = dict(classes) if classes else {}
532530
self.key_transformer = full_restapi_key_transformer
533531
self.client_side_validation = True
534532

@@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to
579577

580578
if attr_name == "additional_properties" and attr_desc["key"] == "":
581579
if target_obj.additional_properties is not None:
582-
serialized.update(target_obj.additional_properties)
580+
serialized |= target_obj.additional_properties
583581
continue
584582
try:
585583

@@ -789,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs):
789787

790788
# If dependencies is empty, try with current data class
791789
# It has to be a subclass of Enum anyway
792-
enum_type = self.dependencies.get(data_type, data.__class__)
790+
enum_type = self.dependencies.get(data_type, cast(type, data.__class__))
793791
if issubclass(enum_type, Enum):
794792
return Serializer.serialize_enum(data, enum_obj=enum_type)
795793

@@ -1184,7 +1182,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen
11841182

11851183
while "." in key:
11861184
# Need the cast, as for some reasons "split" is typed as list[str | Any]
1187-
dict_keys = cast(List[str], _FLATTEN.split(key))
1185+
dict_keys = cast(list[str], _FLATTEN.split(key))
11881186
if len(dict_keys) == 1:
11891187
key = _decode_attribute_map_key(dict_keys[0])
11901188
break
@@ -1386,7 +1384,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
13861384
"duration": (isodate.Duration, datetime.timedelta),
13871385
"iso-8601": (datetime.datetime),
13881386
}
1389-
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
1387+
self.dependencies: dict[str, type] = dict(classes) if classes else {}
13901388
self.key_extractors = [rest_key_extractor, xml_key_extractor]
13911389
# Additional properties only works if the "rest_key_extractor" is used to
13921390
# extract the keys. Making it to work whatever the key extractor is too much

src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/aio/_configuration.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import Any, TYPE_CHECKING
9+
from typing import Any, Optional, TYPE_CHECKING
1010

1111
from azure.core.pipeline import policies
1212
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
1313

1414
from .._version import VERSION
1515

1616
if TYPE_CHECKING:
17+
from azure.core import AzureClouds
1718
from azure.core.credentials_async import AsyncTokenCredential
1819

1920

@@ -27,13 +28,22 @@ class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instanc
2728
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
2829
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
2930
:type subscription_id: str
30-
:keyword api_version: Api Version. Default value is "2025-05-01-preview". Note that overriding
31+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
32+
None.
33+
:type cloud_setting: ~azure.core.AzureClouds
34+
:keyword api_version: Api Version. Default value is "2025-11-01-preview". Note that overriding
3135
this default value may result in unsupported behavior.
3236
:paramtype api_version: str
3337
"""
3438

35-
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
36-
api_version: str = kwargs.pop("api_version", "2025-05-01-preview")
39+
def __init__(
40+
self,
41+
credential: "AsyncTokenCredential",
42+
subscription_id: str,
43+
cloud_setting: Optional["AzureClouds"] = None,
44+
**kwargs: Any
45+
) -> None:
46+
api_version: str = kwargs.pop("api_version", "2025-11-01-preview")
3747

3848
if credential is None:
3949
raise ValueError("Parameter 'credential' must not be None.")
@@ -42,6 +52,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k
4252

4353
self.credential = credential
4454
self.subscription_id = subscription_id
55+
self.cloud_setting = cloud_setting
4556
self.api_version = api_version
4657
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4758
kwargs.setdefault("sdk_moniker", "mgmt-cosmosdb/{}".format(VERSION))

0 commit comments

Comments
 (0)