Skip to content

Commit 9d9318b

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

File tree

137 files changed

+1888
-1834
lines changed

Some content is hidden

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

137 files changed

+1888
-1834
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/mariadb/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/mariadb/resource-manager/readme.md"
9+
"autorest_command": "autorest specification/mysql/resource-manager/Microsoft.DBforMySQL/legacy/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/legacy/readme.md"
1111
}

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

Lines changed: 219 additions & 187 deletions
Large diffs are not rendered by default.

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/__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 ._my_sql_management_client import MySQLManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._my_sql_management_client import MySQLManagementClient # 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
"MySQLManagementClient",
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/mysql/_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 MySQLManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
21+
class MySQLManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
2222
"""Configuration for MySQLManagementClient.
2323
2424
Note that all parameters used to create this instance are saved as instance
@@ -28,16 +28,26 @@ class MySQLManagementClientConfiguration: # pylint: disable=too-many-instance-a
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/mysql/_my_sql_management_client.py

Lines changed: 26 additions & 9 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 MySQLManagementClientConfiguration
20-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2123
from .operations import (
2224
AdvisorsOperations,
2325
CheckNameAvailabilityOperations,
@@ -28,7 +30,6 @@
2830
LocationBasedRecommendedActionSessionsOperationStatusOperations,
2931
LocationBasedRecommendedActionSessionsResultOperations,
3032
LogFilesOperations,
31-
MySQLManagementClientOperationsMixin,
3233
Operations,
3334
PrivateEndpointConnectionsOperations,
3435
PrivateLinkResourcesOperations,
@@ -45,15 +46,16 @@
4546
TopQueryStatisticsOperations,
4647
VirtualNetworkRulesOperations,
4748
WaitStatisticsOperations,
49+
_MySQLManagementClientOperationsMixin,
4850
)
4951

5052
if TYPE_CHECKING:
51-
# pylint: disable=unused-import,ungrouped-imports
53+
from azure.core import AzureClouds
5254
from azure.core.credentials import TokenCredential
5355

5456

5557
class MySQLManagementClient(
56-
MySQLManagementClientOperationsMixin
58+
_MySQLManagementClientOperationsMixin
5759
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
5860
"""The Microsoft Azure management API provides create, read, update, and delete functionality for
5961
Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and
@@ -124,8 +126,11 @@ class MySQLManagementClient(
124126
:type credential: ~azure.core.credentials.TokenCredential
125127
:param subscription_id: The ID of the target subscription. Required.
126128
:type subscription_id: str
127-
:param base_url: Service URL. Default value is "https://management.azure.com".
129+
:param base_url: Service URL. Default value is None.
128130
:type base_url: str
131+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
132+
None.
133+
:paramtype cloud_setting: ~azure.core.AzureClouds
129134
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
130135
Retry-After header is present.
131136
"""
@@ -134,12 +139,24 @@ def __init__(
134139
self,
135140
credential: "TokenCredential",
136141
subscription_id: str,
137-
base_url: str = "https://management.azure.com",
142+
base_url: Optional[str] = None,
143+
*,
144+
cloud_setting: Optional["AzureClouds"] = None,
138145
**kwargs: Any
139146
) -> None:
147+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
148+
_endpoints = get_arm_endpoints(_cloud)
149+
if not base_url:
150+
base_url = _endpoints["resource_manager"]
151+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
140152
self._config = MySQLManagementClientConfiguration(
141-
credential=credential, subscription_id=subscription_id, **kwargs
153+
credential=credential,
154+
subscription_id=subscription_id,
155+
cloud_setting=cloud_setting,
156+
credential_scopes=credential_scopes,
157+
**kwargs
142158
)
159+
143160
_policies = kwargs.pop("policies", None)
144161
if _policies is None:
145162
_policies = [
@@ -158,7 +175,7 @@ def __init__(
158175
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
159176
self._config.http_logging_policy,
160177
]
161-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
178+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
162179

163180
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
164181
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)