Skip to content

Commit

Permalink
CodeGen from PR 30309 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge fa779e499f1d45701e63c9f827d6e0f47eea7c9e into 5c26c3b83ddc9b459d6eece1b3495d2a56bffa5a
  • Loading branch information
SDKAuto committed Sep 27, 2024
1 parent a61273f commit f8177a8
Show file tree
Hide file tree
Showing 218 changed files with 8,854 additions and 2,241 deletions.
6 changes: 3 additions & 3 deletions sdk/cdn/azure-mgmt-cdn/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "de1f3772629b6f4d3ac01548a5f6d719bfb97c9e",
"commit": "80f8f5f175d9aa86f9368d052352854b7171705d",
"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/[email protected]"
],
"autorest_command": "autorest specification/cdn/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.13.19 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"autorest_command": "autorest specification/cdn/resource-manager/readme.md --generate-sample=True --generate-test=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.19.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/cdn/resource-manager/readme.md"
}
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 @@ -100,7 +101,7 @@ class CdnManagementClient(
: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-02-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-09-01". 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 @@ -196,7 +197,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
def close(self) -> None:
self._client.close()

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

Expand Down
4 changes: 2 additions & 2 deletions sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class CdnManagementClientConfiguration: # pylint: disable=too-many-instance-att
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Azure Subscription ID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-02-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-09-01". 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-02-01")
api_version: str = kwargs.pop("api_version", "2024-09-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
2 changes: 2 additions & 0 deletions sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_serialization.py
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
10 changes: 0 additions & 10 deletions sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from abc import ABC
from typing import TYPE_CHECKING

from azure.core.pipeline.transport import HttpRequest

from ._configuration import CdnManagementClientConfiguration

if TYPE_CHECKING:
Expand All @@ -19,14 +17,6 @@
from ._serialization import Deserializer, Serializer


def _convert_request(request, files=None):
data = request.content if not files else None
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
if files:
request.set_formdata_body(files)
return request


class CdnManagementClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

Expand Down
2 changes: 1 addition & 1 deletion sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_version.py
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 = "13.1.1"
VERSION = "2.0.0"
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 @@ -100,7 +101,7 @@ class CdnManagementClient(
: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-02-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-09-01". 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 @@ -198,7 +199,7 @@ def _send_request(
async def close(self) -> None:
await self._client.close()

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

Expand Down
4 changes: 2 additions & 2 deletions sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ class CdnManagementClientConfiguration: # pylint: disable=too-many-instance-att
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Azure Subscription ID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2024-02-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2024-09-01". 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-02-01")
api_version: str = kwargs.pop("api_version", "2024-09-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
2 changes: 0 additions & 2 deletions sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/_vendor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from abc import ABC
from typing import TYPE_CHECKING

from azure.core.pipeline.transport import HttpRequest

from ._configuration import CdnManagementClientConfiguration

if TYPE_CHECKING:
Expand Down
Loading

0 comments on commit f8177a8

Please sign in to comment.