diff --git a/ChangeLog.md b/ChangeLog.md index ab90bc1e427..d49c6be20af 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,7 +6,8 @@ Modelerfour version: 4.13.351 **Bug Fixes** - Corrected generation of the item name of paging response when extracting data #648 - Corrected return type typing annotation for operations that return an optional body #656 -- Fixed mypy issue by only setting the generated `deserialized` variable to None if the operation has an optional return typ #656 +- Fixed mypy issue by only setting the generated `deserialized` variable to None if the operation has an optional return type #656 +- Fixed generation of pkgutil init files #661 ### 2020-05-22 - 5.0.0-preview.8 Modelerfour version: 4.13.351 diff --git a/autorest/codegen/serializers/__init__.py b/autorest/codegen/serializers/__init__.py index 538e6c29f7f..aa663b36b57 100644 --- a/autorest/codegen/serializers/__init__.py +++ b/autorest/codegen/serializers/__init__.py @@ -157,10 +157,10 @@ def _serialize_and_write_top_level_folder( self._autorestapi.write_file(namespace_path / Path("__init__.py"), general_serializer.serialize_init_file()) p = namespace_path.parent - while p.parent != Path("."): + while p != Path("."): # write pkgutil init file self._autorestapi.write_file( - namespace_path / Path("__init__.py"), general_serializer.serialize_pkgutil_init_file() + p / Path("__init__.py"), general_serializer.serialize_pkgutil_init_file() ) p = p.parent diff --git a/tasks.py b/tasks.py index 63933e8cf37..f4a8dbfea8a 100644 --- a/tasks.py +++ b/tasks.py @@ -227,6 +227,22 @@ def regenerate_python_arm(c, swagger_name=None, debug=False): } regen_expected(c, opts, debug) +@task +def regenerate_namespace_folders_test(c, debug=False): + # regenerate a swagger (randomly chose BodyArray) to have a namespace length > 1 + # to test pkgutil logic + default_mapping = {'AcceptanceTests/BodyArrayWithNamespaceFolders': ['body-array.json', 'vanilla.body.array']} + opts = { + 'output_base_dir': 'test/vanilla', + 'input_base_dir': swagger_dir, + 'mappings': default_mapping, + 'output_dir': 'Expected', + 'flattening_threshold': '1', + 'vanilla': True, + 'keep_version': True, + 'ns_prefix': True + } + regen_expected(c, opts, debug) @task def regenerate(c, swagger_name=None, debug=False): @@ -234,6 +250,7 @@ def regenerate(c, swagger_name=None, debug=False): regenerate_python(c, swagger_name, debug) regenerate_python_azure(c, swagger_name, debug) regenerate_python_arm(c, swagger_name, debug) + regenerate_namespace_folders_test(c, debug) if not swagger_name: regenerate_multiapi(c, debug) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/setup.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/setup.py new file mode 100644 index 00000000000..2a80ce689dd --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/setup.py @@ -0,0 +1,37 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# coding: utf-8 + +from setuptools import setup, find_packages + +NAME = "autorestswaggerbatarrayservice" +VERSION = "0.1.0" + +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["msrest>=0.6.0", "azure-core<2.0.0,>=1.2.0"] + +setup( + name=NAME, + version=VERSION, + description="AutoRestSwaggerBATArrayService", + author_email="", + url="", + keywords=["Swagger", "AutoRestSwaggerBATArrayService"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + Test Infrastructure for AutoRest Swagger BAT. + """ +) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/__init__.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/__init__.py new file mode 100644 index 00000000000..5960c353a89 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore \ No newline at end of file diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/__init__.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/__init__.py new file mode 100644 index 00000000000..5960c353a89 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore \ No newline at end of file diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/__init__.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/__init__.py new file mode 100644 index 00000000000..297c7f7d553 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 ._auto_rest_swagger_bat_array_service import AutoRestSwaggerBATArrayService +from ._version import VERSION + +__version__ = VERSION +__all__ = ['AutoRestSwaggerBATArrayService'] + +try: + from ._patch import patch_sdk + patch_sdk() +except ImportError: + pass diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_auto_rest_swagger_bat_array_service.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_auto_rest_swagger_bat_array_service.py new file mode 100644 index 00000000000..dc7a179c6f9 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_auto_rest_swagger_bat_array_service.py @@ -0,0 +1,61 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 typing import TYPE_CHECKING + +from azure.core import PipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + +from ._configuration import AutoRestSwaggerBATArrayServiceConfiguration +from .operations import ArrayOperations +from . import models + + +class AutoRestSwaggerBATArrayService(object): + """Test Infrastructure for AutoRest Swagger BAT. + + :ivar array: ArrayOperations operations + :vartype array: vanilla.body.array.operations.ArrayOperations + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'http://localhost:3000' + self._config = AutoRestSwaggerBATArrayServiceConfiguration(**kwargs) + self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.array = ArrayOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AutoRestSwaggerBATArrayService + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_configuration.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_configuration.py new file mode 100644 index 00000000000..01a896cbd3b --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_configuration.py @@ -0,0 +1,50 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + +class AutoRestSwaggerBATArrayServiceConfiguration(Configuration): + """Configuration for AutoRestSwaggerBATArrayService. + + Note that all parameters used to create this instance are saved as instance + attributes. + """ + + def __init__( + self, + **kwargs # type: Any + ): + # type: (...) -> None + super(AutoRestSwaggerBATArrayServiceConfiguration, self).__init__(**kwargs) + + kwargs.setdefault('sdk_moniker', 'autorestswaggerbatarrayservice/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_version.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_version.py new file mode 100644 index 00000000000..eae7c95b6fb --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/__init__.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/__init__.py new file mode 100644 index 00000000000..fb146161416 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/__init__.py @@ -0,0 +1,10 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 ._auto_rest_swagger_bat_array_service_async import AutoRestSwaggerBATArrayService +__all__ = ['AutoRestSwaggerBATArrayService'] diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_auto_rest_swagger_bat_array_service_async.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_auto_rest_swagger_bat_array_service_async.py new file mode 100644 index 00000000000..92d4d3d6cc0 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_auto_rest_swagger_bat_array_service_async.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 typing import Any, Optional + +from azure.core import AsyncPipelineClient +from msrest import Deserializer, Serializer + +from ._configuration_async import AutoRestSwaggerBATArrayServiceConfiguration +from .operations_async import ArrayOperations +from .. import models + + +class AutoRestSwaggerBATArrayService(object): + """Test Infrastructure for AutoRest Swagger BAT. + + :ivar array: ArrayOperations operations + :vartype array: vanilla.body.array.aio.operations_async.ArrayOperations + :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + """ + + def __init__( + self, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'http://localhost:3000' + self._config = AutoRestSwaggerBATArrayServiceConfiguration(**kwargs) + self._client = AsyncPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.array = ArrayOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AutoRestSwaggerBATArrayService": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_configuration_async.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_configuration_async.py new file mode 100644 index 00000000000..4bd0fc41701 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/_configuration_async.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 typing import Any + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies + +from .._version import VERSION + + +class AutoRestSwaggerBATArrayServiceConfiguration(Configuration): + """Configuration for AutoRestSwaggerBATArrayService. + + Note that all parameters used to create this instance are saved as instance + attributes. + """ + + def __init__( + self, + **kwargs: Any + ) -> None: + super(AutoRestSwaggerBATArrayServiceConfiguration, self).__init__(**kwargs) + + kwargs.setdefault('sdk_moniker', 'autorestswaggerbatarrayservice/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations_async/__init__.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations_async/__init__.py new file mode 100644 index 00000000000..d7ef70e49c3 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations_async/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 ._array_operations_async import ArrayOperations + +__all__ = [ + 'ArrayOperations', +] diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations_async/_array_operations_async.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations_async/_array_operations_async.py new file mode 100644 index 00000000000..bdb43df47d9 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/aio/operations_async/_array_operations_async.py @@ -0,0 +1,3185 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ArrayOperations: + """ArrayOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~vanilla.body.array.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get_null( + self, + **kwargs + ) -> List[int]: + """Get null array value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_null.metadata = {'url': '/array/null'} # type: ignore + + @distributed_trace_async + async def get_invalid( + self, + **kwargs + ) -> List[int]: + """Get invalid array [1, 2, 3. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_invalid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_invalid.metadata = {'url': '/array/invalid'} # type: ignore + + @distributed_trace_async + async def get_empty( + self, + **kwargs + ) -> List[int]: + """Get empty array value []. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_empty.metadata = {'url': '/array/empty'} # type: ignore + + @distributed_trace_async + async def put_empty( + self, + array_body: List[str], + **kwargs + ) -> None: + """Set array value empty []. + + :param array_body: + :type array_body: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_empty.metadata = {'url': '/array/empty'} # type: ignore + + @distributed_trace_async + async def get_boolean_tfft( + self, + **kwargs + ) -> List[bool]: + """Get boolean array value [true, false, false, true]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bool, or the result of cls(response) + :rtype: list[bool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bool]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_boolean_tfft.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bool]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_boolean_tfft.metadata = {'url': '/array/prim/boolean/tfft'} # type: ignore + + @distributed_trace_async + async def put_boolean_tfft( + self, + array_body: List[bool], + **kwargs + ) -> None: + """Set array value empty [true, false, false, true]. + + :param array_body: + :type array_body: list[bool] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_boolean_tfft.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[bool]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_boolean_tfft.metadata = {'url': '/array/prim/boolean/tfft'} # type: ignore + + @distributed_trace_async + async def get_boolean_invalid_null( + self, + **kwargs + ) -> List[bool]: + """Get boolean array value [true, null, false]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bool, or the result of cls(response) + :rtype: list[bool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bool]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_boolean_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bool]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_boolean_invalid_null.metadata = {'url': '/array/prim/boolean/true.null.false'} # type: ignore + + @distributed_trace_async + async def get_boolean_invalid_string( + self, + **kwargs + ) -> List[bool]: + """Get boolean array value [true, 'boolean', false]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bool, or the result of cls(response) + :rtype: list[bool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bool]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_boolean_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bool]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_boolean_invalid_string.metadata = {'url': '/array/prim/boolean/true.boolean.false'} # type: ignore + + @distributed_trace_async + async def get_integer_valid( + self, + **kwargs + ) -> List[int]: + """Get integer array value [1, -1, 3, 300]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_integer_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_integer_valid.metadata = {'url': '/array/prim/integer/1.-1.3.300'} # type: ignore + + @distributed_trace_async + async def put_integer_valid( + self, + array_body: List[int], + **kwargs + ) -> None: + """Set array value empty [1, -1, 3, 300]. + + :param array_body: + :type array_body: list[int] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_integer_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[int]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_integer_valid.metadata = {'url': '/array/prim/integer/1.-1.3.300'} # type: ignore + + @distributed_trace_async + async def get_int_invalid_null( + self, + **kwargs + ) -> List[int]: + """Get integer array value [1, null, 0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_int_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_int_invalid_null.metadata = {'url': '/array/prim/integer/1.null.zero'} # type: ignore + + @distributed_trace_async + async def get_int_invalid_string( + self, + **kwargs + ) -> List[int]: + """Get integer array value [1, 'integer', 0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_int_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_int_invalid_string.metadata = {'url': '/array/prim/integer/1.integer.0'} # type: ignore + + @distributed_trace_async + async def get_long_valid( + self, + **kwargs + ) -> List[int]: + """Get integer array value [1, -1, 3, 300]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of long, or the result of cls(response) + :rtype: list[long] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_long_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[long]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_long_valid.metadata = {'url': '/array/prim/long/1.-1.3.300'} # type: ignore + + @distributed_trace_async + async def put_long_valid( + self, + array_body: List[int], + **kwargs + ) -> None: + """Set array value empty [1, -1, 3, 300]. + + :param array_body: + :type array_body: list[long] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_long_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[long]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_long_valid.metadata = {'url': '/array/prim/long/1.-1.3.300'} # type: ignore + + @distributed_trace_async + async def get_long_invalid_null( + self, + **kwargs + ) -> List[int]: + """Get long array value [1, null, 0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of long, or the result of cls(response) + :rtype: list[long] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_long_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[long]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_long_invalid_null.metadata = {'url': '/array/prim/long/1.null.zero'} # type: ignore + + @distributed_trace_async + async def get_long_invalid_string( + self, + **kwargs + ) -> List[int]: + """Get long array value [1, 'integer', 0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of long, or the result of cls(response) + :rtype: list[long] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_long_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[long]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_long_invalid_string.metadata = {'url': '/array/prim/long/1.integer.0'} # type: ignore + + @distributed_trace_async + async def get_float_valid( + self, + **kwargs + ) -> List[float]: + """Get float array value [0, -0.01, 1.2e20]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_float_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_float_valid.metadata = {'url': '/array/prim/float/0--0.01-1.2e20'} # type: ignore + + @distributed_trace_async + async def put_float_valid( + self, + array_body: List[float], + **kwargs + ) -> None: + """Set array value [0, -0.01, 1.2e20]. + + :param array_body: + :type array_body: list[float] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_float_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[float]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_float_valid.metadata = {'url': '/array/prim/float/0--0.01-1.2e20'} # type: ignore + + @distributed_trace_async + async def get_float_invalid_null( + self, + **kwargs + ) -> List[float]: + """Get float array value [0.0, null, -1.2e20]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_float_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_float_invalid_null.metadata = {'url': '/array/prim/float/0.0-null-1.2e20'} # type: ignore + + @distributed_trace_async + async def get_float_invalid_string( + self, + **kwargs + ) -> List[float]: + """Get boolean array value [1.0, 'number', 0.0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_float_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_float_invalid_string.metadata = {'url': '/array/prim/float/1.number.0'} # type: ignore + + @distributed_trace_async + async def get_double_valid( + self, + **kwargs + ) -> List[float]: + """Get float array value [0, -0.01, 1.2e20]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_double_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_double_valid.metadata = {'url': '/array/prim/double/0--0.01-1.2e20'} # type: ignore + + @distributed_trace_async + async def put_double_valid( + self, + array_body: List[float], + **kwargs + ) -> None: + """Set array value [0, -0.01, 1.2e20]. + + :param array_body: + :type array_body: list[float] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_double_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[float]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_double_valid.metadata = {'url': '/array/prim/double/0--0.01-1.2e20'} # type: ignore + + @distributed_trace_async + async def get_double_invalid_null( + self, + **kwargs + ) -> List[float]: + """Get float array value [0.0, null, -1.2e20]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_double_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_double_invalid_null.metadata = {'url': '/array/prim/double/0.0-null-1.2e20'} # type: ignore + + @distributed_trace_async + async def get_double_invalid_string( + self, + **kwargs + ) -> List[float]: + """Get boolean array value [1.0, 'number', 0.0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_double_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_double_invalid_string.metadata = {'url': '/array/prim/double/1.number.0'} # type: ignore + + @distributed_trace_async + async def get_string_valid( + self, + **kwargs + ) -> List[str]: + """Get string array value ['foo1', 'foo2', 'foo3']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_string_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_string_valid.metadata = {'url': '/array/prim/string/foo1.foo2.foo3'} # type: ignore + + @distributed_trace_async + async def put_string_valid( + self, + array_body: List[str], + **kwargs + ) -> None: + """Set array value ['foo1', 'foo2', 'foo3']. + + :param array_body: + :type array_body: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_string_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_string_valid.metadata = {'url': '/array/prim/string/foo1.foo2.foo3'} # type: ignore + + @distributed_trace_async + async def get_enum_valid( + self, + **kwargs + ) -> List[Union[str, "models.FooEnum"]]: + """Get enum array value ['foo1', 'foo2', 'foo3']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of FooEnum, or the result of cls(response) + :rtype: list[str or ~vanilla.body.array.models.FooEnum] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.FooEnum"]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_enum_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_enum_valid.metadata = {'url': '/array/prim/enum/foo1.foo2.foo3'} # type: ignore + + @distributed_trace_async + async def put_enum_valid( + self, + array_body: List[Union[str, "models.FooEnum"]], + **kwargs + ) -> None: + """Set array value ['foo1', 'foo2', 'foo3']. + + :param array_body: + :type array_body: list[str or ~vanilla.body.array.models.FooEnum] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_enum_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_enum_valid.metadata = {'url': '/array/prim/enum/foo1.foo2.foo3'} # type: ignore + + @distributed_trace_async + async def get_string_enum_valid( + self, + **kwargs + ) -> List[Union[str, "models.Enum0"]]: + """Get enum array value ['foo1', 'foo2', 'foo3']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Enum0, or the result of cls(response) + :rtype: list[str or ~vanilla.body.array.models.Enum0] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.Enum0"]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_string_enum_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_string_enum_valid.metadata = {'url': '/array/prim/string-enum/foo1.foo2.foo3'} # type: ignore + + @distributed_trace_async + async def put_string_enum_valid( + self, + array_body: List[Union[str, "models.Enum1"]], + **kwargs + ) -> None: + """Set array value ['foo1', 'foo2', 'foo3']. + + :param array_body: + :type array_body: list[str or ~vanilla.body.array.models.Enum1] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_string_enum_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_string_enum_valid.metadata = {'url': '/array/prim/string-enum/foo1.foo2.foo3'} # type: ignore + + @distributed_trace_async + async def get_string_with_null( + self, + **kwargs + ) -> List[str]: + """Get string array value ['foo', null, 'foo2']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_string_with_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_string_with_null.metadata = {'url': '/array/prim/string/foo.null.foo2'} # type: ignore + + @distributed_trace_async + async def get_string_with_invalid( + self, + **kwargs + ) -> List[str]: + """Get string array value ['foo', 123, 'foo2']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_string_with_invalid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_string_with_invalid.metadata = {'url': '/array/prim/string/foo.123.foo2'} # type: ignore + + @distributed_trace_async + async def get_uuid_valid( + self, + **kwargs + ) -> List[str]: + """Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', + 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_uuid_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_uuid_valid.metadata = {'url': '/array/prim/uuid/valid'} # type: ignore + + @distributed_trace_async + async def put_uuid_valid( + self, + array_body: List[str], + **kwargs + ) -> None: + """Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', + 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + + :param array_body: + :type array_body: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_uuid_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_uuid_valid.metadata = {'url': '/array/prim/uuid/valid'} # type: ignore + + @distributed_trace_async + async def get_uuid_invalid_chars( + self, + **kwargs + ) -> List[str]: + """Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_uuid_invalid_chars.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_uuid_invalid_chars.metadata = {'url': '/array/prim/uuid/invalidchars'} # type: ignore + + @distributed_trace_async + async def get_date_valid( + self, + **kwargs + ) -> List[datetime.date]: + """Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of date, or the result of cls(response) + :rtype: list[~datetime.date] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.date]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[date]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_valid.metadata = {'url': '/array/prim/date/valid'} # type: ignore + + @distributed_trace_async + async def put_date_valid( + self, + array_body: List[datetime.date], + **kwargs + ) -> None: + """Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + + :param array_body: + :type array_body: list[~datetime.date] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_date_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[date]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_date_valid.metadata = {'url': '/array/prim/date/valid'} # type: ignore + + @distributed_trace_async + async def get_date_invalid_null( + self, + **kwargs + ) -> List[datetime.date]: + """Get date array value ['2012-01-01', null, '1776-07-04']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of date, or the result of cls(response) + :rtype: list[~datetime.date] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.date]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[date]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_invalid_null.metadata = {'url': '/array/prim/date/invalidnull'} # type: ignore + + @distributed_trace_async + async def get_date_invalid_chars( + self, + **kwargs + ) -> List[datetime.date]: + """Get date array value ['2011-03-22', 'date']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of date, or the result of cls(response) + :rtype: list[~datetime.date] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.date]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_invalid_chars.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[date]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_invalid_chars.metadata = {'url': '/array/prim/date/invalidchars'} # type: ignore + + @distributed_trace_async + async def get_date_time_valid( + self, + **kwargs + ) -> List[datetime.datetime]: + """Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', + '1492-10-12T10:15:01-08:00']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of datetime, or the result of cls(response) + :rtype: list[~datetime.datetime] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.datetime]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_time_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[iso-8601]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_time_valid.metadata = {'url': '/array/prim/date-time/valid'} # type: ignore + + @distributed_trace_async + async def put_date_time_valid( + self, + array_body: List[datetime.datetime], + **kwargs + ) -> None: + """Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', + '1492-10-12T10:15:01-08:00']. + + :param array_body: + :type array_body: list[~datetime.datetime] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_date_time_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[iso-8601]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_date_time_valid.metadata = {'url': '/array/prim/date-time/valid'} # type: ignore + + @distributed_trace_async + async def get_date_time_invalid_null( + self, + **kwargs + ) -> List[datetime.datetime]: + """Get date array value ['2000-12-01t00:00:01z', null]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of datetime, or the result of cls(response) + :rtype: list[~datetime.datetime] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.datetime]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_time_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[iso-8601]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_time_invalid_null.metadata = {'url': '/array/prim/date-time/invalidnull'} # type: ignore + + @distributed_trace_async + async def get_date_time_invalid_chars( + self, + **kwargs + ) -> List[datetime.datetime]: + """Get date array value ['2000-12-01t00:00:01z', 'date-time']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of datetime, or the result of cls(response) + :rtype: list[~datetime.datetime] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.datetime]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_time_invalid_chars.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[iso-8601]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_time_invalid_chars.metadata = {'url': '/array/prim/date-time/invalidchars'} # type: ignore + + @distributed_trace_async + async def get_date_time_rfc1123_valid( + self, + **kwargs + ) -> List[datetime.datetime]: + """Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', + 'Wed, 12 Oct 1492 10:15:01 GMT']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of datetime, or the result of cls(response) + :rtype: list[~datetime.datetime] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.datetime]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_time_rfc1123_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[rfc-1123]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_time_rfc1123_valid.metadata = {'url': '/array/prim/date-time-rfc1123/valid'} # type: ignore + + @distributed_trace_async + async def put_date_time_rfc1123_valid( + self, + array_body: List[datetime.datetime], + **kwargs + ) -> None: + """Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 + Oct 1492 10:15:01 GMT']. + + :param array_body: + :type array_body: list[~datetime.datetime] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_date_time_rfc1123_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[rfc-1123]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_date_time_rfc1123_valid.metadata = {'url': '/array/prim/date-time-rfc1123/valid'} # type: ignore + + @distributed_trace_async + async def get_duration_valid( + self, + **kwargs + ) -> List[datetime.timedelta]: + """Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of timedelta, or the result of cls(response) + :rtype: list[~datetime.timedelta] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.timedelta]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_duration_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[duration]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_duration_valid.metadata = {'url': '/array/prim/duration/valid'} # type: ignore + + @distributed_trace_async + async def put_duration_valid( + self, + array_body: List[datetime.timedelta], + **kwargs + ) -> None: + """Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + + :param array_body: + :type array_body: list[~datetime.timedelta] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_duration_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[duration]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_duration_valid.metadata = {'url': '/array/prim/duration/valid'} # type: ignore + + @distributed_trace_async + async def get_byte_valid( + self, + **kwargs + ) -> List[bytearray]: + """Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded + in base64. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bytearray, or the result of cls(response) + :rtype: list[bytearray] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bytearray]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_byte_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bytearray]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_byte_valid.metadata = {'url': '/array/prim/byte/valid'} # type: ignore + + @distributed_trace_async + async def put_byte_valid( + self, + array_body: List[bytearray], + **kwargs + ) -> None: + """Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each + elementencoded in base 64. + + :param array_body: + :type array_body: list[bytearray] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_byte_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[bytearray]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_byte_valid.metadata = {'url': '/array/prim/byte/valid'} # type: ignore + + @distributed_trace_async + async def get_byte_invalid_null( + self, + **kwargs + ) -> List[bytearray]: + """Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bytearray, or the result of cls(response) + :rtype: list[bytearray] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bytearray]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_byte_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bytearray]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_byte_invalid_null.metadata = {'url': '/array/prim/byte/invalidnull'} # type: ignore + + @distributed_trace_async + async def get_base64_url( + self, + **kwargs + ) -> List[bytes]: + """Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with + the items base64url encoded. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bytes, or the result of cls(response) + :rtype: list[bytes] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bytes]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_base64_url.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[base64]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_base64_url.metadata = {'url': '/array/prim/base64url/valid'} # type: ignore + + @distributed_trace_async + async def get_complex_null( + self, + **kwargs + ) -> List["models.Product"]: + """Get array of complex type null value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_null.metadata = {'url': '/array/complex/null'} # type: ignore + + @distributed_trace_async + async def get_complex_empty( + self, + **kwargs + ) -> List["models.Product"]: + """Get empty array of complex type []. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_empty.metadata = {'url': '/array/complex/empty'} # type: ignore + + @distributed_trace_async + async def get_complex_item_null( + self, + **kwargs + ) -> List["models.Product"]: + """Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, + 'string': '6'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_item_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_item_null.metadata = {'url': '/array/complex/itemnull'} # type: ignore + + @distributed_trace_async + async def get_complex_item_empty( + self, + **kwargs + ) -> List["models.Product"]: + """Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, + 'string': '6'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_item_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_item_empty.metadata = {'url': '/array/complex/itemempty'} # type: ignore + + @distributed_trace_async + async def get_complex_valid( + self, + **kwargs + ) -> List["models.Product"]: + """Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, + {'integer': 5, 'string': '6'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_valid.metadata = {'url': '/array/complex/valid'} # type: ignore + + @distributed_trace_async + async def put_complex_valid( + self, + array_body: List["models.Product"], + **kwargs + ) -> None: + """Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, + 'string': '4'}, {'integer': 5, 'string': '6'}]. + + :param array_body: + :type array_body: list[~vanilla.body.array.models.Product] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_complex_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[Product]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_complex_valid.metadata = {'url': '/array/complex/valid'} # type: ignore + + @distributed_trace_async + async def get_array_null( + self, + **kwargs + ) -> List[List[str]]: + """Get a null array. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_null.metadata = {'url': '/array/array/null'} # type: ignore + + @distributed_trace_async + async def get_array_empty( + self, + **kwargs + ) -> List[List[str]]: + """Get an empty array []. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_empty.metadata = {'url': '/array/array/empty'} # type: ignore + + @distributed_trace_async + async def get_array_item_null( + self, + **kwargs + ) -> List[List[str]]: + """Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_item_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_item_null.metadata = {'url': '/array/array/itemnull'} # type: ignore + + @distributed_trace_async + async def get_array_item_empty( + self, + **kwargs + ) -> List[List[str]]: + """Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_item_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_item_empty.metadata = {'url': '/array/array/itemempty'} # type: ignore + + @distributed_trace_async + async def get_array_valid( + self, + **kwargs + ) -> List[List[str]]: + """Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_valid.metadata = {'url': '/array/array/valid'} # type: ignore + + @distributed_trace_async + async def put_array_valid( + self, + array_body: List[List[str]], + **kwargs + ) -> None: + """Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + + :param array_body: + :type array_body: list[list[str]] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_array_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[[str]]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_array_valid.metadata = {'url': '/array/array/valid'} # type: ignore + + @distributed_trace_async + async def get_dictionary_null( + self, + **kwargs + ) -> List[Dict[str, str]]: + """Get an array of Dictionaries with value null. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_null.metadata = {'url': '/array/dictionary/null'} # type: ignore + + @distributed_trace_async + async def get_dictionary_empty( + self, + **kwargs + ) -> List[Dict[str, str]]: + """Get an array of Dictionaries of type with value []. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_empty.metadata = {'url': '/array/dictionary/empty'} # type: ignore + + @distributed_trace_async + async def get_dictionary_item_null( + self, + **kwargs + ) -> List[Dict[str, str]]: + """Get an array of Dictionaries of type with value [{'1': 'one', '2': 'two', '3': + 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_item_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_item_null.metadata = {'url': '/array/dictionary/itemnull'} # type: ignore + + @distributed_trace_async + async def get_dictionary_item_empty( + self, + **kwargs + ) -> List[Dict[str, str]]: + """Get an array of Dictionaries of type with value [{'1': 'one', '2': 'two', '3': + 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_item_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_item_empty.metadata = {'url': '/array/dictionary/itemempty'} # type: ignore + + @distributed_trace_async + async def get_dictionary_valid( + self, + **kwargs + ) -> List[Dict[str, str]]: + """Get an array of Dictionaries of type with value [{'1': 'one', '2': 'two', '3': + 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_valid.metadata = {'url': '/array/dictionary/valid'} # type: ignore + + @distributed_trace_async + async def put_dictionary_valid( + self, + array_body: List[Dict[str, str]], + **kwargs + ) -> None: + """Get an array of Dictionaries of type with value [{'1': 'one', '2': 'two', '3': + 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :param array_body: + :type array_body: list[dict[str, str]] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_dictionary_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[{str}]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_dictionary_valid.metadata = {'url': '/array/dictionary/valid'} # type: ignore diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/__init__.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/__init__.py new file mode 100644 index 00000000000..7728241cd8f --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/__init__.py @@ -0,0 +1,28 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import Error + from ._models_py3 import Product +except (SyntaxError, ImportError): + from ._models import Error # type: ignore + from ._models import Product # type: ignore + +from ._auto_rest_swagger_bat_array_service_enums import ( + Enum0, + Enum1, + FooEnum, +) + +__all__ = [ + 'Error', + 'Product', + 'Enum0', + 'Enum1', + 'FooEnum', +] diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_auto_rest_swagger_bat_array_service_enums.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_auto_rest_swagger_bat_array_service_enums.py new file mode 100644 index 00000000000..4b64c54e379 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_auto_rest_swagger_bat_array_service_enums.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 enum import Enum + +class Enum0(str, Enum): + + foo1 = "foo1" + foo2 = "foo2" + foo3 = "foo3" + +class Enum1(str, Enum): + + foo1 = "foo1" + foo2 = "foo2" + foo3 = "foo3" + +class FooEnum(str, Enum): + + foo1 = "foo1" + foo2 = "foo2" + foo3 = "foo3" diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_models.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_models.py new file mode 100644 index 00000000000..22e7e0f738c --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_models.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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.exceptions import HttpResponseError +import msrest.serialization + + +class Error(msrest.serialization.Model): + """Error. + + :param status: + :type status: int + :param message: + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.message = kwargs.get('message', None) + + +class Product(msrest.serialization.Model): + """Product. + + :param integer: + :type integer: int + :param string: + :type string: str + """ + + _attribute_map = { + 'integer': {'key': 'integer', 'type': 'int'}, + 'string': {'key': 'string', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Product, self).__init__(**kwargs) + self.integer = kwargs.get('integer', None) + self.string = kwargs.get('string', None) diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_models_py3.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_models_py3.py new file mode 100644 index 00000000000..13e09e71753 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/models/_models_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 typing import Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Error(msrest.serialization.Model): + """Error. + + :param status: + :type status: int + :param message: + :type message: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'int'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[int] = None, + message: Optional[str] = None, + **kwargs + ): + super(Error, self).__init__(**kwargs) + self.status = status + self.message = message + + +class Product(msrest.serialization.Model): + """Product. + + :param integer: + :type integer: int + :param string: + :type string: str + """ + + _attribute_map = { + 'integer': {'key': 'integer', 'type': 'int'}, + 'string': {'key': 'string', 'type': 'str'}, + } + + def __init__( + self, + *, + integer: Optional[int] = None, + string: Optional[str] = None, + **kwargs + ): + super(Product, self).__init__(**kwargs) + self.integer = integer + self.string = string diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/__init__.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/__init__.py new file mode 100644 index 00000000000..704181d72a8 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/__init__.py @@ -0,0 +1,13 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 ._array_operations import ArrayOperations + +__all__ = [ + 'ArrayOperations', +] diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py new file mode 100644 index 00000000000..7531a45ffc4 --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/operations/_array_operations.py @@ -0,0 +1,3258 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +import datetime +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace + +from .. import models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ArrayOperations(object): + """ArrayOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~vanilla.body.array.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get null array value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_null.metadata = {'url': '/array/null'} # type: ignore + + @distributed_trace + def get_invalid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get invalid array [1, 2, 3. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_invalid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_invalid.metadata = {'url': '/array/invalid'} # type: ignore + + @distributed_trace + def get_empty( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get empty array value []. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_empty.metadata = {'url': '/array/empty'} # type: ignore + + @distributed_trace + def put_empty( + self, + array_body, # type: List[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value empty []. + + :param array_body: + :type array_body: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_empty.metadata = {'url': '/array/empty'} # type: ignore + + @distributed_trace + def get_boolean_tfft( + self, + **kwargs # type: Any + ): + # type: (...) -> List[bool] + """Get boolean array value [true, false, false, true]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bool, or the result of cls(response) + :rtype: list[bool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bool]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_boolean_tfft.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bool]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_boolean_tfft.metadata = {'url': '/array/prim/boolean/tfft'} # type: ignore + + @distributed_trace + def put_boolean_tfft( + self, + array_body, # type: List[bool] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value empty [true, false, false, true]. + + :param array_body: + :type array_body: list[bool] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_boolean_tfft.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[bool]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_boolean_tfft.metadata = {'url': '/array/prim/boolean/tfft'} # type: ignore + + @distributed_trace + def get_boolean_invalid_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[bool] + """Get boolean array value [true, null, false]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bool, or the result of cls(response) + :rtype: list[bool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bool]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_boolean_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bool]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_boolean_invalid_null.metadata = {'url': '/array/prim/boolean/true.null.false'} # type: ignore + + @distributed_trace + def get_boolean_invalid_string( + self, + **kwargs # type: Any + ): + # type: (...) -> List[bool] + """Get boolean array value [true, 'boolean', false]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bool, or the result of cls(response) + :rtype: list[bool] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bool]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_boolean_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bool]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_boolean_invalid_string.metadata = {'url': '/array/prim/boolean/true.boolean.false'} # type: ignore + + @distributed_trace + def get_integer_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get integer array value [1, -1, 3, 300]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_integer_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_integer_valid.metadata = {'url': '/array/prim/integer/1.-1.3.300'} # type: ignore + + @distributed_trace + def put_integer_valid( + self, + array_body, # type: List[int] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value empty [1, -1, 3, 300]. + + :param array_body: + :type array_body: list[int] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_integer_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[int]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_integer_valid.metadata = {'url': '/array/prim/integer/1.-1.3.300'} # type: ignore + + @distributed_trace + def get_int_invalid_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get integer array value [1, null, 0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_int_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_int_invalid_null.metadata = {'url': '/array/prim/integer/1.null.zero'} # type: ignore + + @distributed_trace + def get_int_invalid_string( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get integer array value [1, 'integer', 0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of int, or the result of cls(response) + :rtype: list[int] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_int_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[int]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_int_invalid_string.metadata = {'url': '/array/prim/integer/1.integer.0'} # type: ignore + + @distributed_trace + def get_long_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get integer array value [1, -1, 3, 300]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of long, or the result of cls(response) + :rtype: list[long] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_long_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[long]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_long_valid.metadata = {'url': '/array/prim/long/1.-1.3.300'} # type: ignore + + @distributed_trace + def put_long_valid( + self, + array_body, # type: List[int] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value empty [1, -1, 3, 300]. + + :param array_body: + :type array_body: list[long] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_long_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[long]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_long_valid.metadata = {'url': '/array/prim/long/1.-1.3.300'} # type: ignore + + @distributed_trace + def get_long_invalid_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get long array value [1, null, 0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of long, or the result of cls(response) + :rtype: list[long] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_long_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[long]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_long_invalid_null.metadata = {'url': '/array/prim/long/1.null.zero'} # type: ignore + + @distributed_trace + def get_long_invalid_string( + self, + **kwargs # type: Any + ): + # type: (...) -> List[int] + """Get long array value [1, 'integer', 0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of long, or the result of cls(response) + :rtype: list[long] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[int]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_long_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[long]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_long_invalid_string.metadata = {'url': '/array/prim/long/1.integer.0'} # type: ignore + + @distributed_trace + def get_float_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[float] + """Get float array value [0, -0.01, 1.2e20]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_float_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_float_valid.metadata = {'url': '/array/prim/float/0--0.01-1.2e20'} # type: ignore + + @distributed_trace + def put_float_valid( + self, + array_body, # type: List[float] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value [0, -0.01, 1.2e20]. + + :param array_body: + :type array_body: list[float] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_float_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[float]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_float_valid.metadata = {'url': '/array/prim/float/0--0.01-1.2e20'} # type: ignore + + @distributed_trace + def get_float_invalid_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[float] + """Get float array value [0.0, null, -1.2e20]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_float_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_float_invalid_null.metadata = {'url': '/array/prim/float/0.0-null-1.2e20'} # type: ignore + + @distributed_trace + def get_float_invalid_string( + self, + **kwargs # type: Any + ): + # type: (...) -> List[float] + """Get boolean array value [1.0, 'number', 0.0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_float_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_float_invalid_string.metadata = {'url': '/array/prim/float/1.number.0'} # type: ignore + + @distributed_trace + def get_double_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[float] + """Get float array value [0, -0.01, 1.2e20]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_double_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_double_valid.metadata = {'url': '/array/prim/double/0--0.01-1.2e20'} # type: ignore + + @distributed_trace + def put_double_valid( + self, + array_body, # type: List[float] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value [0, -0.01, 1.2e20]. + + :param array_body: + :type array_body: list[float] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_double_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[float]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_double_valid.metadata = {'url': '/array/prim/double/0--0.01-1.2e20'} # type: ignore + + @distributed_trace + def get_double_invalid_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[float] + """Get float array value [0.0, null, -1.2e20]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_double_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_double_invalid_null.metadata = {'url': '/array/prim/double/0.0-null-1.2e20'} # type: ignore + + @distributed_trace + def get_double_invalid_string( + self, + **kwargs # type: Any + ): + # type: (...) -> List[float] + """Get boolean array value [1.0, 'number', 0.0]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of float, or the result of cls(response) + :rtype: list[float] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[float]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_double_invalid_string.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[float]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_double_invalid_string.metadata = {'url': '/array/prim/double/1.number.0'} # type: ignore + + @distributed_trace + def get_string_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Get string array value ['foo1', 'foo2', 'foo3']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_string_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_string_valid.metadata = {'url': '/array/prim/string/foo1.foo2.foo3'} # type: ignore + + @distributed_trace + def put_string_valid( + self, + array_body, # type: List[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value ['foo1', 'foo2', 'foo3']. + + :param array_body: + :type array_body: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_string_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_string_valid.metadata = {'url': '/array/prim/string/foo1.foo2.foo3'} # type: ignore + + @distributed_trace + def get_enum_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[Union[str, "models.FooEnum"]] + """Get enum array value ['foo1', 'foo2', 'foo3']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of FooEnum, or the result of cls(response) + :rtype: list[str or ~vanilla.body.array.models.FooEnum] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.FooEnum"]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_enum_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_enum_valid.metadata = {'url': '/array/prim/enum/foo1.foo2.foo3'} # type: ignore + + @distributed_trace + def put_enum_valid( + self, + array_body, # type: List[Union[str, "models.FooEnum"]] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value ['foo1', 'foo2', 'foo3']. + + :param array_body: + :type array_body: list[str or ~vanilla.body.array.models.FooEnum] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_enum_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_enum_valid.metadata = {'url': '/array/prim/enum/foo1.foo2.foo3'} # type: ignore + + @distributed_trace + def get_string_enum_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[Union[str, "models.Enum0"]] + """Get enum array value ['foo1', 'foo2', 'foo3']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Enum0, or the result of cls(response) + :rtype: list[str or ~vanilla.body.array.models.Enum0] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Union[str, "models.Enum0"]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_string_enum_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_string_enum_valid.metadata = {'url': '/array/prim/string-enum/foo1.foo2.foo3'} # type: ignore + + @distributed_trace + def put_string_enum_valid( + self, + array_body, # type: List[Union[str, "models.Enum1"]] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value ['foo1', 'foo2', 'foo3']. + + :param array_body: + :type array_body: list[str or ~vanilla.body.array.models.Enum1] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_string_enum_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_string_enum_valid.metadata = {'url': '/array/prim/string-enum/foo1.foo2.foo3'} # type: ignore + + @distributed_trace + def get_string_with_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Get string array value ['foo', null, 'foo2']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_string_with_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_string_with_null.metadata = {'url': '/array/prim/string/foo.null.foo2'} # type: ignore + + @distributed_trace + def get_string_with_invalid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Get string array value ['foo', 123, 'foo2']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_string_with_invalid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_string_with_invalid.metadata = {'url': '/array/prim/string/foo.123.foo2'} # type: ignore + + @distributed_trace + def get_uuid_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', + 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_uuid_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_uuid_valid.metadata = {'url': '/array/prim/uuid/valid'} # type: ignore + + @distributed_trace + def put_uuid_valid( + self, + array_body, # type: List[str] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', + 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + + :param array_body: + :type array_body: list[str] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_uuid_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[str]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_uuid_valid.metadata = {'url': '/array/prim/uuid/valid'} # type: ignore + + @distributed_trace + def get_uuid_invalid_chars( + self, + **kwargs # type: Any + ): + # type: (...) -> List[str] + """Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of str, or the result of cls(response) + :rtype: list[str] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[str]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_uuid_invalid_chars.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[str]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_uuid_invalid_chars.metadata = {'url': '/array/prim/uuid/invalidchars'} # type: ignore + + @distributed_trace + def get_date_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[datetime.date] + """Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of date, or the result of cls(response) + :rtype: list[~datetime.date] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.date]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[date]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_valid.metadata = {'url': '/array/prim/date/valid'} # type: ignore + + @distributed_trace + def put_date_valid( + self, + array_body, # type: List[datetime.date] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + + :param array_body: + :type array_body: list[~datetime.date] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_date_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[date]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_date_valid.metadata = {'url': '/array/prim/date/valid'} # type: ignore + + @distributed_trace + def get_date_invalid_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[datetime.date] + """Get date array value ['2012-01-01', null, '1776-07-04']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of date, or the result of cls(response) + :rtype: list[~datetime.date] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.date]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[date]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_invalid_null.metadata = {'url': '/array/prim/date/invalidnull'} # type: ignore + + @distributed_trace + def get_date_invalid_chars( + self, + **kwargs # type: Any + ): + # type: (...) -> List[datetime.date] + """Get date array value ['2011-03-22', 'date']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of date, or the result of cls(response) + :rtype: list[~datetime.date] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.date]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_invalid_chars.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[date]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_invalid_chars.metadata = {'url': '/array/prim/date/invalidchars'} # type: ignore + + @distributed_trace + def get_date_time_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[datetime.datetime] + """Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', + '1492-10-12T10:15:01-08:00']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of datetime, or the result of cls(response) + :rtype: list[~datetime.datetime] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.datetime]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_time_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[iso-8601]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_time_valid.metadata = {'url': '/array/prim/date-time/valid'} # type: ignore + + @distributed_trace + def put_date_time_valid( + self, + array_body, # type: List[datetime.datetime] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', + '1492-10-12T10:15:01-08:00']. + + :param array_body: + :type array_body: list[~datetime.datetime] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_date_time_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[iso-8601]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_date_time_valid.metadata = {'url': '/array/prim/date-time/valid'} # type: ignore + + @distributed_trace + def get_date_time_invalid_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[datetime.datetime] + """Get date array value ['2000-12-01t00:00:01z', null]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of datetime, or the result of cls(response) + :rtype: list[~datetime.datetime] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.datetime]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_time_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[iso-8601]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_time_invalid_null.metadata = {'url': '/array/prim/date-time/invalidnull'} # type: ignore + + @distributed_trace + def get_date_time_invalid_chars( + self, + **kwargs # type: Any + ): + # type: (...) -> List[datetime.datetime] + """Get date array value ['2000-12-01t00:00:01z', 'date-time']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of datetime, or the result of cls(response) + :rtype: list[~datetime.datetime] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.datetime]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_time_invalid_chars.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[iso-8601]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_time_invalid_chars.metadata = {'url': '/array/prim/date-time/invalidchars'} # type: ignore + + @distributed_trace + def get_date_time_rfc1123_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[datetime.datetime] + """Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', + 'Wed, 12 Oct 1492 10:15:01 GMT']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of datetime, or the result of cls(response) + :rtype: list[~datetime.datetime] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.datetime]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_date_time_rfc1123_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[rfc-1123]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_date_time_rfc1123_valid.metadata = {'url': '/array/prim/date-time-rfc1123/valid'} # type: ignore + + @distributed_trace + def put_date_time_rfc1123_valid( + self, + array_body, # type: List[datetime.datetime] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 + Oct 1492 10:15:01 GMT']. + + :param array_body: + :type array_body: list[~datetime.datetime] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_date_time_rfc1123_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[rfc-1123]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_date_time_rfc1123_valid.metadata = {'url': '/array/prim/date-time-rfc1123/valid'} # type: ignore + + @distributed_trace + def get_duration_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[datetime.timedelta] + """Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of timedelta, or the result of cls(response) + :rtype: list[~datetime.timedelta] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[datetime.timedelta]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_duration_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[duration]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_duration_valid.metadata = {'url': '/array/prim/duration/valid'} # type: ignore + + @distributed_trace + def put_duration_valid( + self, + array_body, # type: List[datetime.timedelta] + **kwargs # type: Any + ): + # type: (...) -> None + """Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + + :param array_body: + :type array_body: list[~datetime.timedelta] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_duration_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[duration]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_duration_valid.metadata = {'url': '/array/prim/duration/valid'} # type: ignore + + @distributed_trace + def get_byte_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[bytearray] + """Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded + in base64. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bytearray, or the result of cls(response) + :rtype: list[bytearray] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bytearray]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_byte_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bytearray]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_byte_valid.metadata = {'url': '/array/prim/byte/valid'} # type: ignore + + @distributed_trace + def put_byte_valid( + self, + array_body, # type: List[bytearray] + **kwargs # type: Any + ): + # type: (...) -> None + """Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each + elementencoded in base 64. + + :param array_body: + :type array_body: list[bytearray] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_byte_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[bytearray]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_byte_valid.metadata = {'url': '/array/prim/byte/valid'} # type: ignore + + @distributed_trace + def get_byte_invalid_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[bytearray] + """Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bytearray, or the result of cls(response) + :rtype: list[bytearray] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bytearray]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_byte_invalid_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[bytearray]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_byte_invalid_null.metadata = {'url': '/array/prim/byte/invalidnull'} # type: ignore + + @distributed_trace + def get_base64_url( + self, + **kwargs # type: Any + ): + # type: (...) -> List[bytes] + """Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with + the items base64url encoded. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of bytes, or the result of cls(response) + :rtype: list[bytes] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[bytes]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_base64_url.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[base64]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_base64_url.metadata = {'url': '/array/prim/base64url/valid'} # type: ignore + + @distributed_trace + def get_complex_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List["models.Product"] + """Get array of complex type null value. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_null.metadata = {'url': '/array/complex/null'} # type: ignore + + @distributed_trace + def get_complex_empty( + self, + **kwargs # type: Any + ): + # type: (...) -> List["models.Product"] + """Get empty array of complex type []. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_empty.metadata = {'url': '/array/complex/empty'} # type: ignore + + @distributed_trace + def get_complex_item_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List["models.Product"] + """Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, + 'string': '6'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_item_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_item_null.metadata = {'url': '/array/complex/itemnull'} # type: ignore + + @distributed_trace + def get_complex_item_empty( + self, + **kwargs # type: Any + ): + # type: (...) -> List["models.Product"] + """Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, + 'string': '6'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_item_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_item_empty.metadata = {'url': '/array/complex/itemempty'} # type: ignore + + @distributed_trace + def get_complex_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List["models.Product"] + """Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, + {'integer': 5, 'string': '6'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of Product, or the result of cls(response) + :rtype: list[~vanilla.body.array.models.Product] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List["models.Product"]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_complex_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[Product]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_complex_valid.metadata = {'url': '/array/complex/valid'} # type: ignore + + @distributed_trace + def put_complex_valid( + self, + array_body, # type: List["models.Product"] + **kwargs # type: Any + ): + # type: (...) -> None + """Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, + 'string': '4'}, {'integer': 5, 'string': '6'}]. + + :param array_body: + :type array_body: list[~vanilla.body.array.models.Product] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_complex_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[Product]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_complex_valid.metadata = {'url': '/array/complex/valid'} # type: ignore + + @distributed_trace + def get_array_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[List[str]] + """Get a null array. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_null.metadata = {'url': '/array/array/null'} # type: ignore + + @distributed_trace + def get_array_empty( + self, + **kwargs # type: Any + ): + # type: (...) -> List[List[str]] + """Get an empty array []. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_empty.metadata = {'url': '/array/array/empty'} # type: ignore + + @distributed_trace + def get_array_item_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[List[str]] + """Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_item_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_item_null.metadata = {'url': '/array/array/itemnull'} # type: ignore + + @distributed_trace + def get_array_item_empty( + self, + **kwargs # type: Any + ): + # type: (...) -> List[List[str]] + """Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_item_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_item_empty.metadata = {'url': '/array/array/itemempty'} # type: ignore + + @distributed_trace + def get_array_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[List[str]] + """Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of list of str, or the result of cls(response) + :rtype: list[list[str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[List[str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_array_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[[str]]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_array_valid.metadata = {'url': '/array/array/valid'} # type: ignore + + @distributed_trace + def put_array_valid( + self, + array_body, # type: List[List[str]] + **kwargs # type: Any + ): + # type: (...) -> None + """Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + + :param array_body: + :type array_body: list[list[str]] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_array_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[[str]]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_array_valid.metadata = {'url': '/array/array/valid'} # type: ignore + + @distributed_trace + def get_dictionary_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[Dict[str, str]] + """Get an array of Dictionaries with value null. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_null.metadata = {'url': '/array/dictionary/null'} # type: ignore + + @distributed_trace + def get_dictionary_empty( + self, + **kwargs # type: Any + ): + # type: (...) -> List[Dict[str, str]] + """Get an array of Dictionaries of type with value []. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_empty.metadata = {'url': '/array/dictionary/empty'} # type: ignore + + @distributed_trace + def get_dictionary_item_null( + self, + **kwargs # type: Any + ): + # type: (...) -> List[Dict[str, str]] + """Get an array of Dictionaries of type with value [{'1': 'one', '2': 'two', '3': + 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_item_null.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_item_null.metadata = {'url': '/array/dictionary/itemnull'} # type: ignore + + @distributed_trace + def get_dictionary_item_empty( + self, + **kwargs # type: Any + ): + # type: (...) -> List[Dict[str, str]] + """Get an array of Dictionaries of type with value [{'1': 'one', '2': 'two', '3': + 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_item_empty.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_item_empty.metadata = {'url': '/array/dictionary/itemempty'} # type: ignore + + @distributed_trace + def get_dictionary_valid( + self, + **kwargs # type: Any + ): + # type: (...) -> List[Dict[str, str]] + """Get an array of Dictionaries of type with value [{'1': 'one', '2': 'two', '3': + 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: list of dict mapping str to str, or the result of cls(response) + :rtype: list[dict[str, str]] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[List[Dict[str, str]]] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + + # Construct URL + url = self.get_dictionary_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = 'application/json' + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + deserialized = self._deserialize('[{str}]', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_dictionary_valid.metadata = {'url': '/array/dictionary/valid'} # type: ignore + + @distributed_trace + def put_dictionary_valid( + self, + array_body, # type: List[Dict[str, str]] + **kwargs # type: Any + ): + # type: (...) -> None + """Get an array of Dictionaries of type with value [{'1': 'one', '2': 'two', '3': + 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + + :param array_body: + :type array_body: list[dict[str, str]] + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = {404: ResourceNotFoundError, 409: ResourceExistsError} + error_map.update(kwargs.pop('error_map', {})) + content_type = kwargs.pop("content_type", "application/json") + + # Construct URL + url = self.put_dictionary_valid.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + + # Construct and send request + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(array_body, '[{str}]') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.Error, response) + raise HttpResponseError(response=response, model=error) + + if cls: + return cls(pipeline_response, None, {}) + + put_dictionary_valid.metadata = {'url': '/array/dictionary/valid'} # type: ignore diff --git a/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/py.typed b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/test/vanilla/Expected/AcceptanceTests/BodyArrayWithNamespaceFolders/vanilla/body/array/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file