Skip to content

Commit 7a1128f

Browse files
committed
Configurations: 'specification/mariadb/resource-manager/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=5607470 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
1 parent 9f7a2fb commit 7a1128f

File tree

129 files changed

+2463
-2299
lines changed

Some content is hidden

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

129 files changed

+2463
-2299
lines changed
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
include _meta.json
2-
recursive-include tests *.py *.json
3-
recursive-include samples *.py *.md
41
include *.md
5-
include azure/__init__.py
6-
include azure/mgmt/__init__.py
72
include LICENSE
83
include azure/mgmt/rdbms/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py

sdk/rdbms/azure-mgmt-rdbms/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure RDBMS Management Client Library.
4-
This package has been tested with Python 3.8+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.8+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "c1d839d48ee936c9338431c38f2cbbfbc9879ea2",
2+
"commit": "a6ed6068423273f64e637cea11586c826668fcbe",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.17.0",
6+
"@autorest/python@6.42.0",
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 --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.17.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
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/python@6.42.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/mariadb/resource-manager/readme.md"
1111
}

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

Lines changed: 192 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/__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 ._maria_db_management_client import MariaDBManagementClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._maria_db_management_client import MariaDBManagementClient # 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
"MariaDBManagementClient",
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/mariadb/_configuration.py

Lines changed: 20 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 MariaDBManagementClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
21+
class MariaDBManagementClientConfiguration: # pylint: disable=too-many-instance-attributes
2222
"""Configuration for MariaDBManagementClient.
2323
2424
Note that all parameters used to create this instance are saved as instance
@@ -28,16 +28,32 @@ class MariaDBManagementClientConfiguration: # pylint: disable=too-many-instance
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
34+
:keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this
35+
default value may result in unsupported behavior.
36+
:paramtype api_version: str
3137
"""
3238

33-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
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", "2018-06-01")
47+
3448
if credential is None:
3549
raise ValueError("Parameter 'credential' must not be None.")
3650
if subscription_id is None:
3751
raise ValueError("Parameter 'subscription_id' must not be None.")
3852

3953
self.credential = credential
4054
self.subscription_id = subscription_id
55+
self.cloud_setting = cloud_setting
56+
self.api_version = api_version
4157
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
4258
kwargs.setdefault("sdk_moniker", "mgmt-rdbms/{}".format(VERSION))
4359
self.polling_interval = kwargs.get("polling_interval", 30)

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/_maria_db_management_client.py

Lines changed: 29 additions & 11 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 MariaDBManagementClientConfiguration
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-
MariaDBManagementClientOperationsMixin,
3233
Operations,
3334
PrivateEndpointConnectionsOperations,
3435
PrivateLinkResourcesOperations,
@@ -43,16 +44,15 @@
4344
TopQueryStatisticsOperations,
4445
VirtualNetworkRulesOperations,
4546
WaitStatisticsOperations,
47+
_MariaDBManagementClientOperationsMixin,
4648
)
4749

4850
if TYPE_CHECKING:
49-
# pylint: disable=unused-import,ungrouped-imports
51+
from azure.core import AzureClouds
5052
from azure.core.credentials import TokenCredential
5153

5254

53-
class MariaDBManagementClient(
54-
MariaDBManagementClientOperationsMixin
55-
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
55+
class MariaDBManagementClient(_MariaDBManagementClientOperationsMixin): # pylint: disable=too-many-instance-attributes
5656
"""The Microsoft Azure management API provides create, read, update, and delete functionality for
5757
Azure MariaDB resources including servers, databases, firewall rules, VNET rules, log files and
5858
configurations with new business model.
@@ -118,8 +118,14 @@ class MariaDBManagementClient(
118118
:type credential: ~azure.core.credentials.TokenCredential
119119
:param subscription_id: The ID of the target subscription. Required.
120120
:type subscription_id: str
121-
:param base_url: Service URL. Default value is "https://management.azure.com".
121+
:param base_url: Service URL. Default value is None.
122122
:type base_url: str
123+
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
124+
None.
125+
:paramtype cloud_setting: ~azure.core.AzureClouds
126+
:keyword api_version: Api Version. Default value is "2018-06-01". Note that overriding this
127+
default value may result in unsupported behavior.
128+
:paramtype api_version: str
123129
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
124130
Retry-After header is present.
125131
"""
@@ -128,12 +134,24 @@ def __init__(
128134
self,
129135
credential: "TokenCredential",
130136
subscription_id: str,
131-
base_url: str = "https://management.azure.com",
137+
base_url: Optional[str] = None,
138+
*,
139+
cloud_setting: Optional["AzureClouds"] = None,
132140
**kwargs: Any
133141
) -> None:
142+
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
143+
_endpoints = get_arm_endpoints(_cloud)
144+
if not base_url:
145+
base_url = _endpoints["resource_manager"]
146+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
134147
self._config = MariaDBManagementClientConfiguration(
135-
credential=credential, subscription_id=subscription_id, **kwargs
148+
credential=credential,
149+
subscription_id=subscription_id,
150+
cloud_setting=cloud_setting,
151+
credential_scopes=credential_scopes,
152+
**kwargs
136153
)
154+
137155
_policies = kwargs.pop("policies", None)
138156
if _policies is None:
139157
_policies = [
@@ -152,7 +170,7 @@ def __init__(
152170
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
153171
self._config.http_logging_policy,
154172
]
155-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
173+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
156174

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