Skip to content

Commit

Permalink
CodeGen from PR 17169 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 643df92b04b2fc3f3a51d8b6765dafabfd4d3559 into 698ebc7
  • Loading branch information
SDKAuto committed Dec 23, 2021
1 parent 6c50bbe commit e164053
Show file tree
Hide file tree
Showing 108 changed files with 23,207 additions and 10,589 deletions.
11 changes: 11 additions & 0 deletions sdk/automation/azure-mgmt-automation/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.7.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "57755cacc5faa02450cd019bb49a106586c521a7",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/automation/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
"readme": "specification/automation/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
__version__ = VERSION
__all__ = ['AutomationClient']

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

Expand Down Expand Up @@ -40,11 +40,11 @@ def __init__(
**kwargs # type: Any
):
# type: (...) -> None
super(AutomationClientConfiguration, self).__init__(**kwargs)
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(AutomationClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand All @@ -67,4 +67,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"chosen_version": "",
"total_api_version_list": ["2015-10-31", "2018-06-30", "2019-06-01", "2020-01-13-preview", "2021-06-22"],
"client": {
"name": "AutomationClient",
"filename": "_automation_client",
"description": "Automation Client.",
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AutomationClientConfiguration\"], \"._operations_mixin\": [\"AutomationClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AutomationClientConfiguration\"], \"._operations_mixin\": [\"AutomationClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=\"https://management.azure.com\", # type: str",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"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\"]}}}",
"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\"]}}}"
},
"operation_groups": {
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
"private_link_resources": "PrivateLinkResourcesOperations",
"python2_package": "Python2PackageOperations",
"agent_registration_information": "AgentRegistrationInformationOperations",
"dsc_node": "DscNodeOperations",
"node_reports": "NodeReportsOperations",
"dsc_node_configuration": "DscNodeConfigurationOperations",
"dsc_compilation_job": "DscCompilationJobOperations",
"dsc_compilation_job_stream": "DscCompilationJobStreamOperations",
"node_count_information": "NodeCountInformationOperations",
"source_control": "SourceControlOperations",
"source_control_sync_job": "SourceControlSyncJobOperations",
"source_control_sync_job_streams": "SourceControlSyncJobStreamsOperations",
"automation_account": "AutomationAccountOperations",
"statistics": "StatisticsOperations",
"usages": "UsagesOperations",
"keys": "KeysOperations",
"certificate": "CertificateOperations",
"connection": "ConnectionOperations",
"connection_type": "ConnectionTypeOperations",
"credential": "CredentialOperations",
"hybrid_runbook_worker_group": "HybridRunbookWorkerGroupOperations",
"job_schedule": "JobScheduleOperations",
"linked_workspace": "LinkedWorkspaceOperations",
"activity": "ActivityOperations",
"module": "ModuleOperations",
"object_data_types": "ObjectDataTypesOperations",
"fields": "FieldsOperations",
"schedule": "ScheduleOperations",
"variable": "VariableOperations",
"watcher": "WatcherOperations",
"dsc_configuration": "DscConfigurationOperations",
"job": "JobOperations",
"job_stream": "JobStreamOperations",
"operations": "Operations",
"software_update_configurations": "SoftwareUpdateConfigurationsOperations",
"software_update_configuration_runs": "SoftwareUpdateConfigurationRunsOperations",
"software_update_configuration_machine_runs": "SoftwareUpdateConfigurationMachineRunsOperations",
"runbook_draft": "RunbookDraftOperations",
"runbook": "RunbookOperations",
"test_job_streams": "TestJobStreamsOperations",
"test_job": "TestJobOperations",
"webhook": "WebhookOperations",
"hybrid_runbook_workers": "HybridRunbookWorkersOperations"
},
"operation_mixins": {
"sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"operations": {
"convert_graph_runbook_content" : {
"sync": {
"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",
"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 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\"\"\""
},
"async": {
"coroutine": true,
"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",
"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 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\"\"\""
},
"call": "resource_group_name, automation_account_name, parameters"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------

# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from azure.core.pipeline.transport import HttpRequest

def _convert_request(request, files=None):
data = request.content if not files else None
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
if files:
request.set_formdata_body(files)
return request

def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
try:
return template.format(**kwargs)
except KeyError as key:
formatted_components = template.split("/")
components = [
c for c in formatted_components if "{}".format(key.args[0]) not in c
]
template = "/".join(components)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.1.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@

from ._automation_client import AutomationClient
__all__ = ['AutomationClient']

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
Loading

0 comments on commit e164053

Please sign in to comment.