Skip to content

Commit

Permalink
CodeGen from PR 24387 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge bd71ab605c43221b545ff2af517ebd6d2ca5884a into 1e8766756bb5c13fa573b0a33ab7d9438837c380
  • Loading branch information
SDKAuto committed Aug 31, 2023
1 parent af5e6cb commit e9703f2
Show file tree
Hide file tree
Showing 175 changed files with 8,504 additions and 4,317 deletions.
10 changes: 5 additions & 5 deletions sdk/cdn/azure-mgmt-cdn/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "e1da7cbab8d4f554484dedb676ba7bdbdf6cdf78",
"commit": "4d033b83e6ee8aa879013b8bacf2eb6a35e565ed",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"autorest": "3.9.7",
"use": [
"@autorest/python@6.1.11",
"@autorest/modelerfour@4.24.3"
"@autorest/python@6.7.1",
"@autorest/modelerfour@4.26.2"
],
"autorest_command": "autorest specification/cdn/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-2021-06 --use=@autorest/python@6.1.11 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/cdn/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",
"readme": "specification/cdn/resource-manager/readme.md"
}
6 changes: 4 additions & 2 deletions sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = ["CdnManagementClient"]
__all__ = [
"CdnManagementClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
21 changes: 7 additions & 14 deletions sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_cdn_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from . import models
from . import models as _models
from ._configuration import CdnManagementClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
Expand All @@ -38,7 +38,6 @@
RulesOperations,
SecretsOperations,
SecurityPoliciesOperations,
ValidateOperations,
)

if TYPE_CHECKING:
Expand Down Expand Up @@ -71,8 +70,6 @@ class CdnManagementClient(
:vartype security_policies: azure.mgmt.cdn.operations.SecurityPoliciesOperations
:ivar secrets: SecretsOperations operations
:vartype secrets: azure.mgmt.cdn.operations.SecretsOperations
:ivar validate: ValidateOperations operations
:vartype validate: azure.mgmt.cdn.operations.ValidateOperations
:ivar log_analytics: LogAnalyticsOperations operations
:vartype log_analytics: azure.mgmt.cdn.operations.LogAnalyticsOperations
:ivar profiles: ProfilesOperations operations
Expand Down Expand Up @@ -101,7 +98,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 "2021-06-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-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 All @@ -118,9 +115,9 @@ def __init__(
self._config = CdnManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
Expand All @@ -140,7 +137,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.secrets = SecretsOperations(self._client, self._config, self._serialize, self._deserialize)
self.validate = ValidateOperations(self._client, self._config, self._serialize, self._deserialize)
self.log_analytics = LogAnalyticsOperations(self._client, self._config, self._serialize, self._deserialize)
self.profiles = ProfilesOperations(self._client, self._config, self._serialize, self._deserialize)
self.endpoints = EndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
Expand Down Expand Up @@ -177,15 +173,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

def close(self):
# type: () -> None
def close(self) -> None:
self._client.close()

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

def __exit__(self, *exc_details):
# type: (Any) -> None
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
9 changes: 3 additions & 6 deletions sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class CdnManagementClientConfiguration(Configuration): # pylint: disable=too-ma
: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 "2021-06-01". Note that overriding this
:keyword api_version: Api Version. Default value is "2023-05-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:
super(CdnManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2021-06-01") # type: str
api_version: str = kwargs.pop("api_version", "2023-05-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -50,10 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
kwargs.setdefault("sdk_moniker", "mgmt-cdn/{}".format(VERSION))
self._configure(**kwargs)

def _configure(
self, **kwargs # type: Any
):
# type: (...) -> None
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
Expand Down
Loading

0 comments on commit e9703f2

Please sign in to comment.