Skip to content

Commit a49d0ec

Browse files
author
SDKAuto
committed
CodeGen from PR 23406 in Azure/azure-rest-api-specs
Merge 036139db81d355316cd2346f3e0a5efd22f52c2e into ae5f241249f12e87e94e184ae5430518ac061a51
1 parent 8108e46 commit a49d0ec

File tree

77 files changed

+4872
-1374
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4872
-1374
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "21426cf85836ec17aaa4f20f58324a8666925e34",
2+
"commit": "1fdc3a2255dd1ebd234410a7d3671a9f4608ef95",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.2",
55
"use": [
6-
"@autorest/python@6.2.1",
6+
"@autorest/python@6.4.8",
77
"@autorest/[email protected]"
88
],
9-
"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/python@6.2.1 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
9+
"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/python@6.4.8 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/redis/resource-manager/readme.md"
1111
}

sdk/redis/azure-mgmt-redis/azure/mgmt/redis/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
try:
1515
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk

sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_configuration.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
109
from typing import Any, TYPE_CHECKING
1110

1211
from azure.core.configuration import Configuration
@@ -15,11 +14,6 @@
1514

1615
from ._version import VERSION
1716

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2317
if TYPE_CHECKING:
2418
# pylint: disable=unused-import,ungrouped-imports
2519
from azure.core.credentials import TokenCredential
@@ -33,17 +27,16 @@ class RedisManagementClientConfiguration(Configuration): # pylint: disable=too-
3327
3428
:param credential: Credential needed for the client to connect to Azure. Required.
3529
:type credential: ~azure.core.credentials.TokenCredential
36-
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
37-
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
30+
:param subscription_id: The ID of the target subscription. Required.
3831
:type subscription_id: str
39-
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
32+
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
4033
default value may result in unsupported behavior.
4134
:paramtype api_version: str
4235
"""
4336

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

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

60-
def _configure(
61-
self, **kwargs # type: Any
62-
):
63-
# type: (...) -> None
53+
def _configure(self, **kwargs: Any) -> None:
6454
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
6555
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
6656
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)

sdk/redis/azure-mgmt-redis/azure/mgmt/redis/_redis_management_client.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212
from azure.core.rest import HttpRequest, HttpResponse
1313
from azure.mgmt.core import ARMPipelineClient
1414

15-
from . import models
15+
from . import models as _models
1616
from ._configuration import RedisManagementClientConfiguration
1717
from ._serialization import Deserializer, Serializer
1818
from .operations import (
19+
AccessPolicyAssignmentOperations,
20+
AccessPolicyOperations,
1921
AsyncOperationStatusOperations,
2022
FirewallRulesOperations,
2123
LinkedServerOperations,
@@ -51,14 +53,17 @@ class RedisManagementClient: # pylint: disable=client-accepts-api-version-keywo
5153
:vartype private_link_resources: azure.mgmt.redis.operations.PrivateLinkResourcesOperations
5254
:ivar async_operation_status: AsyncOperationStatusOperations operations
5355
:vartype async_operation_status: azure.mgmt.redis.operations.AsyncOperationStatusOperations
56+
:ivar access_policy: AccessPolicyOperations operations
57+
:vartype access_policy: azure.mgmt.redis.operations.AccessPolicyOperations
58+
:ivar access_policy_assignment: AccessPolicyAssignmentOperations operations
59+
:vartype access_policy_assignment: azure.mgmt.redis.operations.AccessPolicyAssignmentOperations
5460
:param credential: Credential needed for the client to connect to Azure. Required.
5561
:type credential: ~azure.core.credentials.TokenCredential
56-
:param subscription_id: Gets subscription credentials which uniquely identify the Microsoft
57-
Azure subscription. The subscription ID forms part of the URI for every service call. Required.
62+
:param subscription_id: The ID of the target subscription. Required.
5863
:type subscription_id: str
5964
:param base_url: Service URL. Default value is "https://management.azure.com".
6065
:type base_url: str
61-
:keyword api_version: Api Version. Default value is "2022-06-01". Note that overriding this
66+
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
6267
default value may result in unsupported behavior.
6368
:paramtype api_version: str
6469
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -75,9 +80,9 @@ def __init__(
7580
self._config = RedisManagementClientConfiguration(
7681
credential=credential, subscription_id=subscription_id, **kwargs
7782
)
78-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
83+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
7984

80-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
85+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
8186
self._serialize = Serializer(client_models)
8287
self._deserialize = Deserializer(client_models)
8388
self._serialize.client_side_validation = False
@@ -95,6 +100,10 @@ def __init__(
95100
self.async_operation_status = AsyncOperationStatusOperations(
96101
self._client, self._config, self._serialize, self._deserialize
97102
)
103+
self.access_policy = AccessPolicyOperations(self._client, self._config, self._serialize, self._deserialize)
104+
self.access_policy_assignment = AccessPolicyAssignmentOperations(
105+
self._client, self._config, self._serialize, self._deserialize
106+
)
98107

99108
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
100109
"""Runs the network request through the client's chained policies.
@@ -118,15 +127,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
118127
request_copy.url = self._client.format_url(request_copy.url)
119128
return self._client.send_request(request_copy, **kwargs)
120129

121-
def close(self):
122-
# type: () -> None
130+
def close(self) -> None:
123131
self._client.close()
124132

125-
def __enter__(self):
126-
# type: () -> RedisManagementClient
133+
def __enter__(self) -> "RedisManagementClient":
127134
self._client.__enter__()
128135
return self
129136

130-
def __exit__(self, *exc_details):
131-
# type: (Any) -> None
137+
def __exit__(self, *exc_details: Any) -> None:
132138
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)