Skip to content

Commit

Permalink
CodeGen from PR 22407 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 74991a250f3e5cc91855554b84a8655ef7bd1226 into b7a0f6fda90d2125a12e109e334e08956373592e
  • Loading branch information
SDKAuto committed Feb 3, 2023
1 parent 791643c commit 5b6a3b4
Show file tree
Hide file tree
Showing 36 changed files with 1,077 additions and 877 deletions.
6 changes: 3 additions & 3 deletions sdk/redis/azure-mgmt-redis/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "21426cf85836ec17aaa4f20f58324a8666925e34",
"commit": "21459b26539c4bdf8c30b84d74e6b3030d5d242a",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/[email protected].1",
"@autorest/[email protected].16",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/redis/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/[email protected].1 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/redis/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/[email protected].16 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/redis/resource-manager/readme.md"
}
2 changes: 1 addition & 1 deletion sdk/redis/azure-mgmt-redis/azure/mgmt/redis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

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
Expand Down
7 changes: 2 additions & 5 deletions sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RedisManagementClientConfiguration(Configuration): # pylint: disable=too-

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(RedisManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-06-01") # type: Literal["2022-06-01"]
api_version: Literal["2022-06-01"] = kwargs.pop("api_version", "2022-06-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -57,10 +57,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
kwargs.setdefault("sdk_moniker", "mgmt-redis/{}".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
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 RedisManagementClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
Expand Down Expand Up @@ -77,7 +77,7 @@ def __init__(
)
self._client = 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 Down Expand Up @@ -118,15 +118,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: () -> RedisManagementClient
def __enter__(self) -> "RedisManagementClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
def __exit__(self, *exc_details) -> None:
self._client.__exit__(*exc_details)
Loading

0 comments on commit 5b6a3b4

Please sign in to comment.