Skip to content

Commit

Permalink
CodeGen from PR 14873 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Revert "Adding stable swaggers (Azure#14804)" (Azure#14873)

This reverts commit c8d85bc.
  • Loading branch information
SDKAuto committed Jun 17, 2021
1 parent a94c363 commit f3671dd
Show file tree
Hide file tree
Showing 23 changed files with 242 additions and 216 deletions.
11 changes: 7 additions & 4 deletions sdk/hybridnetwork/azure-mgmt-hybridnetwork/_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": "5d89c9807d3e84a5890b381a68a308198f9ef141",
"autorest": "3.4.2",
"use": [
"@autorest/python@5.8.0",
"@autorest/modelerfour@4.19.2"
],
"commit": "752ca4a79d1e587d95567a62d98b63f55bd6fced",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/hybridnetwork/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/hybridnetwork/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.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
"readme": "specification/hybridnetwork/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 HybridNetworkManagementClientConfiguration
from .operations import NetworkFunctionsOperations
Expand Down Expand Up @@ -101,6 +102,24 @@ def __init__(
self.role_instances = RoleInstancesOperations(
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', min_length=1),
}
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\": [\"HybridNetworkManagementClientConfiguration\"]}}, \"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\": [\"HybridNetworkManagementClientConfiguration\"]}}, \"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\": [\"HybridNetworkManagementClientConfiguration\"]}}, \"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\": [\"HybridNetworkManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down Expand Up @@ -108,11 +108,5 @@
"network_function_vendor_skus": "NetworkFunctionVendorSkusOperations",
"vendor_network_functions": "VendorNetworkFunctionsOperations",
"role_instances": "RoleInstancesOperations"
},
"operation_mixins": {
"sync_imports": "None",
"async_imports": "None",
"operations": {
}
}
}
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 @@ -98,6 +99,23 @@ def __init__(
self.role_instances = RoleInstancesOperations(
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', min_length=1),
}
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 @@ -47,7 +47,7 @@ async def _delete_initial(
self,
resource_group_name: str,
device_name: str,
**kwargs
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
Expand All @@ -60,7 +60,7 @@ async def _delete_initial(
# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'deviceName': self._serialize.url("device_name", device_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
Expand Down Expand Up @@ -92,7 +92,7 @@ async def begin_delete(
self,
resource_group_name: str,
device_name: str,
**kwargs
**kwargs: Any
) -> AsyncLROPoller[None]:
"""Deletes the specified device.
Expand All @@ -102,8 +102,8 @@ async def begin_delete(
:type device_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 @@ -133,7 +133,7 @@ def get_long_running_output(pipeline_response):
return cls(pipeline_response, None, {})

path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'deviceName': self._serialize.url("device_name", device_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
Expand All @@ -156,7 +156,7 @@ async def get(
self,
resource_group_name: str,
device_name: str,
**kwargs
**kwargs: Any
) -> "_models.Device":
"""Gets information about the specified device.
Expand All @@ -180,7 +180,7 @@ async def get(
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'deviceName': self._serialize.url("device_name", device_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
Expand Down Expand Up @@ -216,7 +216,7 @@ async def _create_or_update_initial(
resource_group_name: str,
device_name: str,
parameters: "_models.Device",
**kwargs
**kwargs: Any
) -> "_models.Device":
cls = kwargs.pop('cls', None) # type: ClsType["_models.Device"]
error_map = {
Expand All @@ -230,7 +230,7 @@ async def _create_or_update_initial(
# Construct URL
url = self._create_or_update_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'deviceName': self._serialize.url("device_name", device_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
Expand Down Expand Up @@ -274,7 +274,7 @@ async def begin_create_or_update(
resource_group_name: str,
device_name: str,
parameters: "_models.Device",
**kwargs
**kwargs: Any
) -> AsyncLROPoller["_models.Device"]:
"""Creates or updates a device.
Expand All @@ -286,8 +286,8 @@ async def begin_create_or_update(
:type parameters: ~hybrid_network_management_client.models.Device
: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 Device or the result of cls(response)
Expand Down Expand Up @@ -321,7 +321,7 @@ def get_long_running_output(pipeline_response):
return deserialized

path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'deviceName': self._serialize.url("device_name", device_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
Expand All @@ -345,7 +345,7 @@ async def update_tags(
resource_group_name: str,
device_name: str,
parameters: "_models.TagsObject",
**kwargs
**kwargs: Any
) -> "_models.Device":
"""Updates device tags.
Expand All @@ -372,7 +372,7 @@ async def update_tags(
# Construct URL
url = self.update_tags.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'deviceName': self._serialize.url("device_name", device_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
Expand Down Expand Up @@ -409,7 +409,7 @@ async def update_tags(

def list_by_subscription(
self,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.DeviceListResult"]:
"""Lists all the devices in a subscription.
Expand Down Expand Up @@ -477,7 +477,7 @@ async def get_next(next_link=None):
def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.DeviceListResult"]:
"""Lists all the device resource in a resource group.
Expand Down Expand Up @@ -505,7 +505,7 @@ def prepare_request(next_link=None):
# Construct URL
url = self.list_by_resource_group.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -549,7 +549,7 @@ async def list_registration_key(
self,
resource_group_name: str,
device_name: str,
**kwargs
**kwargs: Any
) -> "_models.DeviceRegistrationKey":
"""List the registration key for the device.
Expand All @@ -573,7 +573,7 @@ async def list_registration_key(
# Construct URL
url = self.list_registration_key.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'deviceName': self._serialize.url("device_name", device_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list_by_vendor(
self,
vendor_name: str,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.NetworkFunctionSkuListResult"]:
"""Lists all network function vendor sku details in a vendor.
Expand Down Expand Up @@ -116,7 +116,7 @@ def list_by_sku(
self,
vendor_name: str,
vendor_sku_name: str,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.NetworkFunctionSkuDetails"]:
"""Lists information about network function vendor sku details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:

def list(
self,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.NetworkFunctionVendorListResult"]:
"""Lists all the available vendor and sku information.
Expand Down
Loading

0 comments on commit f3671dd

Please sign in to comment.