# pylint: disable=too-many-lines
# 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, Callable, Dict, Optional, TypeVar, Union

from azure.core.exceptions import (
    ClientAuthenticationError,
    HttpResponseError,
    ResourceExistsError,
    ResourceNotFoundError,
    ResourceNotModifiedError,
    map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator_async import distributed_trace_async

from ... import models as _models
from ..._vendor import _convert_request
from ...operations._multiple_responses_operations import (
    build_get200_model201_model_default_error200_valid_request,
    build_get200_model201_model_default_error201_valid_request,
    build_get200_model201_model_default_error400_valid_request,
    build_get200_model204_no_model_default_error200_valid_request,
    build_get200_model204_no_model_default_error201_invalid_request,
    build_get200_model204_no_model_default_error202_none_request,
    build_get200_model204_no_model_default_error204_valid_request,
    build_get200_model204_no_model_default_error400_valid_request,
    build_get200_model_a200_invalid_request,
    build_get200_model_a200_none_request,
    build_get200_model_a200_valid_request,
    build_get200_model_a201_model_c404_model_d_default_error200_valid_request,
    build_get200_model_a201_model_c404_model_d_default_error201_valid_request,
    build_get200_model_a201_model_c404_model_d_default_error400_valid_request,
    build_get200_model_a201_model_c404_model_d_default_error404_valid_request,
    build_get200_model_a202_valid_request,
    build_get200_model_a400_invalid_request,
    build_get200_model_a400_none_request,
    build_get200_model_a400_valid_request,
    build_get202_none204_none_default_error202_none_request,
    build_get202_none204_none_default_error204_none_request,
    build_get202_none204_none_default_error400_valid_request,
    build_get202_none204_none_default_none202_invalid_request,
    build_get202_none204_none_default_none204_none_request,
    build_get202_none204_none_default_none400_invalid_request,
    build_get202_none204_none_default_none400_none_request,
    build_get_default_model_a200_none_request,
    build_get_default_model_a200_valid_request,
    build_get_default_model_a400_none_request,
    build_get_default_model_a400_valid_request,
    build_get_default_none200_invalid_request,
    build_get_default_none200_none_request,
    build_get_default_none400_invalid_request,
    build_get_default_none400_none_request,
)

T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]


class MultipleResponsesOperations:  # pylint: disable=too-many-public-methods
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~httpinfrastructure.aio.AutoRestHttpInfrastructureTestService`'s
        :attr:`multiple_responses` attribute.
    """

    models = _models

    def __init__(self, *args, **kwargs) -> None:
        input_args = list(args)
        self._client = input_args.pop(0) if input_args else kwargs.pop("client")
        self._config = input_args.pop(0) if input_args else kwargs.pop("config")
        self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
        self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

    @distributed_trace_async
    async def get200_model204_no_model_default_error200_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Optional[_models.MyException]:
        """Send a 200 response with valid payload: {'statusCode': '200'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or None or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Optional[_models.MyException]] = kwargs.pop("cls", None)

        request = build_get200_model204_no_model_default_error200_valid_request(
            template_url=self.get200_model204_no_model_default_error200_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        deserialized = None
        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model204_no_model_default_error200_valid.metadata = {
        "url": "/http/payloads/200/A/204/none/default/Error/response/200/valid"
    }

    @distributed_trace_async
    async def get200_model204_no_model_default_error204_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Optional[_models.MyException]:
        """Send a 204 response with no payload.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or None or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Optional[_models.MyException]] = kwargs.pop("cls", None)

        request = build_get200_model204_no_model_default_error204_valid_request(
            template_url=self.get200_model204_no_model_default_error204_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        deserialized = None
        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model204_no_model_default_error204_valid.metadata = {
        "url": "/http/payloads/200/A/204/none/default/Error/response/204/none"
    }

    @distributed_trace_async
    async def get200_model204_no_model_default_error201_invalid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Optional[_models.MyException]:
        """Send a 201 response with valid payload: {'statusCode': '201'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or None or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Optional[_models.MyException]] = kwargs.pop("cls", None)

        request = build_get200_model204_no_model_default_error201_invalid_request(
            template_url=self.get200_model204_no_model_default_error201_invalid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        deserialized = None
        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model204_no_model_default_error201_invalid.metadata = {
        "url": "/http/payloads/200/A/204/none/default/Error/response/201/valid"
    }

    @distributed_trace_async
    async def get200_model204_no_model_default_error202_none(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Optional[_models.MyException]:
        """Send a 202 response with no payload:.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or None or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Optional[_models.MyException]] = kwargs.pop("cls", None)

        request = build_get200_model204_no_model_default_error202_none_request(
            template_url=self.get200_model204_no_model_default_error202_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        deserialized = None
        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model204_no_model_default_error202_none.metadata = {
        "url": "/http/payloads/200/A/204/none/default/Error/response/202/none"
    }

    @distributed_trace_async
    async def get200_model204_no_model_default_error400_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Optional[_models.MyException]:
        """Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or None or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Optional[_models.MyException]] = kwargs.pop("cls", None)

        request = build_get200_model204_no_model_default_error400_valid_request(
            template_url=self.get200_model204_no_model_default_error400_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        deserialized = None
        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model204_no_model_default_error400_valid.metadata = {
        "url": "/http/payloads/200/A/204/none/default/Error/response/400/valid"
    }

    @distributed_trace_async
    async def get200_model201_model_default_error200_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Union[_models.MyException, _models.B]:
        """Send a 200 response with valid payload: {'statusCode': '200'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or B or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Union[_models.MyException, _models.B]] = kwargs.pop("cls", None)

        request = build_get200_model201_model_default_error200_valid_request(
            template_url=self.get200_model201_model_default_error200_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if response.status_code == 201:
            deserialized = self._deserialize("B", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})  # type: ignore

        return deserialized  # type: ignore

    get200_model201_model_default_error200_valid.metadata = {
        "url": "/http/payloads/200/A/201/B/default/Error/response/200/valid"
    }

    @distributed_trace_async
    async def get200_model201_model_default_error201_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Union[_models.MyException, _models.B]:
        """Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or B or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Union[_models.MyException, _models.B]] = kwargs.pop("cls", None)

        request = build_get200_model201_model_default_error201_valid_request(
            template_url=self.get200_model201_model_default_error201_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if response.status_code == 201:
            deserialized = self._deserialize("B", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})  # type: ignore

        return deserialized  # type: ignore

    get200_model201_model_default_error201_valid.metadata = {
        "url": "/http/payloads/200/A/201/B/default/Error/response/201/valid"
    }

    @distributed_trace_async
    async def get200_model201_model_default_error400_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Union[_models.MyException, _models.B]:
        """Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or B or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.B
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Union[_models.MyException, _models.B]] = kwargs.pop("cls", None)

        request = build_get200_model201_model_default_error400_valid_request(
            template_url=self.get200_model201_model_default_error400_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 201]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if response.status_code == 201:
            deserialized = self._deserialize("B", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})  # type: ignore

        return deserialized  # type: ignore

    get200_model201_model_default_error400_valid.metadata = {
        "url": "/http/payloads/200/A/201/B/default/Error/response/400/valid"
    }

    @distributed_trace_async
    async def get200_model_a201_model_c404_model_d_default_error200_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Union[_models.MyException, _models.C, _models.D]:
        """Send a 200 response with valid payload: {'statusCode': '200'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or C or D or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or
         ~httpinfrastructure.models.D
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Union[_models.MyException, _models.C, _models.D]] = kwargs.pop("cls", None)

        request = build_get200_model_a201_model_c404_model_d_default_error200_valid_request(
            template_url=self.get200_model_a201_model_c404_model_d_default_error200_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 201, 404]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if response.status_code == 201:
            deserialized = self._deserialize("C", pipeline_response)

        if response.status_code == 404:
            deserialized = self._deserialize("D", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})  # type: ignore

        return deserialized  # type: ignore

    get200_model_a201_model_c404_model_d_default_error200_valid.metadata = {
        "url": "/http/payloads/200/A/201/C/404/D/default/Error/response/200/valid"
    }

    @distributed_trace_async
    async def get200_model_a201_model_c404_model_d_default_error201_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Union[_models.MyException, _models.C, _models.D]:
        """Send a 200 response with valid payload: {'httpCode': '201'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or C or D or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or
         ~httpinfrastructure.models.D
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Union[_models.MyException, _models.C, _models.D]] = kwargs.pop("cls", None)

        request = build_get200_model_a201_model_c404_model_d_default_error201_valid_request(
            template_url=self.get200_model_a201_model_c404_model_d_default_error201_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 201, 404]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if response.status_code == 201:
            deserialized = self._deserialize("C", pipeline_response)

        if response.status_code == 404:
            deserialized = self._deserialize("D", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})  # type: ignore

        return deserialized  # type: ignore

    get200_model_a201_model_c404_model_d_default_error201_valid.metadata = {
        "url": "/http/payloads/200/A/201/C/404/D/default/Error/response/201/valid"
    }

    @distributed_trace_async
    async def get200_model_a201_model_c404_model_d_default_error404_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Union[_models.MyException, _models.C, _models.D]:
        """Send a 200 response with valid payload: {'httpStatusCode': '404'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or C or D or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or
         ~httpinfrastructure.models.D
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Union[_models.MyException, _models.C, _models.D]] = kwargs.pop("cls", None)

        request = build_get200_model_a201_model_c404_model_d_default_error404_valid_request(
            template_url=self.get200_model_a201_model_c404_model_d_default_error404_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 201, 404]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if response.status_code == 201:
            deserialized = self._deserialize("C", pipeline_response)

        if response.status_code == 404:
            deserialized = self._deserialize("D", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})  # type: ignore

        return deserialized  # type: ignore

    get200_model_a201_model_c404_model_d_default_error404_valid.metadata = {
        "url": "/http/payloads/200/A/201/C/404/D/default/Error/response/404/valid"
    }

    @distributed_trace_async
    async def get200_model_a201_model_c404_model_d_default_error400_valid(  # pylint: disable=name-too-long
        self, **kwargs: Any
    ) -> Union[_models.MyException, _models.C, _models.D]:
        """Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or C or D or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException or ~httpinfrastructure.models.C or
         ~httpinfrastructure.models.D
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[Union[_models.MyException, _models.C, _models.D]] = kwargs.pop("cls", None)

        request = build_get200_model_a201_model_c404_model_d_default_error400_valid_request(
            template_url=self.get200_model_a201_model_c404_model_d_default_error400_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 201, 404]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if response.status_code == 200:
            deserialized = self._deserialize("MyException", pipeline_response)

        if response.status_code == 201:
            deserialized = self._deserialize("C", pipeline_response)

        if response.status_code == 404:
            deserialized = self._deserialize("D", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})  # type: ignore

        return deserialized  # type: ignore

    get200_model_a201_model_c404_model_d_default_error400_valid.metadata = {
        "url": "/http/payloads/200/A/201/C/404/D/default/Error/response/400/valid"
    }

    @distributed_trace_async
    async def get202_none204_none_default_error202_none(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, **kwargs: Any
    ) -> None:
        """Send a 202 response with no payload.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get202_none204_none_default_error202_none_request(
            template_url=self.get202_none204_none_default_error202_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [202, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if cls:
            return cls(pipeline_response, None, {})

    get202_none204_none_default_error202_none.metadata = {
        "url": "/http/payloads/202/none/204/none/default/Error/response/202/none"
    }

    @distributed_trace_async
    async def get202_none204_none_default_error204_none(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, **kwargs: Any
    ) -> None:
        """Send a 204 response with no payload.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get202_none204_none_default_error204_none_request(
            template_url=self.get202_none204_none_default_error204_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [202, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if cls:
            return cls(pipeline_response, None, {})

    get202_none204_none_default_error204_none.metadata = {
        "url": "/http/payloads/202/none/204/none/default/Error/response/204/none"
    }

    @distributed_trace_async
    async def get202_none204_none_default_error400_valid(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, **kwargs: Any
    ) -> None:
        """Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get202_none204_none_default_error400_valid_request(
            template_url=self.get202_none204_none_default_error400_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [202, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.Error, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if cls:
            return cls(pipeline_response, None, {})

    get202_none204_none_default_error400_valid.metadata = {
        "url": "/http/payloads/202/none/204/none/default/Error/response/400/valid"
    }

    @distributed_trace_async
    async def get202_none204_none_default_none202_invalid(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, **kwargs: Any
    ) -> None:
        """Send a 202 response with an unexpected payload {'property': 'value'}.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get202_none204_none_default_none202_invalid_request(
            template_url=self.get202_none204_none_default_none202_invalid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [202, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if cls:
            return cls(pipeline_response, None, {})

    get202_none204_none_default_none202_invalid.metadata = {
        "url": "/http/payloads/202/none/204/none/default/none/response/202/invalid"
    }

    @distributed_trace_async
    async def get202_none204_none_default_none204_none(  # pylint: disable=inconsistent-return-statements
        self, **kwargs: Any
    ) -> None:
        """Send a 204 response with no payload.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get202_none204_none_default_none204_none_request(
            template_url=self.get202_none204_none_default_none204_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [202, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if cls:
            return cls(pipeline_response, None, {})

    get202_none204_none_default_none204_none.metadata = {
        "url": "/http/payloads/202/none/204/none/default/none/response/204/none"
    }

    @distributed_trace_async
    async def get202_none204_none_default_none400_none(  # pylint: disable=inconsistent-return-statements
        self, **kwargs: Any
    ) -> None:
        """Send a 400 response with no payload.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get202_none204_none_default_none400_none_request(
            template_url=self.get202_none204_none_default_none400_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [202, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if cls:
            return cls(pipeline_response, None, {})

    get202_none204_none_default_none400_none.metadata = {
        "url": "/http/payloads/202/none/204/none/default/none/response/400/none"
    }

    @distributed_trace_async
    async def get202_none204_none_default_none400_invalid(  # pylint: disable=inconsistent-return-statements,name-too-long
        self, **kwargs: Any
    ) -> None:
        """Send a 400 response with an unexpected payload {'property': 'value'}.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get202_none204_none_default_none400_invalid_request(
            template_url=self.get202_none204_none_default_none400_invalid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [202, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if cls:
            return cls(pipeline_response, None, {})

    get202_none204_none_default_none400_invalid.metadata = {
        "url": "/http/payloads/202/none/204/none/default/none/response/400/invalid"
    }

    @distributed_trace_async
    async def get_default_model_a200_valid(self, **kwargs: Any) -> _models.MyException:
        """Send a 200 response with valid payload: {'statusCode': '200'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get_default_model_a200_valid_request(
            template_url=self.get_default_model_a200_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_default_model_a200_valid.metadata = {"url": "/http/payloads/default/A/response/200/valid"}

    @distributed_trace_async
    async def get_default_model_a200_none(self, **kwargs: Any) -> _models.MyException:
        """Send a 200 response with no payload.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get_default_model_a200_none_request(
            template_url=self.get_default_model_a200_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get_default_model_a200_none.metadata = {"url": "/http/payloads/default/A/response/200/none"}

    @distributed_trace_async
    async def get_default_model_a400_valid(  # pylint: disable=inconsistent-return-statements
        self, **kwargs: Any
    ) -> None:
        """Send a 400 response with valid payload: {'statusCode': '400'}.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get_default_model_a400_valid_request(
            template_url=self.get_default_model_a400_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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.failsafe_deserialize(_models.MyException, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if cls:
            return cls(pipeline_response, None, {})

    get_default_model_a400_valid.metadata = {"url": "/http/payloads/default/A/response/400/valid"}

    @distributed_trace_async
    async def get_default_model_a400_none(  # pylint: disable=inconsistent-return-statements
        self, **kwargs: Any
    ) -> None:
        """Send a 400 response with no payload.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get_default_model_a400_none_request(
            template_url=self.get_default_model_a400_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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.failsafe_deserialize(_models.MyException, pipeline_response)
            raise HttpResponseError(response=response, model=error)

        if cls:
            return cls(pipeline_response, None, {})

    get_default_model_a400_none.metadata = {"url": "/http/payloads/default/A/response/400/none"}

    @distributed_trace_async
    async def get_default_none200_invalid(  # pylint: disable=inconsistent-return-statements
        self, **kwargs: Any
    ) -> None:
        """Send a 200 response with invalid payload: {'statusCode': '200'}.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get_default_none200_invalid_request(
            template_url=self.get_default_none200_invalid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        if cls:
            return cls(pipeline_response, None, {})

    get_default_none200_invalid.metadata = {"url": "/http/payloads/default/none/response/200/invalid"}

    @distributed_trace_async
    async def get_default_none200_none(self, **kwargs: Any) -> None:  # pylint: disable=inconsistent-return-statements
        """Send a 200 response with no payload.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get_default_none200_none_request(
            template_url=self.get_default_none200_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        if cls:
            return cls(pipeline_response, None, {})

    get_default_none200_none.metadata = {"url": "/http/payloads/default/none/response/200/none"}

    @distributed_trace_async
    async def get_default_none400_invalid(  # pylint: disable=inconsistent-return-statements
        self, **kwargs: Any
    ) -> None:
        """Send a 400 response with valid payload: {'statusCode': '400'}.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get_default_none400_invalid_request(
            template_url=self.get_default_none400_invalid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        if cls:
            return cls(pipeline_response, None, {})

    get_default_none400_invalid.metadata = {"url": "/http/payloads/default/none/response/400/invalid"}

    @distributed_trace_async
    async def get_default_none400_none(self, **kwargs: Any) -> None:  # pylint: disable=inconsistent-return-statements
        """Send a 400 response with no payload.

        :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:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_get_default_none400_none_request(
            template_url=self.get_default_none400_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        if cls:
            return cls(pipeline_response, None, {})

    get_default_none400_none.metadata = {"url": "/http/payloads/default/none/response/400/none"}

    @distributed_trace_async
    async def get200_model_a200_none(self, **kwargs: Any) -> _models.MyException:
        """Send a 200 response with no payload, when a payload is expected - client should return a null
        object of thde type for model A.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get200_model_a200_none_request(
            template_url=self.get200_model_a200_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model_a200_none.metadata = {"url": "/http/payloads/200/A/response/200/none"}

    @distributed_trace_async
    async def get200_model_a200_valid(self, **kwargs: Any) -> _models.MyException:
        """Send a 200 response with payload {'statusCode': '200'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get200_model_a200_valid_request(
            template_url=self.get200_model_a200_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model_a200_valid.metadata = {"url": "/http/payloads/200/A/response/200/valid"}

    @distributed_trace_async
    async def get200_model_a200_invalid(self, **kwargs: Any) -> _models.MyException:
        """Send a 200 response with invalid payload {'statusCodeInvalid': '200'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get200_model_a200_invalid_request(
            template_url=self.get200_model_a200_invalid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model_a200_invalid.metadata = {"url": "/http/payloads/200/A/response/200/invalid"}

    @distributed_trace_async
    async def get200_model_a400_none(self, **kwargs: Any) -> _models.MyException:
        """Send a 400 response with no payload client should treat as an http error with no error model.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get200_model_a400_none_request(
            template_url=self.get200_model_a400_none.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model_a400_none.metadata = {"url": "/http/payloads/200/A/response/400/none"}

    @distributed_trace_async
    async def get200_model_a400_valid(self, **kwargs: Any) -> _models.MyException:
        """Send a 200 response with payload {'statusCode': '400'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get200_model_a400_valid_request(
            template_url=self.get200_model_a400_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model_a400_valid.metadata = {"url": "/http/payloads/200/A/response/400/valid"}

    @distributed_trace_async
    async def get200_model_a400_invalid(self, **kwargs: Any) -> _models.MyException:
        """Send a 200 response with invalid payload {'statusCodeInvalid': '400'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get200_model_a400_invalid_request(
            template_url=self.get200_model_a400_invalid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model_a400_invalid.metadata = {"url": "/http/payloads/200/A/response/400/invalid"}

    @distributed_trace_async
    async def get200_model_a202_valid(self, **kwargs: Any) -> _models.MyException:
        """Send a 202 response with payload {'statusCode': '202'}.

        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: MyException or the result of cls(response)
        :rtype: ~httpinfrastructure.models.MyException
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = kwargs.pop("params", {}) or {}

        cls: ClsType[_models.MyException] = kwargs.pop("cls", None)

        request = build_get200_model_a202_valid_request(
            template_url=self.get200_model_a202_valid.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        _stream = False
        pipeline_response: PipelineResponse = await self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=_stream, **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)
            raise HttpResponseError(response=response)

        deserialized = self._deserialize("MyException", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get200_model_a202_valid.metadata = {"url": "/http/payloads/200/A/response/202/valid"}
