Skip to content

Commit fbaac10

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

File tree

169 files changed

+15509
-1327
lines changed

Some content is hidden

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

169 files changed

+15509
-1327
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.

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._postgre_sql_management_client import PostgreSQLManagementClient
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
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"PostgreSQLManagementClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import Any, TYPE_CHECKING
9+
from typing import Any, Optional, TYPE_CHECKING
1010

1111
from azure.core.pipeline import policies
1212
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1313

1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
17+
from azure.core import AzureClouds
1818
from azure.core.credentials import TokenCredential
1919

2020

21-
class PostgreSQLManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
21+
class PostgreSQLManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
2222
"""Configuration for PostgreSQLManagementClient.
2323
2424
Note that all parameters used to create this instance are saved as instance
@@ -28,16 +28,26 @@ class PostgreSQLManagementClientConfiguration: # pylint: disable=too-many-insta
2828
:type credential: ~azure.core.credentials.TokenCredential
2929
:param subscription_id: The ID of the target subscription. Required.
3030
: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
3134
"""
3235

33-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36+
def __init__(
37+
self,
38+
credential: "TokenCredential",
39+
subscription_id: str,
40+
cloud_setting: Optional["AzureClouds"] = None,
41+
**kwargs: Any
42+
) -> None:
3443
if credential is None:
3544
raise ValueError("Parameter 'credential' must not be None.")
3645
if subscription_id is None:
3746
raise ValueError("Parameter 'subscription_id' must not be None.")
3847

3948
self.credential = credential
4049
self.subscription_id = subscription_id
50+
self.cloud_setting = cloud_setting
4151
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4252
kwargs.setdefault("sdk_moniker", "mgmt-rdbms/{}".format(VERSION))
4353
self.polling_interval = kwargs.get("polling_interval", 30)

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

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
1111
from typing_extensions import Self
1212

1313
from azure.core.pipeline import policies
1414
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1516
from azure.mgmt.core import ARMPipelineClient
1617
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1719

1820
from . import models as _models
1921
from ._configuration import PostgreSQLManagementClientConfiguration
20-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2123
from .operations import (
2224
CheckNameAvailabilityOperations,
2325
ConfigurationsOperations,
@@ -40,14 +42,15 @@
4042
)
4143

4244
if TYPE_CHECKING:
43-
# pylint: disable=unused-import,ungrouped-imports
45+
from azure.core import AzureClouds
4446
from azure.core.credentials import TokenCredential
4547

4648

4749
class PostgreSQLManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
48-
"""The Microsoft Azure management API provides create, read, update, and delete functionality for
49-
Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security
50-
alert policies, log files and configurations with new business model.
50+
"""The Azure Database for PostgreSQL management API provides create, read, update, and delete
51+
functionality for Azure PostgreSQL resources including servers, databases, firewall rules,
52+
network configuration, security alert policies, log files and configurations with new business
53+
model.
5154
5255
:ivar servers: ServersOperations operations
5356
:vartype servers: azure.mgmt.rdbms.postgresql.operations.ServersOperations
@@ -98,8 +101,11 @@ class PostgreSQLManagementClient: # pylint: disable=client-accepts-api-version-
98101
:type credential: ~azure.core.credentials.TokenCredential
99102
:param subscription_id: The ID of the target subscription. Required.
100103
:type subscription_id: str
101-
:param base_url: Service URL. Default value is "https://management.azure.com".
104+
:param base_url: Service URL. Default value is None.
102105
:type base_url: str
106+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
107+
None.
108+
:paramtype cloud_setting: ~azure.core.AzureClouds
103109
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
104110
Retry-After header is present.
105111
"""
@@ -108,12 +114,24 @@ def __init__(
108114
self,
109115
credential: "TokenCredential",
110116
subscription_id: str,
111-
base_url: str = "https://management.azure.com",
117+
base_url: Optional[str] = None,
118+
*,
119+
cloud_setting: Optional["AzureClouds"] = None,
112120
**kwargs: Any
113121
) -> None:
122+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
123+
_endpoints = get_arm_endpoints(_cloud)
124+
if not base_url:
125+
base_url = _endpoints["resource_manager"]
126+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
114127
self._config = PostgreSQLManagementClientConfiguration(
115-
credential=credential, subscription_id=subscription_id, **kwargs
128+
credential=credential,
129+
subscription_id=subscription_id,
130+
cloud_setting=cloud_setting,
131+
credential_scopes=credential_scopes,
132+
**kwargs
116133
)
134+
117135
_policies = kwargs.pop("policies", None)
118136
if _policies is None:
119137
_policies = [
@@ -132,7 +150,7 @@ def __init__(
132150
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
133151
self._config.http_logging_policy,
134152
]
135-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
153+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
136154

137155
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
138156
self._serialize = Serializer(client_models)
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)