Skip to content

Commit b130bb5

Browse files
author
SDKAuto
committed
CodeGen from PR 13789 in Azure/azure-rest-api-specs
Merge f05a6629ed8ad17cc2930a625d7aec59c415b08a into c55d37d
1 parent 46b402f commit b130bb5

Some content is hidden

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

41 files changed

+487
-314
lines changed

sdk/rdbms/azure-mgmt-rdbms/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"autorest": "3.3.0",
3+
"use": "@autorest/[email protected]",
4+
"commit": "b401cea78b6410dd02290cb034a798bc7a55b5d4",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6+
"autorest_command": "autorest specification/postgresql/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --version=3.3.0",
7+
"readme": "specification/postgresql/resource-manager/readme.md"
8+
}

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_metadata.json

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"custom_base_url": null,
1010
"azure_arm": true,
1111
"has_lro_operations": true,
12-
"client_side_validation": true
12+
"client_side_validation": false,
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"PostgreSQLManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"PostgreSQLManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
1315
},
1416
"global_parameters": {
1517
"sync": {
@@ -28,28 +30,72 @@
2830
},
2931
"async": {
3032
"credential": {
31-
"signature": "credential, # type: \"AsyncTokenCredential\"",
33+
"signature": "credential: \"AsyncTokenCredential\",",
3234
"description": "Credential needed for the client to connect to Azure.",
3335
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3436
"required": true
3537
},
3638
"subscription_id": {
37-
"signature": "subscription_id, # type: str",
39+
"signature": "subscription_id: str,",
3840
"description": "The ID of the target subscription.",
3941
"docstring_type": "str",
4042
"required": true
4143
}
4244
},
4345
"constant": {
4446
},
45-
"call": "credential, subscription_id"
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
4690
},
4791
"config": {
4892
"credential": true,
4993
"credential_scopes": ["https://management.azure.com/.default"],
5094
"credential_default_policy_type": "BearerTokenCredentialPolicy",
5195
"credential_default_policy_type_has_async_version": true,
52-
"credential_key_header_name": null
96+
"credential_key_header_name": null,
97+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
98+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
5399
},
54100
"operation_groups": {
55101
"servers": "ServersOperations",
@@ -70,9 +116,5 @@
70116
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
71117
"private_link_resources": "PrivateLinkResourcesOperations",
72118
"server_keys": "ServerKeysOperations"
73-
},
74-
"operation_mixins": {
75-
},
76-
"sync_imports": "None",
77-
"async_imports": "None"
119+
}
78120
}

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import PostgreSQLManagementClientConfiguration
2122
from .operations import ServersOperations
@@ -101,6 +102,7 @@ def __init__(
101102

102103
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
103104
self._serialize = Serializer(client_models)
105+
self._serialize.client_side_validation = False
104106
self._deserialize = Deserializer(client_models)
105107

106108
self.servers = ServersOperations(
@@ -140,6 +142,24 @@ def __init__(
140142
self.server_keys = ServerKeysOperations(
141143
self._client, self._config, self._serialize, self._deserialize)
142144

145+
def _send_request(self, http_request, **kwargs):
146+
# type: (HttpRequest, Any) -> HttpResponse
147+
"""Runs the network request through the client's chained policies.
148+
149+
:param http_request: The network request you want to make. Required.
150+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
151+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
152+
:return: The response of your network call. Does not do error handling on your response.
153+
:rtype: ~azure.core.pipeline.transport.HttpResponse
154+
"""
155+
path_format_arguments = {
156+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
157+
}
158+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
159+
stream = kwargs.pop("stream", True)
160+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
161+
return pipeline_response.http_response
162+
143163
def close(self):
144164
# type: () -> None
145165
self._client.close()

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from typing import Any, Optional, TYPE_CHECKING
1010

11+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1112
from azure.mgmt.core import AsyncARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

@@ -98,6 +99,7 @@ def __init__(
9899

99100
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
100101
self._serialize = Serializer(client_models)
102+
self._serialize.client_side_validation = False
101103
self._deserialize = Deserializer(client_models)
102104

103105
self.servers = ServersOperations(
@@ -137,6 +139,23 @@ def __init__(
137139
self.server_keys = ServerKeysOperations(
138140
self._client, self._config, self._serialize, self._deserialize)
139141

142+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
143+
"""Runs the network request through the client's chained policies.
144+
145+
:param http_request: The network request you want to make. Required.
146+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
147+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
148+
:return: The response of your network call. Does not do error handling on your response.
149+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
150+
"""
151+
path_format_arguments = {
152+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
153+
}
154+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
155+
stream = kwargs.pop("stream", True)
156+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
157+
return pipeline_response.http_response
158+
140159
async def close(self) -> None:
141160
await self._client.close()
142161

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_configurations_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ async def begin_create_or_update(
120120
:type parameters: ~azure.mgmt.rdbms.postgresql.models.Configuration
121121
:keyword callable cls: A custom type or function that will be passed the direct response
122122
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
123-
:keyword polling: True for ARMPolling, False for no polling, or a
124-
polling object for personal polling strategy
123+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
124+
False for no polling, or your own initialized polling object for a personal polling strategy.
125125
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
126126
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
127127
:return: An instance of AsyncLROPoller that returns either Configuration or the result of cls(response)

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_databases_operations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ async def begin_create_or_update(
123123
:type parameters: ~azure.mgmt.rdbms.postgresql.models.Database
124124
:keyword callable cls: A custom type or function that will be passed the direct response
125125
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
126-
:keyword polling: True for ARMPolling, False for no polling, or a
127-
polling object for personal polling strategy
126+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
127+
False for no polling, or your own initialized polling object for a personal polling strategy.
128128
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
129129
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
130130
:return: An instance of AsyncLROPoller that returns either Database or the result of cls(response)
@@ -242,8 +242,8 @@ async def begin_delete(
242242
:type database_name: str
243243
:keyword callable cls: A custom type or function that will be passed the direct response
244244
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
245-
:keyword polling: True for ARMPolling, False for no polling, or a
246-
polling object for personal polling strategy
245+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
246+
False for no polling, or your own initialized polling object for a personal polling strategy.
247247
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
248248
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
249249
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_firewall_rules_operations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ async def begin_create_or_update(
123123
:type parameters: ~azure.mgmt.rdbms.postgresql.models.FirewallRule
124124
:keyword callable cls: A custom type or function that will be passed the direct response
125125
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
126-
:keyword polling: True for ARMPolling, False for no polling, or a
127-
polling object for personal polling strategy
126+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
127+
False for no polling, or your own initialized polling object for a personal polling strategy.
128128
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
129129
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
130130
:return: An instance of AsyncLROPoller that returns either FirewallRule or the result of cls(response)
@@ -242,8 +242,8 @@ async def begin_delete(
242242
:type firewall_rule_name: str
243243
:keyword callable cls: A custom type or function that will be passed the direct response
244244
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
245-
:keyword polling: True for ARMPolling, False for no polling, or a
246-
polling object for personal polling strategy
245+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
246+
False for no polling, or your own initialized polling object for a personal polling strategy.
247247
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
248248
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
249249
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_private_endpoint_connections_operations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ async def begin_create_or_update(
182182
:type parameters: ~azure.mgmt.rdbms.postgresql.models.PrivateEndpointConnection
183183
:keyword callable cls: A custom type or function that will be passed the direct response
184184
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
185-
:keyword polling: True for ARMPolling, False for no polling, or a
186-
polling object for personal polling strategy
185+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
186+
False for no polling, or your own initialized polling object for a personal polling strategy.
187187
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
188188
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
189189
:return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response)
@@ -301,8 +301,8 @@ async def begin_delete(
301301
:type private_endpoint_connection_name: str
302302
:keyword callable cls: A custom type or function that will be passed the direct response
303303
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
304-
:keyword polling: True for ARMPolling, False for no polling, or a
305-
polling object for personal polling strategy
304+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
305+
False for no polling, or your own initialized polling object for a personal polling strategy.
306306
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
307307
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
308308
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
@@ -431,8 +431,8 @@ async def begin_update_tags(
431431
:type parameters: ~azure.mgmt.rdbms.postgresql.models.TagsObject
432432
:keyword callable cls: A custom type or function that will be passed the direct response
433433
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
434-
:keyword polling: True for ARMPolling, False for no polling, or a
435-
polling object for personal polling strategy
434+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
435+
False for no polling, or your own initialized polling object for a personal polling strategy.
436436
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
437437
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
438438
:return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response)

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/aio/operations/_server_administrators_operations.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ async def begin_create_or_update(
177177
:type properties: ~azure.mgmt.rdbms.postgresql.models.ServerAdministratorResource
178178
:keyword callable cls: A custom type or function that will be passed the direct response
179179
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
180-
:keyword polling: True for ARMPolling, False for no polling, or a
181-
polling object for personal polling strategy
180+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
181+
False for no polling, or your own initialized polling object for a personal polling strategy.
182182
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
183183
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
184184
:return: An instance of AsyncLROPoller that returns either ServerAdministratorResource or the result of cls(response)
@@ -289,8 +289,8 @@ async def begin_delete(
289289
:type server_name: str
290290
:keyword callable cls: A custom type or function that will be passed the direct response
291291
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
292-
:keyword polling: True for ARMPolling, False for no polling, or a
293-
polling object for personal polling strategy
292+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
293+
False for no polling, or your own initialized polling object for a personal polling strategy.
294294
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
295295
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
296296
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)

0 commit comments

Comments
 (0)