Skip to content

Commit 39d0294

Browse files
author
SDKAuto
committed
CodeGen from PR 25326 in Azure/azure-rest-api-specs
Merge f6764bc463299cc6e3ce59d6a7dd7b7121bb2d6a into def187e2e78d7173d8fdd7f77740dd9719e1dfbf
1 parent 9f5b594 commit 39d0294

File tree

292 files changed

+1377
-840
lines changed

Some content is hidden

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

292 files changed

+1377
-840
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "e5d8bf380ef60a6a283ba81fd0ce4bc0e49e6680",
2+
"commit": "3ed88c98178b22e98eb98637c4b31db97d4e5da1",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.6.0",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.7.1",
7+
"@autorest/modelerfour@4.26.2"
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.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --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.7.1 --use=@autorest/modelerfour@4.26.2 --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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-03-15-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2023-09-15-preview". Note that overriding
3333
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-03-15-preview")
39+
api_version: str = kwargs.pop("api_version", "2023-09-15-preview")
4040

4141
if credential is None:
4242
raise ValueError("Parameter 'credential' must not be None.")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
168168
:type subscription_id: str
169169
:param base_url: Service URL. Default value is "https://management.azure.com".
170170
:type base_url: str
171-
:keyword api_version: Api Version. Default value is "2023-03-15-preview". Note that overriding
171+
:keyword api_version: Api Version. Default value is "2023-09-15-preview". Note that overriding
172172
this default value may result in unsupported behavior.
173173
:paramtype api_version: str
174174
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
662662
_serialized.update(_new_attr) # type: ignore
663663
_new_attr = _new_attr[k] # type: ignore
664664
_serialized = _serialized[k]
665-
except ValueError:
666-
continue
665+
except ValueError as err:
666+
if isinstance(err, SerializationError):
667+
raise
667668

668669
except (AttributeError, KeyError, TypeError) as err:
669670
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
@@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs):
741742
742743
:param data: The data to be serialized.
743744
:param str data_type: The type to be serialized from.
745+
:keyword bool skip_quote: Whether to skip quote the serialized result.
746+
Defaults to False.
744747
:rtype: str
745748
:raises: TypeError if serialization fails.
746749
:raises: ValueError if data is None
@@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs):
749752
# Treat the list aside, since we don't want to encode the div separator
750753
if data_type.startswith("["):
751754
internal_data_type = data_type[1:-1]
752-
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
753-
if not kwargs.get("skip_quote", False):
754-
data = [quote(str(d), safe="") for d in data]
755-
return str(self.serialize_iter(data, internal_data_type, **kwargs))
755+
do_quote = not kwargs.get("skip_quote", False)
756+
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))
756757

757758
# Not a list, regular serialization
758759
output = self.serialize_data(data, data_type, **kwargs)
@@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
891892
not be None or empty.
892893
:param str div: If set, this str will be used to combine the elements
893894
in the iterable into a combined string. Default is 'None'.
895+
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
896+
Defaults to False.
894897
:rtype: list, str
895898
"""
896899
if isinstance(data, str):
@@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
903906
for d in data:
904907
try:
905908
serialized.append(self.serialize_data(d, iter_type, **kwargs))
906-
except ValueError:
909+
except ValueError as err:
910+
if isinstance(err, SerializationError):
911+
raise
907912
serialized.append(None)
908913

914+
if kwargs.get("do_quote", False):
915+
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
916+
909917
if div:
910918
serialized = ["" if s is None else str(s) for s in serialized]
911919
serialized = div.join(serialized)
@@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
950958
for key, value in attr.items():
951959
try:
952960
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
953-
except ValueError:
961+
except ValueError as err:
962+
if isinstance(err, SerializationError):
963+
raise
954964
serialized[self.serialize_unicode(key)] = None
955965

956966
if "xml" in serialization_ctxt:

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

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

8-
from typing import List, cast
9-
108
from azure.core.pipeline.transport import HttpRequest
119

1210

@@ -16,15 +14,3 @@ def _convert_request(request, files=None):
1614
if files:
1715
request.set_formdata_body(files)
1816
return request
19-
20-
21-
def _format_url_section(template, **kwargs):
22-
components = template.split("/")
23-
while components:
24-
try:
25-
return template.format(**kwargs)
26-
except KeyError as key:
27-
# Need the cast, as for some reasons "split" is typed as list[str | Any]
28-
formatted_components = cast(List[str], template.split("/"))
29-
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
30-
template = "/".join(components)

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

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

9-
VERSION = "10.0.0b1"
9+
VERSION = "0.7.0"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t
2929
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3030
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-03-15-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2023-09-15-preview". Note that overriding
3333
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-03-15-preview")
39+
api_version: str = kwargs.pop("api_version", "2023-09-15-preview")
4040

4141
if credential is None:
4242
raise ValueError("Parameter 'credential' must not be None.")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
171171
:type subscription_id: str
172172
:param base_url: Service URL. Default value is "https://management.azure.com".
173173
:type base_url: str
174-
:keyword api_version: Api Version. Default value is "2023-03-15-preview". Note that overriding
174+
:keyword api_version: Api Version. Default value is "2023-09-15-preview". Note that overriding
175175
this default value may result in unsupported behavior.
176176
:paramtype api_version: str
177177
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ async def get_backup(
12231223
}
12241224

12251225
async def _deallocate_initial( # pylint: disable=inconsistent-return-statements
1226-
self, resource_group_name: str, cluster_name: str, **kwargs: Any
1226+
self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[bool] = None, **kwargs: Any
12271227
) -> None:
12281228
error_map = {
12291229
401: ClientAuthenticationError,
@@ -1243,6 +1243,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements
12431243
resource_group_name=resource_group_name,
12441244
cluster_name=cluster_name,
12451245
subscription_id=self._config.subscription_id,
1246+
x_ms_force_deallocate=x_ms_force_deallocate,
12461247
api_version=api_version,
12471248
template_url=self._deallocate_initial.metadata["url"],
12481249
headers=_headers,
@@ -1271,7 +1272,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements
12711272

12721273
@distributed_trace_async
12731274
async def begin_deallocate(
1274-
self, resource_group_name: str, cluster_name: str, **kwargs: Any
1275+
self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[bool] = None, **kwargs: Any
12751276
) -> AsyncLROPoller[None]:
12761277
"""Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will
12771278
deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do
@@ -1282,6 +1283,10 @@ async def begin_deallocate(
12821283
:type resource_group_name: str
12831284
:param cluster_name: Managed Cassandra cluster name. Required.
12841285
:type cluster_name: str
1286+
:param x_ms_force_deallocate: Force to deallocate a cluster of Cluster Type Production. Force
1287+
to deallocate a cluster of Cluster Type Production might cause data loss. Default value is
1288+
None.
1289+
:type x_ms_force_deallocate: bool
12851290
:keyword callable cls: A custom type or function that will be passed the direct response
12861291
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
12871292
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
@@ -1306,6 +1311,7 @@ async def begin_deallocate(
13061311
raw_result = await self._deallocate_initial( # type: ignore
13071312
resource_group_name=resource_group_name,
13081313
cluster_name=cluster_name,
1314+
x_ms_force_deallocate=x_ms_force_deallocate,
13091315
api_version=api_version,
13101316
cls=lambda x, y, z: x,
13111317
headers=_headers,

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
from ._models_py3 import BackupPolicy
2121
from ._models_py3 import BackupPolicyMigrationState
2222
from ._models_py3 import BackupResource
23-
from ._models_py3 import BackupResourceProperties
23+
from ._models_py3 import BackupSchedule
24+
from ._models_py3 import BaseCosmosDataTransferDataSourceSink
2425
from ._models_py3 import Capability
2526
from ._models_py3 import Capacity
2627
from ._models_py3 import CassandraClusterDataCenterNodeItem
@@ -336,19 +337,23 @@
336337
from ._cosmos_db_management_client_enums import AuthenticationMethod
337338
from ._cosmos_db_management_client_enums import BackupPolicyMigrationStatus
338339
from ._cosmos_db_management_client_enums import BackupPolicyType
340+
from ._cosmos_db_management_client_enums import BackupState
339341
from ._cosmos_db_management_client_enums import BackupStorageRedundancy
340342
from ._cosmos_db_management_client_enums import CheckNameAvailabilityReason
343+
from ._cosmos_db_management_client_enums import ClusterType
341344
from ._cosmos_db_management_client_enums import CompositePathSortOrder
342345
from ._cosmos_db_management_client_enums import ConflictResolutionMode
343346
from ._cosmos_db_management_client_enums import ConnectionState
344347
from ._cosmos_db_management_client_enums import ConnectorOffer
345348
from ._cosmos_db_management_client_enums import ContinuousTier
346349
from ._cosmos_db_management_client_enums import CreateMode
347350
from ._cosmos_db_management_client_enums import CreatedByType
351+
from ._cosmos_db_management_client_enums import CustomerManagedKeyStatus
348352
from ._cosmos_db_management_client_enums import DataTransferComponent
349353
from ._cosmos_db_management_client_enums import DataType
350354
from ._cosmos_db_management_client_enums import DatabaseAccountKind
351355
from ._cosmos_db_management_client_enums import DefaultConsistencyLevel
356+
from ._cosmos_db_management_client_enums import DefaultPriorityLevel
352357
from ._cosmos_db_management_client_enums import EnableFullTextQuery
353358
from ._cosmos_db_management_client_enums import IndexKind
354359
from ._cosmos_db_management_client_enums import IndexingMode
@@ -402,7 +407,8 @@
402407
"BackupPolicy",
403408
"BackupPolicyMigrationState",
404409
"BackupResource",
405-
"BackupResourceProperties",
410+
"BackupSchedule",
411+
"BaseCosmosDataTransferDataSourceSink",
406412
"Capability",
407413
"Capacity",
408414
"CassandraClusterDataCenterNodeItem",
@@ -717,19 +723,23 @@
717723
"AuthenticationMethod",
718724
"BackupPolicyMigrationStatus",
719725
"BackupPolicyType",
726+
"BackupState",
720727
"BackupStorageRedundancy",
721728
"CheckNameAvailabilityReason",
729+
"ClusterType",
722730
"CompositePathSortOrder",
723731
"ConflictResolutionMode",
724732
"ConnectionState",
725733
"ConnectorOffer",
726734
"ContinuousTier",
727735
"CreateMode",
728736
"CreatedByType",
737+
"CustomerManagedKeyStatus",
729738
"DataTransferComponent",
730739
"DataType",
731740
"DatabaseAccountKind",
732741
"DefaultConsistencyLevel",
742+
"DefaultPriorityLevel",
733743
"EnableFullTextQuery",
734744
"IndexKind",
735745
"IndexingMode",

0 commit comments

Comments
 (0)