Skip to content

Commit b0434a1

Browse files
committed
Configurations: 'specification/postgresql/resource-manager/readme.md', API Version: 2018-06-01, SDK Release Type: stable, and CommitSHA: '517eeb0bdbfe56c34a9423d2a970313ae74d497c' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5608244 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
1 parent b322e60 commit b0434a1

File tree

121 files changed

+16492
-122
lines changed

Some content is hidden

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

121 files changed

+16492
-122
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"@autorest/[email protected]",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10-
"readme": "specification/mysql/resource-manager/Microsoft.DBforMySQL/FlexibleServers/readme.md"
9+
"autorest_command": "autorest specification/postgresql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
10+
"readme": "specification/postgresql/resource-manager/readme.md"
1111
}

sdk/rdbms/azure-mgmt-rdbms/apiview-properties.json

Lines changed: 168 additions & 120 deletions
Large diffs are not rendered by default.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
9+
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._postgre_sql_management_client import PostgreSQLManagementClient # type: ignore
16+
from ._version import VERSION
17+
18+
__version__ = VERSION
19+
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
25+
from ._patch import patch_sdk as _patch_sdk
26+
27+
__all__ = [
28+
"PostgreSQLManagementClient",
29+
]
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
31+
32+
_patch_sdk()
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, Optional, TYPE_CHECKING
10+
11+
from azure.core.pipeline import policies
12+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
13+
14+
from ._version import VERSION
15+
16+
if TYPE_CHECKING:
17+
from azure.core import AzureClouds
18+
from azure.core.credentials import TokenCredential
19+
20+
21+
class PostgreSQLManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
22+
"""Configuration for PostgreSQLManagementClient.
23+
24+
Note that all parameters used to create this instance are saved as instance
25+
attributes.
26+
27+
:param credential: Credential needed for the client to connect to Azure. Required.
28+
:type credential: ~azure.core.credentials.TokenCredential
29+
:param subscription_id: The ID of the target subscription. Required.
30+
:type subscription_id: str
31+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
32+
None.
33+
:type cloud_setting: ~azure.core.AzureClouds
34+
:keyword api_version: Api Version. Default value is "2021-06-01". Note that overriding this
35+
default value may result in unsupported behavior.
36+
:paramtype api_version: str
37+
"""
38+
39+
def __init__(
40+
self,
41+
credential: "TokenCredential",
42+
subscription_id: str,
43+
cloud_setting: Optional["AzureClouds"] = None,
44+
**kwargs: Any
45+
) -> None:
46+
api_version: str = kwargs.pop("api_version", "2021-06-01")
47+
48+
if credential is None:
49+
raise ValueError("Parameter 'credential' must not be None.")
50+
if subscription_id is None:
51+
raise ValueError("Parameter 'subscription_id' must not be None.")
52+
53+
self.credential = credential
54+
self.subscription_id = subscription_id
55+
self.cloud_setting = cloud_setting
56+
self.api_version = api_version
57+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
58+
kwargs.setdefault("sdk_moniker", "mgmt-rdbms/{}".format(VERSION))
59+
self.polling_interval = kwargs.get("polling_interval", 30)
60+
self._configure(**kwargs)
61+
62+
def _configure(self, **kwargs: Any) -> None:
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.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
69+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
70+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
71+
self.authentication_policy = kwargs.get("authentication_policy")
72+
if self.credential and not self.authentication_policy:
73+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
74+
self.credential, *self.credential_scopes, **kwargs
75+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
6+
"""Customize generated code here.
7+
8+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
9+
"""
10+
11+
12+
__all__: list[str] = [] # Add all objects you want publicly available to users at this package level
13+
14+
15+
def patch_sdk():
16+
"""Do not remove from this file.
17+
18+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
19+
you can't accomplish using the techniques described in
20+
https://aka.ms/azsdk/python/dpcodegen/python/customize
21+
"""
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from . import models as _models
21+
from ._configuration import PostgreSQLManagementClientConfiguration
22+
from ._utils.serialization import Deserializer, Serializer
23+
from .operations import (
24+
CheckNameAvailabilityOperations,
25+
ConfigurationsOperations,
26+
DatabasesOperations,
27+
FirewallRulesOperations,
28+
GetPrivateDnsZoneSuffixOperations,
29+
LocationBasedCapabilitiesOperations,
30+
Operations,
31+
ServersOperations,
32+
VirtualNetworkSubnetUsageOperations,
33+
)
34+
35+
if TYPE_CHECKING:
36+
from azure.core import AzureClouds
37+
from azure.core.credentials import TokenCredential
38+
39+
40+
class PostgreSQLManagementClient: # pylint: disable=too-many-instance-attributes
41+
"""The Azure Database for PostgreSQL management API provides create, read, update, and delete
42+
functionality for Azure PostgreSQL resources including servers, databases, firewall rules,
43+
network configuration, security alert policies, log files and configurations with new business
44+
model.
45+
46+
:ivar servers: ServersOperations operations
47+
:vartype servers: azure.mgmt.rdbms.postgresql_flexibleservers.operations.ServersOperations
48+
:ivar firewall_rules: FirewallRulesOperations operations
49+
:vartype firewall_rules:
50+
azure.mgmt.rdbms.postgresql_flexibleservers.operations.FirewallRulesOperations
51+
:ivar configurations: ConfigurationsOperations operations
52+
:vartype configurations:
53+
azure.mgmt.rdbms.postgresql_flexibleservers.operations.ConfigurationsOperations
54+
:ivar check_name_availability: CheckNameAvailabilityOperations operations
55+
:vartype check_name_availability:
56+
azure.mgmt.rdbms.postgresql_flexibleservers.operations.CheckNameAvailabilityOperations
57+
:ivar location_based_capabilities: LocationBasedCapabilitiesOperations operations
58+
:vartype location_based_capabilities:
59+
azure.mgmt.rdbms.postgresql_flexibleservers.operations.LocationBasedCapabilitiesOperations
60+
:ivar virtual_network_subnet_usage: VirtualNetworkSubnetUsageOperations operations
61+
:vartype virtual_network_subnet_usage:
62+
azure.mgmt.rdbms.postgresql_flexibleservers.operations.VirtualNetworkSubnetUsageOperations
63+
:ivar operations: Operations operations
64+
:vartype operations: azure.mgmt.rdbms.postgresql_flexibleservers.operations.Operations
65+
:ivar databases: DatabasesOperations operations
66+
:vartype databases: azure.mgmt.rdbms.postgresql_flexibleservers.operations.DatabasesOperations
67+
:ivar get_private_dns_zone_suffix: GetPrivateDnsZoneSuffixOperations operations
68+
:vartype get_private_dns_zone_suffix:
69+
azure.mgmt.rdbms.postgresql_flexibleservers.operations.GetPrivateDnsZoneSuffixOperations
70+
:param credential: Credential needed for the client to connect to Azure. Required.
71+
:type credential: ~azure.core.credentials.TokenCredential
72+
:param subscription_id: The ID of the target subscription. Required.
73+
:type subscription_id: str
74+
:param base_url: Service URL. Default value is None.
75+
:type base_url: str
76+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
77+
None.
78+
:paramtype cloud_setting: ~azure.core.AzureClouds
79+
:keyword api_version: Api Version. Default value is "2021-06-01". Note that overriding this
80+
default value may result in unsupported behavior.
81+
:paramtype api_version: str
82+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
83+
Retry-After header is present.
84+
"""
85+
86+
def __init__(
87+
self,
88+
credential: "TokenCredential",
89+
subscription_id: str,
90+
base_url: Optional[str] = None,
91+
*,
92+
cloud_setting: Optional["AzureClouds"] = None,
93+
**kwargs: Any
94+
) -> None:
95+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
96+
_endpoints = get_arm_endpoints(_cloud)
97+
if not base_url:
98+
base_url = _endpoints["resource_manager"]
99+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
100+
self._config = PostgreSQLManagementClientConfiguration(
101+
credential=credential,
102+
subscription_id=subscription_id,
103+
cloud_setting=cloud_setting,
104+
credential_scopes=credential_scopes,
105+
**kwargs
106+
)
107+
108+
_policies = kwargs.pop("policies", None)
109+
if _policies is None:
110+
_policies = [
111+
policies.RequestIdPolicy(**kwargs),
112+
self._config.headers_policy,
113+
self._config.user_agent_policy,
114+
self._config.proxy_policy,
115+
policies.ContentDecodePolicy(**kwargs),
116+
ARMAutoResourceProviderRegistrationPolicy(),
117+
self._config.redirect_policy,
118+
self._config.retry_policy,
119+
self._config.authentication_policy,
120+
self._config.custom_hook_policy,
121+
self._config.logging_policy,
122+
policies.DistributedTracingPolicy(**kwargs),
123+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
124+
self._config.http_logging_policy,
125+
]
126+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
127+
128+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
129+
self._serialize = Serializer(client_models)
130+
self._deserialize = Deserializer(client_models)
131+
self._serialize.client_side_validation = False
132+
self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize)
133+
self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize)
134+
self.configurations = ConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize)
135+
self.check_name_availability = CheckNameAvailabilityOperations(
136+
self._client, self._config, self._serialize, self._deserialize
137+
)
138+
self.location_based_capabilities = LocationBasedCapabilitiesOperations(
139+
self._client, self._config, self._serialize, self._deserialize
140+
)
141+
self.virtual_network_subnet_usage = VirtualNetworkSubnetUsageOperations(
142+
self._client, self._config, self._serialize, self._deserialize
143+
)
144+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
145+
self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize)
146+
self.get_private_dns_zone_suffix = GetPrivateDnsZoneSuffixOperations(
147+
self._client, self._config, self._serialize, self._deserialize
148+
)
149+
150+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
151+
"""Runs the network request through the client's chained policies.
152+
153+
>>> from azure.core.rest import HttpRequest
154+
>>> request = HttpRequest("GET", "https://www.example.org/")
155+
<HttpRequest [GET], url: 'https://www.example.org/'>
156+
>>> response = client._send_request(request)
157+
<HttpResponse: 200 OK>
158+
159+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
160+
161+
:param request: The network request you want to make. Required.
162+
:type request: ~azure.core.rest.HttpRequest
163+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
164+
:return: The response of your network call. Does not do error handling on your response.
165+
:rtype: ~azure.core.rest.HttpResponse
166+
"""
167+
168+
request_copy = deepcopy(request)
169+
request_copy.url = self._client.format_url(request_copy.url)
170+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
171+
172+
def close(self) -> None:
173+
self._client.close()
174+
175+
def __enter__(self) -> Self:
176+
self._client.__enter__()
177+
return self
178+
179+
def __exit__(self, *exc_details: Any) -> None:
180+
self._client.__exit__(*exc_details)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)