Skip to content

Commit c64d7d5

Browse files
author
SDKAuto
committed
CodeGen from PR 19121 in Azure/azure-rest-api-specs
Merge cf09564e128a09ae6060798bb271c23de7d15788 into 898587c563d7b1941e1a10779ea7b122dce8ad6f
1 parent adbb259 commit c64d7d5

File tree

113 files changed

+29435
-20286
lines changed

Some content is hidden

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

113 files changed

+29435
-20286
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"autorest": "3.7.2",
3+
"use": [
4+
"@autorest/[email protected]",
5+
"@autorest/[email protected]"
6+
],
7+
"commit": "0331c71c5b8fc7518877c2e6d9ec9fb846318be9",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/automation/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
10+
"readme": "specification/automation/resource-manager/readme.md"
11+
}

sdk/automation/azure-mgmt-automation/azure/mgmt/automation/__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__ = ['AutomationClient']
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__ = ['AutomationClient']
21+
__all__.extend([p for p in _patch_all if p not in __all__])
22+
23+
_patch_sdk()

sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py

Lines changed: 211 additions & 148 deletions
Large diffs are not rendered by default.

sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_configuration.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,43 @@
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 AutomationClientConfiguration(Configuration):
22+
class AutomationClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2523
"""Configuration for AutomationClient.
2624
2725
Note that all parameters used to create this instance are saved as instance
2826
attributes.
2927
3028
:param credential: Credential needed for the client to connect to Azure.
3129
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
30+
:param subscription_id: Gets subscription credentials which uniquely identify Microsoft Azure
31+
subscription. The subscription ID forms part of the URI for every service call.
3332
:type subscription_id: str
3433
"""
3534

3635
def __init__(
3736
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
37+
credential: "TokenCredential",
38+
subscription_id: str,
39+
**kwargs: Any
40+
) -> None:
41+
super(AutomationClientConfiguration, self).__init__(**kwargs)
4342
if credential is None:
4443
raise ValueError("Parameter 'credential' must not be None.")
4544
if subscription_id is None:
4645
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(AutomationClientConfiguration, self).__init__(**kwargs)
4846

4947
self.credential = credential
5048
self.subscription_id = subscription_id
@@ -67,4 +65,4 @@ def _configure(
6765
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6866
self.authentication_policy = kwargs.get('authentication_policy')
6967
if self.credential and not self.authentication_policy:
70-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
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 AutomationClientConfiguration
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: AutomationClientConfiguration
44+
_serialize: "Serializer"
45+
_deserialize: "Deserializer"

sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_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 = "1.1.0b1"
9+
VERSION = "1.0.0b1"

sdk/automation/azure-mgmt-automation/azure/mgmt/automation/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 ._automation_client import AutomationClient
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__ = ['AutomationClient']
18+
__all__.extend([p for p in _patch_all if p not in __all__])
19+
20+
_patch_sdk()

0 commit comments

Comments
 (0)