Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-mgmt-cdn] Add new API version 2024-09-01 for Microsoft.Cdn #8311

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "b5a5e5a6592a94a57becffcb5163010a11a950d0",
"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
Loading