Skip to content

Commit 0628caf

Browse files
author
SDKAuto
committed
CodeGen from PR 21327 in Azure/azure-rest-api-specs
Merge d299c8ac40e628e17ed00c5e2c571ef0b47bf3ef into 591b17c5a50e7fc0ef09211197279e6d9f7ebc22
1 parent ed691f3 commit 0628caf

File tree

56 files changed

+8669
-3275
lines changed

Some content is hidden

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

56 files changed

+8669
-3275
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"commit": "69236c863dad79dc8bd0ba644f1359e0927e4a7e",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.12.0",
5-
"@autorest/modelerfour@4.19.3"
6+
"@autorest/python@6.2.1",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "a1a224b54f05debfa94fd19477ed820c64f0f9fc",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/redisenterprise/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/redisenterprise/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] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/redisenterprise/resource-manager/readme.md"
1111
}

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['RedisEnterpriseManagementClient']
1413

15-
# `._patch.py` is used for handwritten extensions to the generated code
16-
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17-
from ._patch import patch_sdk
18-
patch_sdk()
14+
try:
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
17+
except ImportError:
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = [
22+
"RedisEnterpriseManagementClient",
23+
]
24+
__all__.extend([p for p in _patch_all if p not in __all__])
25+
26+
_patch_sdk()

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

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

9+
import sys
910
from typing import Any, TYPE_CHECKING
1011

1112
from azure.core.configuration import Configuration
@@ -14,55 +15,61 @@
1415

1516
from ._version import VERSION
1617

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+
1723
if TYPE_CHECKING:
1824
# pylint: disable=unused-import,ungrouped-imports
1925
from azure.core.credentials import TokenCredential
2026

2127

22-
class RedisEnterpriseManagementClientConfiguration(Configuration):
28+
class RedisEnterpriseManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2329
"""Configuration for RedisEnterpriseManagementClient.
2430
2531
Note that all parameters used to create this instance are saved as instance
2632
attributes.
2733
28-
:param credential: Credential needed for the client to connect to Azure.
34+
:param credential: Credential needed for the client to connect to Azure. Required.
2935
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The ID of the target subscription.
36+
:param subscription_id: The ID of the target subscription. Required.
3137
:type subscription_id: str
38+
:keyword api_version: Api Version. Default value is "2022-01-01". Note that overriding this
39+
default value may result in unsupported behavior.
40+
:paramtype api_version: str
3241
"""
3342

34-
def __init__(
35-
self,
36-
credential: "TokenCredential",
37-
subscription_id: str,
38-
**kwargs: Any
39-
) -> None:
43+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4044
super(RedisEnterpriseManagementClientConfiguration, self).__init__(**kwargs)
45+
api_version = kwargs.pop("api_version", "2022-01-01") # type: Literal["2022-01-01"]
46+
4147
if credential is None:
4248
raise ValueError("Parameter 'credential' must not be None.")
4349
if subscription_id is None:
4450
raise ValueError("Parameter 'subscription_id' must not be None.")
4551

4652
self.credential = credential
4753
self.subscription_id = subscription_id
48-
self.api_version = "2022-01-01"
49-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
50-
kwargs.setdefault('sdk_moniker', 'mgmt-redisenterprise/{}'.format(VERSION))
54+
self.api_version = api_version
55+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
56+
kwargs.setdefault("sdk_moniker", "mgmt-redisenterprise/{}".format(VERSION))
5157
self._configure(**kwargs)
5258

5359
def _configure(
54-
self,
55-
**kwargs # type: Any
60+
self, **kwargs # type: Any
5661
):
5762
# type: (...) -> None
58-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
59-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
60-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
61-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
62-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
63-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
64-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
65-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
66-
self.authentication_policy = kwargs.get('authentication_policy')
63+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
64+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
65+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
66+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
67+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
68+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
69+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
70+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
71+
self.authentication_policy = kwargs.get("authentication_policy")
6772
if self.credential and not self.authentication_policy:
68-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
73+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
74+
self.credential, *self.credential_scopes, **kwargs
75+
)

sdk/redisenterprise/azure-mgmt-redisenterprise/azure/mgmt/redisenterprise/_metadata.json

Lines changed: 0 additions & 107 deletions
This file was deleted.

sdk/redisenterprise/azure-mgmt-redisenterprise/azure/mgmt/redisenterprise/_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
# This file is used for handwritten extensions to the generated code. Example:
2929
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3030
def patch_sdk():
31-
pass
31+
pass

sdk/redisenterprise/azure-mgmt-redisenterprise/azure/mgmt/redisenterprise/_redis_enterprise_management_client.py

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,29 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, Optional, TYPE_CHECKING
10+
from typing import Any, TYPE_CHECKING
1111

1212
from azure.core.rest import HttpRequest, HttpResponse
1313
from azure.mgmt.core import ARMPipelineClient
14-
from msrest import Deserializer, Serializer
1514

1615
from . import models
1716
from ._configuration import RedisEnterpriseManagementClientConfiguration
18-
from .operations import DatabasesOperations, Operations, OperationsStatusOperations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, RedisEnterpriseOperations
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
DatabasesOperations,
20+
Operations,
21+
OperationsStatusOperations,
22+
PrivateEndpointConnectionsOperations,
23+
PrivateLinkResourcesOperations,
24+
RedisEnterpriseOperations,
25+
)
1926

2027
if TYPE_CHECKING:
2128
# pylint: disable=unused-import,ungrouped-imports
2229
from azure.core.credentials import TokenCredential
2330

24-
class RedisEnterpriseManagementClient:
31+
32+
class RedisEnterpriseManagementClient: # pylint: disable=client-accepts-api-version-keyword
2533
"""REST API for managing Redis Enterprise resources in Azure.
2634
2735
:ivar operations: Operations operations
@@ -38,12 +46,15 @@ class RedisEnterpriseManagementClient:
3846
:ivar private_link_resources: PrivateLinkResourcesOperations operations
3947
:vartype private_link_resources:
4048
azure.mgmt.redisenterprise.operations.PrivateLinkResourcesOperations
41-
:param credential: Credential needed for the client to connect to Azure.
49+
:param credential: Credential needed for the client to connect to Azure. Required.
4250
:type credential: ~azure.core.credentials.TokenCredential
43-
:param subscription_id: The ID of the target subscription.
51+
:param subscription_id: The ID of the target subscription. Required.
4452
:type subscription_id: str
45-
:param base_url: Service URL. Default value is 'https://management.azure.com'.
53+
:param base_url: Service URL. Default value is "https://management.azure.com".
4654
:type base_url: str
55+
:keyword api_version: Api Version. Default value is "2022-01-01". Note that overriding this
56+
default value may result in unsupported behavior.
57+
:paramtype api_version: str
4758
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4859
Retry-After header is present.
4960
"""
@@ -55,26 +66,31 @@ def __init__(
5566
base_url: str = "https://management.azure.com",
5667
**kwargs: Any
5768
) -> None:
58-
self._config = RedisEnterpriseManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
69+
self._config = RedisEnterpriseManagementClientConfiguration(
70+
credential=credential, subscription_id=subscription_id, **kwargs
71+
)
5972
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
6073

6174
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
6275
self._serialize = Serializer(client_models)
6376
self._deserialize = Deserializer(client_models)
6477
self._serialize.client_side_validation = False
6578
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
66-
self.operations_status = OperationsStatusOperations(self._client, self._config, self._serialize, self._deserialize)
67-
self.redis_enterprise = RedisEnterpriseOperations(self._client, self._config, self._serialize, self._deserialize)
79+
self.operations_status = OperationsStatusOperations(
80+
self._client, self._config, self._serialize, self._deserialize
81+
)
82+
self.redis_enterprise = RedisEnterpriseOperations(
83+
self._client, self._config, self._serialize, self._deserialize
84+
)
6885
self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize)
69-
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
70-
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
71-
72-
73-
def _send_request(
74-
self,
75-
request, # type: HttpRequest
76-
**kwargs: Any
77-
) -> HttpResponse:
86+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
87+
self._client, self._config, self._serialize, self._deserialize
88+
)
89+
self.private_link_resources = PrivateLinkResourcesOperations(
90+
self._client, self._config, self._serialize, self._deserialize
91+
)
92+
93+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
7894
"""Runs the network request through the client's chained policies.
7995
8096
>>> from azure.core.rest import HttpRequest
@@ -83,7 +99,7 @@ def _send_request(
8399
>>> response = client._send_request(request)
84100
<HttpResponse: 200 OK>
85101
86-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
102+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
87103
88104
:param request: The network request you want to make. Required.
89105
:type request: ~azure.core.rest.HttpRequest

0 commit comments

Comments
 (0)