6
6
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
# --------------------------------------------------------------------------
8
8
9
- from typing import TYPE_CHECKING
9
+ from copy import deepcopy
10
+ from typing import Any , Optional , TYPE_CHECKING
10
11
12
+ from azure .core .rest import HttpRequest , HttpResponse
11
13
from azure .mgmt .core import ARMPipelineClient
12
14
from msrest import Deserializer , Serializer
13
15
16
+ from . import models
17
+ from ._configuration import RedisEnterpriseManagementClientConfiguration
18
+ from .operations import DatabasesOperations , Operations , OperationsStatusOperations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations , RedisEnterpriseOperations
19
+
14
20
if TYPE_CHECKING :
15
21
# pylint: disable=unused-import,ungrouped-imports
16
- from typing import Any , Optional
17
-
18
22
from azure .core .credentials import TokenCredential
19
23
20
- from ._configuration import RedisEnterpriseManagementClientConfiguration
21
- from .operations import Operations
22
- from .operations import OperationsStatusOperations
23
- from .operations import RedisEnterpriseOperations
24
- from .operations import DatabasesOperations
25
- from .operations import PrivateEndpointConnectionsOperations
26
- from .operations import PrivateLinkResourcesOperations
27
- from . import models
28
-
29
-
30
- class RedisEnterpriseManagementClient (object ):
24
+ class RedisEnterpriseManagementClient :
31
25
"""REST API for managing Redis Enterprise resources in Azure.
32
26
33
27
:ivar operations: Operations operations
@@ -39,46 +33,68 @@ class RedisEnterpriseManagementClient(object):
39
33
:ivar databases: DatabasesOperations operations
40
34
:vartype databases: azure.mgmt.redisenterprise.operations.DatabasesOperations
41
35
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
42
- :vartype private_endpoint_connections: azure.mgmt.redisenterprise.operations.PrivateEndpointConnectionsOperations
36
+ :vartype private_endpoint_connections:
37
+ azure.mgmt.redisenterprise.operations.PrivateEndpointConnectionsOperations
43
38
:ivar private_link_resources: PrivateLinkResourcesOperations operations
44
- :vartype private_link_resources: azure.mgmt.redisenterprise.operations.PrivateLinkResourcesOperations
39
+ :vartype private_link_resources:
40
+ azure.mgmt.redisenterprise.operations.PrivateLinkResourcesOperations
45
41
:param credential: Credential needed for the client to connect to Azure.
46
42
:type credential: ~azure.core.credentials.TokenCredential
47
43
:param subscription_id: The ID of the target subscription.
48
44
:type subscription_id: str
49
- :param str base_url: Service URL
50
- :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
45
+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
46
+ :type base_url: str
47
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
48
+ Retry-After header is present.
51
49
"""
52
50
53
51
def __init__ (
54
52
self ,
55
- credential , # type: "TokenCredential"
56
- subscription_id , # type: str
57
- base_url = None , # type: Optional[str]
58
- ** kwargs # type: Any
59
- ):
60
- # type: (...) -> None
61
- if not base_url :
62
- base_url = 'https://management.azure.com'
63
- self ._config = RedisEnterpriseManagementClientConfiguration (credential , subscription_id , ** kwargs )
53
+ credential : "TokenCredential" ,
54
+ subscription_id : str ,
55
+ base_url : str = "https://management.azure.com" ,
56
+ ** kwargs : Any
57
+ ) -> None :
58
+ self ._config = RedisEnterpriseManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
64
59
self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
65
60
66
61
client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
67
62
self ._serialize = Serializer (client_models )
68
63
self ._deserialize = Deserializer (client_models )
64
+ self ._serialize .client_side_validation = False
65
+ 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 )
68
+ 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 :
78
+ """Runs the network request through the client's chained policies.
79
+
80
+ >>> from azure.core.rest import HttpRequest
81
+ >>> request = HttpRequest("GET", "https://www.example.org/")
82
+ <HttpRequest [GET], url: 'https://www.example.org/'>
83
+ >>> response = client._send_request(request)
84
+ <HttpResponse: 200 OK>
85
+
86
+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
87
+
88
+ :param request: The network request you want to make. Required.
89
+ :type request: ~azure.core.rest.HttpRequest
90
+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
91
+ :return: The response of your network call. Does not do error handling on your response.
92
+ :rtype: ~azure.core.rest.HttpResponse
93
+ """
69
94
70
- self .operations = Operations (
71
- self ._client , self ._config , self ._serialize , self ._deserialize )
72
- self .operations_status = OperationsStatusOperations (
73
- self ._client , self ._config , self ._serialize , self ._deserialize )
74
- self .redis_enterprise = RedisEnterpriseOperations (
75
- self ._client , self ._config , self ._serialize , self ._deserialize )
76
- self .databases = DatabasesOperations (
77
- self ._client , self ._config , self ._serialize , self ._deserialize )
78
- self .private_endpoint_connections = PrivateEndpointConnectionsOperations (
79
- self ._client , self ._config , self ._serialize , self ._deserialize )
80
- self .private_link_resources = PrivateLinkResourcesOperations (
81
- self ._client , self ._config , self ._serialize , self ._deserialize )
95
+ request_copy = deepcopy (request )
96
+ request_copy .url = self ._client .format_url (request_copy .url )
97
+ return self ._client .send_request (request_copy , ** kwargs )
82
98
83
99
def close (self ):
84
100
# type: () -> None
0 commit comments