Skip to content

Commit

Permalink
[AutoRelease] t2-cosmosdb-2024-09-11-21177(can only be merged by SDK …
Browse files Browse the repository at this point in the history
…owner) (#37286)

* code and test

* update-testcase

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <v-chenjiang@microsoft.com>
Co-authored-by: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 18, 2024
1 parent 754bb7f commit 6db5edb
Show file tree
Hide file tree
Showing 366 changed files with 11,797 additions and 2,673 deletions.
12 changes: 12 additions & 0 deletions sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release History

## 9.6.0 (2024-09-18)

### Features Added

- Model `ResourceRestoreParameters` added property `restore_with_ttl_disabled`
- Model `RestoreParameters` added parameter `restore_with_ttl_disabled` in method `__init__`
- Model `RestoreParametersBase` added property `restore_with_ttl_disabled`
- Enum `ServerVersion` added member `SEVEN0`
- Added model `ErrorAdditionalInfo`
- Added model `ErrorDetail`
- Added model `ErrorResponseAutoGenerated`

## 9.5.1 (2024-06-19)

### Features Added
Expand Down
6 changes: 3 additions & 3 deletions sdk/cosmos/azure-mgmt-cosmosdb/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "f1546dc981fa5d164d7ecd13588520457462c22c",
"commit": "3519c80fe510a268f6e59a29ccac8a53fdec15b6",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.13.19",
"@autorest/python@6.19.0",
"@autorest/modelerfour@4.27.0"
],
"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 --tag=package-2024-05 --use=@autorest/python@6.13.19 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-2024-08 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/cosmos-db/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instanc
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-05-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-08-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2024-05-15")
api_version: str = kwargs.pop("api_version", "2024-08-15")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand Down Expand Up @@ -161,7 +162,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2024-05-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-08-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -323,7 +324,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "CosmosDBManagementClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def _json_attemp(data):
# context otherwise.
_LOGGER.critical("Wasn't XML not JSON, failing")
raise DeserializationError("XML is invalid") from err
elif content_type.startswith("text/"):
return data_as_str
raise DeserializationError("Cannot deserialize content-type: {}".format(content_type))

@classmethod
Expand Down
16 changes: 0 additions & 16 deletions sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_vendor.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "9.5.1"
VERSION = "9.6.0"
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instanc
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-05-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-08-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
api_version: str = kwargs.pop("api_version", "2024-05-15")
api_version: str = kwargs.pop("api_version", "2024-08-15")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import AsyncHttpResponse, HttpRequest
Expand Down Expand Up @@ -164,7 +165,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2024-05-15". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-08-15". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -328,7 +329,7 @@ def _send_request(
async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "CosmosDBManagementClient":
async def __aenter__(self) -> Self:
await self._client.__aenter__()
return self

Expand Down
Loading

0 comments on commit 6db5edb

Please sign in to comment.