Skip to content

Commit

Permalink
CodeGen from PR 15001 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[python]track2 config (Azure#15001)

* track2 config

* directive for required type in readme.python.md

* Update readme.md

* Update readme.python.md

* Update readme.python.md
  • Loading branch information
SDKAuto committed Jun 28, 2021
1 parent f897769 commit d189e79
Show file tree
Hide file tree
Showing 20 changed files with 172 additions and 138 deletions.
11 changes: 7 additions & 4 deletions sdk/labservices/azure-mgmt-labservices/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"autorest": "3.0.6369",
"use": "@autorest/python@5.6.2",
"commit": "90167a86aca9eed5d51c299b262212738e233e2a",
"autorest": "3.4.2",
"use": [
"@autorest/python@5.8.1",
"@autorest/modelerfour@4.19.2"
],
"commit": "c803720c6bcfcb0fcf4c97f3463ec33a18f9e55c",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/labservices/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/python@5.6.2 --version=3.0.6369",
"autorest_command": "autorest specification/labservices/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/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
"readme": "specification/labservices/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import ManagedLabsClientConfiguration
from .operations import ProviderOperationsOperations
Expand Down Expand Up @@ -96,6 +97,24 @@ def __init__(
self.users = UsersOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"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\": [\"ManagedLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ManagedLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
"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\": [\"ManagedLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ManagedLabsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down Expand Up @@ -107,11 +107,5 @@
"environment_settings": "EnvironmentSettingsOperations",
"environments": "EnvironmentsOperations",
"users": "UsersOperations"
},
"operation_mixins": {
"sync_imports": "None",
"async_imports": "None",
"operations": {
}
}
}
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.0.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand Down Expand Up @@ -93,6 +94,23 @@ def __init__(
self.users = UsersOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def list(
filter: Optional[str] = None,
top: Optional[int] = None,
orderby: Optional[str] = None,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ResponseWithContinuationEnvironmentSetting"]:
"""List environment setting in a given lab.
Expand Down Expand Up @@ -148,7 +148,7 @@ async def get(
lab_name: str,
environment_setting_name: str,
expand: Optional[str] = None,
**kwargs
**kwargs: Any
) -> "_models.EnvironmentSetting":
"""Get environment setting.
Expand Down Expand Up @@ -219,7 +219,7 @@ async def _create_or_update_initial(
lab_name: str,
environment_setting_name: str,
environment_setting: "_models.EnvironmentSetting",
**kwargs
**kwargs: Any
) -> "_models.EnvironmentSetting":
cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentSetting"]
error_map = {
Expand Down Expand Up @@ -280,7 +280,7 @@ async def begin_create_or_update(
lab_name: str,
environment_setting_name: str,
environment_setting: "_models.EnvironmentSetting",
**kwargs
**kwargs: Any
) -> AsyncLROPoller["_models.EnvironmentSetting"]:
"""Create or replace an existing Environment Setting. This operation can take a while to complete.
Expand All @@ -297,8 +297,8 @@ async def begin_create_or_update(
:type environment_setting: ~azure.mgmt.labservices.models.EnvironmentSetting
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either EnvironmentSetting or the result of cls(response)
Expand Down Expand Up @@ -361,7 +361,7 @@ async def _delete_initial(
lab_account_name: str,
lab_name: str,
environment_setting_name: str,
**kwargs
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
Expand Down Expand Up @@ -409,7 +409,7 @@ async def begin_delete(
lab_account_name: str,
lab_name: str,
environment_setting_name: str,
**kwargs
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Delete environment setting. This operation can take a while to complete.
Expand All @@ -423,8 +423,8 @@ async def begin_delete(
:type environment_setting_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
Expand Down Expand Up @@ -484,7 +484,7 @@ async def update(
lab_name: str,
environment_setting_name: str,
environment_setting: "_models.EnvironmentSettingFragment",
**kwargs
**kwargs: Any
) -> "_models.EnvironmentSetting":
"""Modify properties of environment setting.
Expand Down Expand Up @@ -558,7 +558,7 @@ async def claim_any(
lab_account_name: str,
lab_name: str,
environment_setting_name: str,
**kwargs
**kwargs: Any
) -> None:
"""Claims a random environment for a user in an environment settings.
Expand Down Expand Up @@ -622,7 +622,7 @@ async def publish(
lab_name: str,
environment_setting_name: str,
publish_payload: "_models.PublishPayload",
**kwargs
**kwargs: Any
) -> None:
"""Provisions/deprovisions required resources for an environment setting based on current state of
the lab/environment setting.
Expand Down Expand Up @@ -693,7 +693,7 @@ async def _start_initial(
lab_account_name: str,
lab_name: str,
environment_setting_name: str,
**kwargs
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
Expand Down Expand Up @@ -741,7 +741,7 @@ async def begin_start(
lab_account_name: str,
lab_name: str,
environment_setting_name: str,
**kwargs
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Starts a template by starting all resources inside the template. This operation can take a
while to complete.
Expand All @@ -756,8 +756,8 @@ async def begin_start(
:type environment_setting_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
Expand Down Expand Up @@ -816,7 +816,7 @@ async def _stop_initial(
lab_account_name: str,
lab_name: str,
environment_setting_name: str,
**kwargs
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
Expand Down Expand Up @@ -864,7 +864,7 @@ async def begin_stop(
lab_account_name: str,
lab_name: str,
environment_setting_name: str,
**kwargs
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Starts a template by starting all resources inside the template. This operation can take a
while to complete.
Expand All @@ -879,8 +879,8 @@ async def begin_stop(
:type environment_setting_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
False for no polling, or your own initialized polling object for a personal polling strategy.
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
Expand Down
Loading

0 comments on commit d189e79

Please sign in to comment.