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 0956344ac24745a481a108f858800cf6e9dc8254 into 1ad29756bd141a47cac770140105a706d065ae1b
  • Loading branch information
SDKAuto committed Sep 9, 2024
1 parent 078d616 commit 4866205
Show file tree
Hide file tree
Showing 224 changed files with 9,028 additions and 2,239 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": "ebec5263383dba169e7de0938cc855611317179f",
"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 All @@ -24,6 +25,7 @@
AFDOriginsOperations,
AFDProfilesOperations,
CdnManagementClientOperationsMixin,
CdnProfilesOperations,
CustomDomainsOperations,
EdgeNodesOperations,
EndpointsOperations,
Expand Down Expand Up @@ -90,6 +92,8 @@ class CdnManagementClient(
:vartype operations: azure.mgmt.cdn.operations.Operations
:ivar edge_nodes: EdgeNodesOperations operations
:vartype edge_nodes: azure.mgmt.cdn.operations.EdgeNodesOperations
:ivar cdn_profiles: CdnProfilesOperations operations
:vartype cdn_profiles: azure.mgmt.cdn.operations.CdnProfilesOperations
:ivar policies: PoliciesOperations operations
:vartype policies: azure.mgmt.cdn.operations.PoliciesOperations
:ivar managed_rule_sets: ManagedRuleSetsOperations operations
Expand All @@ -100,7 +104,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 @@ -166,6 +170,7 @@ def __init__(
self.resource_usage = ResourceUsageOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.edge_nodes = EdgeNodesOperations(self._client, self._config, self._serialize, self._deserialize)
self.cdn_profiles = CdnProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
self.policies = PoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_rule_sets = ManagedRuleSetsOperations(
self._client, self._config, self._serialize, self._deserialize
Expand Down Expand Up @@ -196,7 +201,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 All @@ -24,6 +25,7 @@
AFDOriginsOperations,
AFDProfilesOperations,
CdnManagementClientOperationsMixin,
CdnProfilesOperations,
CustomDomainsOperations,
EdgeNodesOperations,
EndpointsOperations,
Expand Down Expand Up @@ -90,6 +92,8 @@ class CdnManagementClient(
:vartype operations: azure.mgmt.cdn.aio.operations.Operations
:ivar edge_nodes: EdgeNodesOperations operations
:vartype edge_nodes: azure.mgmt.cdn.aio.operations.EdgeNodesOperations
:ivar cdn_profiles: CdnProfilesOperations operations
:vartype cdn_profiles: azure.mgmt.cdn.aio.operations.CdnProfilesOperations
:ivar policies: PoliciesOperations operations
:vartype policies: azure.mgmt.cdn.aio.operations.PoliciesOperations
:ivar managed_rule_sets: ManagedRuleSetsOperations operations
Expand All @@ -100,7 +104,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 @@ -166,6 +170,7 @@ def __init__(
self.resource_usage = ResourceUsageOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.edge_nodes = EdgeNodesOperations(self._client, self._config, self._serialize, self._deserialize)
self.cdn_profiles = CdnProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
self.policies = PoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_rule_sets = ManagedRuleSetsOperations(
self._client, self._config, self._serialize, self._deserialize
Expand Down Expand Up @@ -198,7 +203,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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ._resource_usage_operations import ResourceUsageOperations
from ._operations import Operations
from ._edge_nodes_operations import EdgeNodesOperations
from ._cdn_profiles_operations import CdnProfilesOperations
from ._policies_operations import PoliciesOperations
from ._managed_rule_sets_operations import ManagedRuleSetsOperations

Expand Down Expand Up @@ -54,6 +55,7 @@
"ResourceUsageOperations",
"Operations",
"EdgeNodesOperations",
"CdnProfilesOperations",
"PoliciesOperations",
"ManagedRuleSetsOperations",
]
Expand Down
Loading

0 comments on commit 4866205

Please sign in to comment.