Skip to content

Commit d88b710

Browse files
author
SDKAuto
committed
CodeGen from PR 19716 in Azure/azure-rest-api-specs
Merge b694193635220431592e54aea59137a812db4886 into 432872fac1d0f8edcae98a0e8504afc0ee302710
1 parent 77ac724 commit d88b710

File tree

70 files changed

+10736
-8915
lines changed

Some content is hidden

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

70 files changed

+10736
-8915
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.12.0",
4+
"@autorest/python@5.16.0",
55
"@autorest/modelerfour@4.19.3"
66
],
7-
"commit": "6b29b8552671eded065f51ee1b291582ab8cc149",
7+
"commit": "a26a5fddefa7f74172535a1e8d1f47fa1d41552f",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/mysql/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
10-
"readme": "specification/mysql/resource-manager/readme.md"
9+
"autorest_command": "autorest specification/mariadb/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
10+
"readme": "specification/mariadb/resource-manager/readme.md"
1111
}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['MariaDBManagementClient']
1413

1514
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
1817
except ImportError:
19-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
__all__ = ['MariaDBManagementClient']
21+
__all__.extend([p for p in _patch_all if p not in __all__])
22+
23+
_patch_sdk()

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

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

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

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2119
from azure.core.credentials import TokenCredential
2220

2321

24-
class MariaDBManagementClientConfiguration(Configuration):
22+
class MariaDBManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2523
"""Configuration for MariaDBManagementClient.
2624
2725
Note that all parameters used to create this instance are saved as instance
@@ -35,16 +33,15 @@ class MariaDBManagementClientConfiguration(Configuration):
3533

3634
def __init__(
3735
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
36+
credential: "TokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
) -> None:
40+
super(MariaDBManagementClientConfiguration, self).__init__(**kwargs)
4341
if credential is None:
4442
raise ValueError("Parameter 'credential' must not be None.")
4543
if subscription_id is None:
4644
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(MariaDBManagementClientConfiguration, self).__init__(**kwargs)
4845

4946
self.credential = credential
5047
self.subscription_id = subscription_id
@@ -67,4 +64,4 @@ def _configure(
6764
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6865
self.authentication_policy = kwargs.get('authentication_policy')
6966
if self.credential and not self.authentication_policy:
70-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
67+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

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

Lines changed: 114 additions & 95 deletions
Large diffs are not rendered by default.

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

Lines changed: 0 additions & 167 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
13+
def patch_sdk():
14+
"""Do not remove from this file.
15+
16+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
17+
you can't accomplish using the techniques described in
18+
https://aka.ms/azsdk/python/dpcodegen/python/customize
19+
"""
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
# --------------------------------------------------------------------------
7+
8+
from abc import ABC
9+
from typing import TYPE_CHECKING
10+
11+
from azure.core.pipeline.transport import HttpRequest
12+
13+
from ._configuration import MariaDBManagementClientConfiguration
14+
15+
if TYPE_CHECKING:
16+
# pylint: disable=unused-import,ungrouped-imports
17+
from msrest import Deserializer, Serializer
18+
19+
from azure.core import PipelineClient
20+
21+
def _convert_request(request, files=None):
22+
data = request.content if not files else None
23+
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
24+
if files:
25+
request.set_formdata_body(files)
26+
return request
27+
28+
def _format_url_section(template, **kwargs):
29+
components = template.split("/")
30+
while components:
31+
try:
32+
return template.format(**kwargs)
33+
except KeyError as key:
34+
formatted_components = template.split("/")
35+
components = [
36+
c for c in formatted_components if "{}".format(key.args[0]) not in c
37+
]
38+
template = "/".join(components)
39+
40+
class MixinABC(ABC):
41+
"""DO NOT use this class. It is for internal typing use only."""
42+
_client: "PipelineClient"
43+
_config: MariaDBManagementClientConfiguration
44+
_serialize: "Serializer"
45+
_deserialize: "Deserializer"

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

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

9-
VERSION = "10.1.0"
9+
VERSION = "1.0.0b1"

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/aio/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,14 @@
77
# --------------------------------------------------------------------------
88

99
from ._maria_db_management_client import MariaDBManagementClient
10+
11+
try:
12+
from ._patch import __all__ as _patch_all
13+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
14+
except ImportError:
15+
_patch_all = []
16+
from ._patch import patch_sdk as _patch_sdk
1017
__all__ = ['MariaDBManagementClient']
18+
__all__.extend([p for p in _patch_all if p not in __all__])
19+
20+
_patch_sdk()

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/aio/_configuration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
1414

1515
from .._version import VERSION
1616

@@ -19,7 +19,7 @@
1919
from azure.core.credentials_async import AsyncTokenCredential
2020

2121

22-
class MariaDBManagementClientConfiguration(Configuration):
22+
class MariaDBManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2323
"""Configuration for MariaDBManagementClient.
2424
2525
Note that all parameters used to create this instance are saved as instance
@@ -37,11 +37,11 @@ def __init__(
3737
subscription_id: str,
3838
**kwargs: Any
3939
) -> None:
40+
super(MariaDBManagementClientConfiguration, self).__init__(**kwargs)
4041
if credential is None:
4142
raise ValueError("Parameter 'credential' must not be None.")
4243
if subscription_id is None:
4344
raise ValueError("Parameter 'subscription_id' must not be None.")
44-
super(MariaDBManagementClientConfiguration, self).__init__(**kwargs)
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
@@ -63,4 +63,4 @@ def _configure(
6363
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
6464
self.authentication_policy = kwargs.get('authentication_policy')
6565
if self.credential and not self.authentication_policy:
66-
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
66+
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)