From 5c07564ccaa1063311294dda04229e975e553286 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Jun 2021 09:00:28 +0000 Subject: [PATCH] CodeGen from PR 15001 in Azure/azure-rest-api-specs [python]track2 config (#15001) * track2 config * directive for required type in readme.python.md * Update readme.md * Update readme.python.md * Update readme.python.md --- .../azure-mgmt-hanaonazure/_meta.json | 11 ++++++---- .../hanaonazure/_hana_management_client.py | 19 ++++++++++++++++ .../azure/mgmt/hanaonazure/_metadata.json | 10 ++------- .../azure/mgmt/hanaonazure/_version.py | 2 +- .../aio/_hana_management_client.py | 18 +++++++++++++++ .../hanaonazure/aio/operations/_operations.py | 2 +- .../_provider_instances_operations.py | 20 ++++++++--------- .../operations/_sap_monitors_operations.py | 22 +++++++++---------- .../_provider_instances_operations.py | 8 +++---- .../operations/_sap_monitors_operations.py | 8 +++---- 10 files changed, 77 insertions(+), 43 deletions(-) diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/_meta.json b/sdk/hanaonazure/azure-mgmt-hanaonazure/_meta.json index 8cd41b025d7a..4be51945c24d 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/_meta.json +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/_meta.json @@ -1,8 +1,11 @@ { - "autorest": "3.0.6369", - "use": "@autorest/python@5.6.2", - "commit": "58f2489b1dc4752b6470d45e30ed1bd2469741f3", + "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/hanaonazure/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/hanaonazure/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/hanaonazure/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_hana_management_client.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_hana_management_client.py index 78f0f5bf22a7..19cfaa9174ef 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_hana_management_client.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_hana_management_client.py @@ -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 HanaManagementClientConfiguration from .operations import Operations @@ -66,6 +67,24 @@ def __init__( self.provider_instances = ProviderInstancesOperations( 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() diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_metadata.json b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_metadata.json index 59dafd56cbec..8b9c969b0f6c 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_metadata.json +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_metadata.json @@ -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\": [\"HanaManagementClientConfiguration\"]}}, \"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\": [\"HanaManagementClientConfiguration\"]}}, \"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\": [\"HanaManagementClientConfiguration\"]}}, \"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\": [\"HanaManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -101,11 +101,5 @@ "operations": "Operations", "sap_monitors": "SapMonitorsOperations", "provider_instances": "ProviderInstancesOperations" - }, - "operation_mixins": { - "sync_imports": "None", - "async_imports": "None", - "operations": { - } } } \ No newline at end of file diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_version.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_version.py index c47f66669f1b..e5754a47ce68 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_version.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/_version.py @@ -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" diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/_hana_management_client.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/_hana_management_client.py index 7fdd0a9b21bd..13a7b344e94b 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/_hana_management_client.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/_hana_management_client.py @@ -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 @@ -63,6 +64,23 @@ def __init__( self.provider_instances = ProviderInstancesOperations( 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() diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_operations.py index e0519b65b2f6..2f4be12ab803 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_operations.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationList"]: """Gets a list of SAP HANA management operations. diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_provider_instances_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_provider_instances_operations.py index 2e4039752fb7..3d3cd2d35b7f 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_provider_instances_operations.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_provider_instances_operations.py @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, sap_monitor_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ProviderInstanceListResult"]: """Gets a list of provider instances in the specified SAP monitor. @@ -126,7 +126,7 @@ async def get( resource_group_name: str, sap_monitor_name: str, provider_instance_name: str, - **kwargs + **kwargs: Any ) -> "_models.ProviderInstance": """Gets properties of a provider instance. @@ -193,7 +193,7 @@ async def _create_initial( sap_monitor_name: str, provider_instance_name: str, provider_instance_parameter: "_models.ProviderInstance", - **kwargs + **kwargs: Any ) -> "_models.ProviderInstance": cls = kwargs.pop('cls', None) # type: ClsType["_models.ProviderInstance"] error_map = { @@ -253,7 +253,7 @@ async def begin_create( sap_monitor_name: str, provider_instance_name: str, provider_instance_parameter: "_models.ProviderInstance", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.ProviderInstance"]: """Creates a provider instance. @@ -270,8 +270,8 @@ async def begin_create( :type provider_instance_parameter: ~azure.mgmt.hanaonazure.models.ProviderInstance :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 ProviderInstance or the result of cls(response) @@ -331,7 +331,7 @@ async def _delete_initial( resource_group_name: str, sap_monitor_name: str, provider_instance_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -378,7 +378,7 @@ async def begin_delete( resource_group_name: str, sap_monitor_name: str, provider_instance_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a provider instance. @@ -393,8 +393,8 @@ async def begin_delete( :type provider_instance_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) diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_sap_monitors_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_sap_monitors_operations.py index 137de9e7a8f1..beb8ec58c9ee 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_sap_monitors_operations.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/aio/operations/_sap_monitors_operations.py @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SapMonitorListResult"]: """Gets a list of SAP monitors in the specified subscription. @@ -117,7 +117,7 @@ async def get( self, resource_group_name: str, sap_monitor_name: str, - **kwargs + **kwargs: Any ) -> "_models.SapMonitor": """Gets properties of a SAP monitor. @@ -180,7 +180,7 @@ async def _create_initial( resource_group_name: str, sap_monitor_name: str, sap_monitor_parameter: "_models.SapMonitor", - **kwargs + **kwargs: Any ) -> "_models.SapMonitor": cls = kwargs.pop('cls', None) # type: ClsType["_models.SapMonitor"] error_map = { @@ -238,7 +238,7 @@ async def begin_create( resource_group_name: str, sap_monitor_name: str, sap_monitor_parameter: "_models.SapMonitor", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.SapMonitor"]: """Creates a SAP monitor. @@ -252,8 +252,8 @@ async def begin_create( :type sap_monitor_parameter: ~azure.mgmt.hanaonazure.models.SapMonitor :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 SapMonitor or the result of cls(response) @@ -310,7 +310,7 @@ async def _delete_initial( self, resource_group_name: str, sap_monitor_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { @@ -355,7 +355,7 @@ async def begin_delete( self, resource_group_name: str, sap_monitor_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a SAP monitor. @@ -367,8 +367,8 @@ async def begin_delete( :type sap_monitor_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) @@ -422,7 +422,7 @@ async def update( resource_group_name: str, sap_monitor_name: str, tags_parameter: "_models.Tags", - **kwargs + **kwargs: Any ) -> "_models.SapMonitor": """Patches the Tags field of a SAP monitor. diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_provider_instances_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_provider_instances_operations.py index 8bc1479655b9..1e365b7e3852 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_provider_instances_operations.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_provider_instances_operations.py @@ -278,8 +278,8 @@ def begin_create( :type provider_instance_parameter: ~azure.mgmt.hanaonazure.models.ProviderInstance :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 ARMPolling 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 ARMPolling. + 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.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either ProviderInstance or the result of cls(response) @@ -403,8 +403,8 @@ def begin_delete( :type provider_instance_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 ARMPolling 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 ARMPolling. + 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.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_sap_monitors_operations.py b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_sap_monitors_operations.py index 2e79b755f63b..0d62bf30dc54 100644 --- a/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_sap_monitors_operations.py +++ b/sdk/hanaonazure/azure-mgmt-hanaonazure/azure/mgmt/hanaonazure/operations/_sap_monitors_operations.py @@ -260,8 +260,8 @@ def begin_create( :type sap_monitor_parameter: ~azure.mgmt.hanaonazure.models.SapMonitor :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 ARMPolling 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 ARMPolling. + 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.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either SapMonitor or the result of cls(response) @@ -377,8 +377,8 @@ def begin_delete( :type sap_monitor_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 ARMPolling 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 ARMPolling. + 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.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response)