9
9
from copy import deepcopy
10
10
from typing import Any , TYPE_CHECKING
11
11
12
- from msrest import Deserializer , Serializer
13
-
14
12
from azure .core .rest import HttpRequest , HttpResponse
15
13
from azure .mgmt .core import ARMPipelineClient
16
14
17
15
from . import models
18
16
from ._configuration import PostgreSQLManagementClientConfiguration
19
- from .operations import CheckNameAvailabilityOperations , ConfigurationsOperations , DatabasesOperations , FirewallRulesOperations , LocationBasedPerformanceTierOperations , LogFilesOperations , Operations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations , RecoverableServersOperations , ReplicasOperations , ServerAdministratorsOperations , ServerBasedPerformanceTierOperations , ServerKeysOperations , ServerParametersOperations , ServerSecurityAlertPoliciesOperations , ServersOperations , VirtualNetworkRulesOperations
17
+ from ._serialization import Deserializer , Serializer
18
+ from .operations import (
19
+ CheckNameAvailabilityOperations ,
20
+ ConfigurationsOperations ,
21
+ DatabasesOperations ,
22
+ FirewallRulesOperations ,
23
+ LocationBasedPerformanceTierOperations ,
24
+ LogFilesOperations ,
25
+ Operations ,
26
+ PrivateEndpointConnectionsOperations ,
27
+ PrivateLinkResourcesOperations ,
28
+ RecoverableServersOperations ,
29
+ ReplicasOperations ,
30
+ ServerAdministratorsOperations ,
31
+ ServerBasedPerformanceTierOperations ,
32
+ ServerKeysOperations ,
33
+ ServerParametersOperations ,
34
+ ServerSecurityAlertPoliciesOperations ,
35
+ ServersOperations ,
36
+ VirtualNetworkRulesOperations ,
37
+ )
20
38
21
39
if TYPE_CHECKING :
22
40
# pylint: disable=unused-import,ungrouped-imports
23
41
from azure .core .credentials import TokenCredential
24
42
25
- class PostgreSQLManagementClient : # pylint: disable=too-many-instance-attributes
43
+
44
+ class PostgreSQLManagementClient : # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
26
45
"""The Microsoft Azure management API provides create, read, update, and delete functionality for
27
46
Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security
28
47
alert policies, log files and configurations with new business model.
@@ -72,9 +91,9 @@ class PostgreSQLManagementClient: # pylint: disable=too-many-instance-attribu
72
91
azure.mgmt.rdbms.postgresql.operations.PrivateLinkResourcesOperations
73
92
:ivar server_keys: ServerKeysOperations operations
74
93
:vartype server_keys: azure.mgmt.rdbms.postgresql.operations.ServerKeysOperations
75
- :param credential: Credential needed for the client to connect to Azure.
94
+ :param credential: Credential needed for the client to connect to Azure. Required.
76
95
:type credential: ~azure.core.credentials.TokenCredential
77
- :param subscription_id: The ID of the target subscription.
96
+ :param subscription_id: The ID of the target subscription. Required.
78
97
:type subscription_id: str
79
98
:param base_url: Service URL. Default value is "https://management.azure.com".
80
99
:type base_url: str
@@ -89,37 +108,27 @@ def __init__(
89
108
base_url : str = "https://management.azure.com" ,
90
109
** kwargs : Any
91
110
) -> None :
92
- self ._config = PostgreSQLManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
111
+ self ._config = PostgreSQLManagementClientConfiguration (
112
+ credential = credential , subscription_id = subscription_id , ** kwargs
113
+ )
93
114
self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
94
115
95
116
client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
96
117
self ._serialize = Serializer (client_models )
97
118
self ._deserialize = Deserializer (client_models )
98
119
self ._serialize .client_side_validation = False
99
- self .servers = ServersOperations (
100
- self ._client , self ._config , self ._serialize , self ._deserialize
101
- )
102
- self .replicas = ReplicasOperations (
103
- self ._client , self ._config , self ._serialize , self ._deserialize
104
- )
105
- self .firewall_rules = FirewallRulesOperations (
106
- self ._client , self ._config , self ._serialize , self ._deserialize
107
- )
120
+ self .servers = ServersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
121
+ self .replicas = ReplicasOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
122
+ self .firewall_rules = FirewallRulesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
108
123
self .virtual_network_rules = VirtualNetworkRulesOperations (
109
124
self ._client , self ._config , self ._serialize , self ._deserialize
110
125
)
111
- self .databases = DatabasesOperations (
112
- self ._client , self ._config , self ._serialize , self ._deserialize
113
- )
114
- self .configurations = ConfigurationsOperations (
115
- self ._client , self ._config , self ._serialize , self ._deserialize
116
- )
126
+ self .databases = DatabasesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
127
+ self .configurations = ConfigurationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
117
128
self .server_parameters = ServerParametersOperations (
118
129
self ._client , self ._config , self ._serialize , self ._deserialize
119
130
)
120
- self .log_files = LogFilesOperations (
121
- self ._client , self ._config , self ._serialize , self ._deserialize
122
- )
131
+ self .log_files = LogFilesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
123
132
self .server_administrators = ServerAdministratorsOperations (
124
133
self ._client , self ._config , self ._serialize , self ._deserialize
125
134
)
@@ -135,9 +144,7 @@ def __init__(
135
144
self .check_name_availability = CheckNameAvailabilityOperations (
136
145
self ._client , self ._config , self ._serialize , self ._deserialize
137
146
)
138
- self .operations = Operations (
139
- self ._client , self ._config , self ._serialize , self ._deserialize
140
- )
147
+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
141
148
self .server_security_alert_policies = ServerSecurityAlertPoliciesOperations (
142
149
self ._client , self ._config , self ._serialize , self ._deserialize
143
150
)
@@ -147,16 +154,9 @@ def __init__(
147
154
self .private_link_resources = PrivateLinkResourcesOperations (
148
155
self ._client , self ._config , self ._serialize , self ._deserialize
149
156
)
150
- self .server_keys = ServerKeysOperations (
151
- self ._client , self ._config , self ._serialize , self ._deserialize
152
- )
153
-
157
+ self .server_keys = ServerKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
154
158
155
- def _send_request (
156
- self ,
157
- request : HttpRequest ,
158
- ** kwargs : Any
159
- ) -> HttpResponse :
159
+ def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
160
160
"""Runs the network request through the client's chained policies.
161
161
162
162
>>> from azure.core.rest import HttpRequest
@@ -165,7 +165,7 @@ def _send_request(
165
165
>>> response = client._send_request(request)
166
166
<HttpResponse: 200 OK>
167
167
168
- For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
168
+ For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/ python/send_request
169
169
170
170
:param request: The network request you want to make. Required.
171
171
:type request: ~azure.core.rest.HttpRequest
0 commit comments