Skip to content

Commit 6a0401c

Browse files
SDKAutotadelesh
SDKAuto
andcommitted
CodeGen from PR 18713 in Azure/azure-rest-api-specs
Add groupids in privateLinkConnections property in *response only* (Azure#18713) * add groupids in response * fix prettier issues * fix consistency problem with two swagger file Co-authored-by: Chenjie Shi <[email protected]>
1 parent 72ed8a2 commit 6a0401c

File tree

108 files changed

+24788
-17985
lines changed

Some content is hidden

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

108 files changed

+24788
-17985
lines changed
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": "6cb07747e61d4068750cb2666ab1b32197037dbf",
8+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9+
"autorest_command": "autorest specification/automation/resource-manager/readme.md --multiapi --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

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
__version__ = VERSION
1313
__all__ = ['AutomationClient']
1414

15-
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
18-
except ImportError:
19-
pass
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

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

+143-174
Large diffs are not rendered by default.

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

+11-13
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)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
{
2+
"chosen_version": "",
3+
"total_api_version_list": ["2015-10-31", "2018-06-30", "2019-06-01", "2020-01-13-preview", "2021-06-22"],
4+
"client": {
5+
"name": "AutomationClient",
6+
"filename": "_automation_client",
7+
"description": "Automation Client.",
8+
"host_value": "\"https://management.azure.com\"",
9+
"parameterized_host_template": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": false,
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AutomationClientConfiguration\"], \"._operations_mixin\": [\"AutomationClientOperationsMixin\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AutomationClientConfiguration\"], \"._operations_mixin\": [\"AutomationClientOperationsMixin\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
15+
},
16+
"global_parameters": {
17+
"sync": {
18+
"credential": {
19+
"signature": "credential, # type: \"TokenCredential\"",
20+
"description": "Credential needed for the client to connect to Azure.",
21+
"docstring_type": "~azure.core.credentials.TokenCredential",
22+
"required": true
23+
},
24+
"subscription_id": {
25+
"signature": "subscription_id, # type: str",
26+
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
27+
"docstring_type": "str",
28+
"required": true
29+
}
30+
},
31+
"async": {
32+
"credential": {
33+
"signature": "credential: \"AsyncTokenCredential\",",
34+
"description": "Credential needed for the client to connect to Azure.",
35+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
36+
"required": true
37+
},
38+
"subscription_id": {
39+
"signature": "subscription_id: str,",
40+
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
41+
"docstring_type": "str",
42+
"required": true
43+
}
44+
},
45+
"constant": {
46+
},
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=\"https://management.azure.com\", # type: str",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: str = \"https://management.azure.com\",",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
90+
},
91+
"config": {
92+
"credential": true,
93+
"credential_scopes": ["https://management.azure.com/.default"],
94+
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
95+
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
96+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
97+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
98+
},
99+
"operation_groups": {
100+
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
101+
"private_link_resources": "PrivateLinkResourcesOperations",
102+
"python2_package": "Python2PackageOperations",
103+
"agent_registration_information": "AgentRegistrationInformationOperations",
104+
"dsc_node": "DscNodeOperations",
105+
"node_reports": "NodeReportsOperations",
106+
"dsc_node_configuration": "DscNodeConfigurationOperations",
107+
"dsc_compilation_job": "DscCompilationJobOperations",
108+
"dsc_compilation_job_stream": "DscCompilationJobStreamOperations",
109+
"node_count_information": "NodeCountInformationOperations",
110+
"source_control": "SourceControlOperations",
111+
"source_control_sync_job": "SourceControlSyncJobOperations",
112+
"source_control_sync_job_streams": "SourceControlSyncJobStreamsOperations",
113+
"automation_account": "AutomationAccountOperations",
114+
"statistics": "StatisticsOperations",
115+
"usages": "UsagesOperations",
116+
"keys": "KeysOperations",
117+
"certificate": "CertificateOperations",
118+
"connection": "ConnectionOperations",
119+
"connection_type": "ConnectionTypeOperations",
120+
"credential": "CredentialOperations",
121+
"hybrid_runbook_worker_group": "HybridRunbookWorkerGroupOperations",
122+
"job_schedule": "JobScheduleOperations",
123+
"linked_workspace": "LinkedWorkspaceOperations",
124+
"activity": "ActivityOperations",
125+
"module": "ModuleOperations",
126+
"object_data_types": "ObjectDataTypesOperations",
127+
"fields": "FieldsOperations",
128+
"schedule": "ScheduleOperations",
129+
"variable": "VariableOperations",
130+
"watcher": "WatcherOperations",
131+
"dsc_configuration": "DscConfigurationOperations",
132+
"job": "JobOperations",
133+
"job_stream": "JobStreamOperations",
134+
"operations": "Operations",
135+
"software_update_configurations": "SoftwareUpdateConfigurationsOperations",
136+
"software_update_configuration_runs": "SoftwareUpdateConfigurationRunsOperations",
137+
"software_update_configuration_machine_runs": "SoftwareUpdateConfigurationMachineRunsOperations",
138+
"runbook_draft": "RunbookDraftOperations",
139+
"runbook": "RunbookOperations",
140+
"test_job_streams": "TestJobStreamsOperations",
141+
"test_job": "TestJobOperations",
142+
"webhook": "WebhookOperations",
143+
"hybrid_runbook_workers": "HybridRunbookWorkersOperations"
144+
},
145+
"operation_mixins": {
146+
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
147+
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
148+
"operations": {
149+
"convert_graph_runbook_content" : {
150+
"sync": {
151+
"signature": "def convert_graph_runbook_content(\n self,\n resource_group_name, # type: str\n automation_account_name, # type: str\n parameters, # type: \"_models.GraphicalRunbookContent\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e \"_models.GraphicalRunbookContent\"\n",
152+
"doc": "\"\"\"Post operation to serialize or deserialize GraphRunbookContent.\n\n:param resource_group_name: Name of an Azure Resource group.\n:type resource_group_name: str\n:param automation_account_name: The name of the automation account.\n:type automation_account_name: str\n:param parameters: Input data describing the graphical runbook.\n:type parameters: ~azure.mgmt.automation.models.GraphicalRunbookContent\n:keyword api_version: Api Version. Default value is \"2021-06-22\". Note that overriding this\n default value may result in unsupported behavior.\n:paramtype api_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: GraphicalRunbookContent, or the result of cls(response)\n:rtype: ~azure.mgmt.automation.models.GraphicalRunbookContent\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
153+
},
154+
"async": {
155+
"coroutine": true,
156+
"signature": "async def convert_graph_runbook_content(\n self,\n resource_group_name: str,\n automation_account_name: str,\n parameters: \"_models.GraphicalRunbookContent\",\n **kwargs: Any\n) -\u003e \"_models.GraphicalRunbookContent\":\n",
157+
"doc": "\"\"\"Post operation to serialize or deserialize GraphRunbookContent.\n\n:param resource_group_name: Name of an Azure Resource group.\n:type resource_group_name: str\n:param automation_account_name: The name of the automation account.\n:type automation_account_name: str\n:param parameters: Input data describing the graphical runbook.\n:type parameters: ~azure.mgmt.automation.models.GraphicalRunbookContent\n:keyword api_version: Api Version. Default value is \"2021-06-22\". Note that overriding this\n default value may result in unsupported behavior.\n:paramtype api_version: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: GraphicalRunbookContent, or the result of cls(response)\n:rtype: ~azure.mgmt.automation.models.GraphicalRunbookContent\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
158+
},
159+
"call": "resource_group_name, automation_account_name, parameters"
160+
}
161+
}
162+
}
163+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
#
4+
# Copyright (c) Microsoft Corporation. All rights reserved.
5+
#
6+
# The MIT License (MIT)
7+
#
8+
# Permission is hereby granted, free of charge, to any person obtaining a copy
9+
# of this software and associated documentation files (the ""Software""), to
10+
# deal in the Software without restriction, including without limitation the
11+
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12+
# sell copies of the Software, and to permit persons to whom the Software is
13+
# furnished to do so, subject to the following conditions:
14+
#
15+
# The above copyright notice and this permission notice shall be included in
16+
# all copies or substantial portions of the Software.
17+
#
18+
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24+
# IN THE SOFTWARE.
25+
#
26+
# --------------------------------------------------------------------------
27+
28+
# This file is used for handwritten extensions to the generated code. Example:
29+
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
30+
def patch_sdk():
31+
pass
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 azure.core.pipeline.transport import HttpRequest
9+
10+
def _convert_request(request, files=None):
11+
data = request.content if not files else None
12+
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
13+
if files:
14+
request.set_formdata_body(files)
15+
return request
16+
17+
def _format_url_section(template, **kwargs):
18+
components = template.split("/")
19+
while components:
20+
try:
21+
return template.format(**kwargs)
22+
except KeyError as key:
23+
formatted_components = template.split("/")
24+
components = [
25+
c for c in formatted_components if "{}".format(key.args[0]) not in c
26+
]
27+
template = "/".join(components)

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

+1-1
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

+5
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@
88

99
from ._automation_client import AutomationClient
1010
__all__ = ['AutomationClient']
11+
12+
# `._patch.py` is used for handwritten extensions to the generated code
13+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
14+
from ._patch import patch_sdk
15+
patch_sdk()

0 commit comments

Comments
 (0)