Skip to content

Commit b7e562e

Browse files
author
SDKAuto
committed
CodeGen from PR 21223 in Azure/azure-rest-api-specs
Merge e005c57144a1297e29168e39262bd18c450e67e8 into f7386016ed8edfdc59d00003c1298afa6966842c
1 parent 26ffd7d commit b7e562e

File tree

99 files changed

+18681
-9923
lines changed

Some content is hidden

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

99 files changed

+18681
-9923
lines changed

sdk/rdbms/azure-mgmt-rdbms/_meta.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"commit": "bb79e012b8356534e502f09706296a7ff9f7e3ce",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@5.16.0",
5-
"@autorest/modelerfour@4.19.3"
6+
"@autorest/python@6.1.11",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "352507b7909fabb6b6bb3e48b49d188c612c819f",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/mysql/resource-manager/readme.md --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",
10-
"readme": "specification/mysql/resource-manager/readme.md"
9+
"autorest_command": "autorest specification/postgresql/resource-manager/readme.md --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",
10+
"readme": "specification/postgresql/resource-manager/readme.md"
1111
}

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
20-
__all__ = ['PostgreSQLManagementClient']
20+
21+
__all__ = ["PostgreSQLManagementClient"]
2122
__all__.extend([p for p in _patch_all if p not in __all__])
2223

2324
_patch_sdk()

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_configuration.py

+18-22
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,13 @@ class PostgreSQLManagementClientConfiguration(Configuration): # pylint: disable
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
2727
28-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The ID of the target subscription.
30+
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
3232
"""
3333

34-
def __init__(
35-
self,
36-
credential: "TokenCredential",
37-
subscription_id: str,
38-
**kwargs: Any
39-
) -> None:
34+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4035
super(PostgreSQLManagementClientConfiguration, self).__init__(**kwargs)
4136
if credential is None:
4237
raise ValueError("Parameter 'credential' must not be None.")
@@ -45,23 +40,24 @@ def __init__(
4540

4641
self.credential = credential
4742
self.subscription_id = subscription_id
48-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
49-
kwargs.setdefault('sdk_moniker', 'mgmt-rdbms/{}'.format(VERSION))
43+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
44+
kwargs.setdefault("sdk_moniker", "mgmt-rdbms/{}".format(VERSION))
5045
self._configure(**kwargs)
5146

5247
def _configure(
53-
self,
54-
**kwargs # type: Any
48+
self, **kwargs # type: Any
5549
):
5650
# type: (...) -> None
57-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
58-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
59-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
60-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
61-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
62-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
63-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
64-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
65-
self.authentication_policy = kwargs.get('authentication_policy')
51+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
52+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
53+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
54+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
55+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
56+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
57+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
58+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
59+
self.authentication_policy = kwargs.get("authentication_policy")
6660
if self.credential and not self.authentication_policy:
67-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
61+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
62+
self.credential, *self.credential_scopes, **kwargs
63+
)

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_patch.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
1212

13+
1314
def patch_sdk():
1415
"""Do not remove from this file.
1516

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_postgre_sql_management_client.py

+38-38
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,39 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12-
from msrest import Deserializer, Serializer
13-
1412
from azure.core.rest import HttpRequest, HttpResponse
1513
from azure.mgmt.core import ARMPipelineClient
1614

1715
from . import models
1816
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+
)
2038

2139
if TYPE_CHECKING:
2240
# pylint: disable=unused-import,ungrouped-imports
2341
from azure.core.credentials import TokenCredential
2442

25-
class PostgreSQLManagementClient: # pylint: disable=too-many-instance-attributes
43+
44+
class PostgreSQLManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
2645
"""The Microsoft Azure management API provides create, read, update, and delete functionality for
2746
Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security
2847
alert policies, log files and configurations with new business model.
@@ -72,9 +91,9 @@ class PostgreSQLManagementClient: # pylint: disable=too-many-instance-attribu
7291
azure.mgmt.rdbms.postgresql.operations.PrivateLinkResourcesOperations
7392
:ivar server_keys: ServerKeysOperations operations
7493
: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.
7695
: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.
7897
:type subscription_id: str
7998
:param base_url: Service URL. Default value is "https://management.azure.com".
8099
:type base_url: str
@@ -89,37 +108,27 @@ def __init__(
89108
base_url: str = "https://management.azure.com",
90109
**kwargs: Any
91110
) -> 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+
)
93114
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
94115

95116
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
96117
self._serialize = Serializer(client_models)
97118
self._deserialize = Deserializer(client_models)
98119
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)
108123
self.virtual_network_rules = VirtualNetworkRulesOperations(
109124
self._client, self._config, self._serialize, self._deserialize
110125
)
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)
117128
self.server_parameters = ServerParametersOperations(
118129
self._client, self._config, self._serialize, self._deserialize
119130
)
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)
123132
self.server_administrators = ServerAdministratorsOperations(
124133
self._client, self._config, self._serialize, self._deserialize
125134
)
@@ -135,9 +144,7 @@ def __init__(
135144
self.check_name_availability = CheckNameAvailabilityOperations(
136145
self._client, self._config, self._serialize, self._deserialize
137146
)
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)
141148
self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations(
142149
self._client, self._config, self._serialize, self._deserialize
143150
)
@@ -147,16 +154,9 @@ def __init__(
147154
self.private_link_resources = PrivateLinkResourcesOperations(
148155
self._client, self._config, self._serialize, self._deserialize
149156
)
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)
154158

155-
def _send_request(
156-
self,
157-
request: HttpRequest,
158-
**kwargs: Any
159-
) -> HttpResponse:
159+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
160160
"""Runs the network request through the client's chained policies.
161161
162162
>>> from azure.core.rest import HttpRequest
@@ -165,7 +165,7 @@ def _send_request(
165165
>>> response = client._send_request(request)
166166
<HttpResponse: 200 OK>
167167
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
169169
170170
:param request: The network request you want to make. Required.
171171
:type request: ~azure.core.rest.HttpRequest

0 commit comments

Comments
 (0)