# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8

import datetime
import json
import sys
from io import IOBase
from typing import (
    IO,
    TYPE_CHECKING,
    Any,
    Callable,
    Dict,
    List,
    Optional,
    Type,
    TypeVar,
    Union,
    overload,
)

from corehttp.exceptions import (
    ClientAuthenticationError,
    HttpResponseError,
    ResourceExistsError,
    ResourceNotFoundError,
    ResourceNotModifiedError,
    StreamClosedError,
    StreamConsumedError,
    map_error,
)
from corehttp.rest import AsyncHttpResponse, HttpRequest
from corehttp.runtime.pipeline import PipelineResponse
from corehttp.utils import case_insensitive_dict

from ... import models as _models
from ..._model_base import SdkJSONEncoder, _deserialize
from ...operations._operations import (
    build_calendar_resource_compute_dates_request,
    build_calendar_resource_count_periods_request,
    build_calendar_resource_delete_request,
    build_calendar_resource_generate_date_schedule_request,
    build_calendar_resource_generate_holidays_request,
    build_calendar_resource_overwrite_request,
    build_calendar_resource_read_request,
    build_calendars_resource_compute_dates_request,
    build_calendars_resource_count_periods_request,
    build_calendars_resource_create_request,
    build_calendars_resource_generate_date_schedule_request,
    build_calendars_resource_generate_holidays_request,
    build_calendars_resource_list_request,
    build_floating_rate_index_resource_delete_request,
    build_floating_rate_index_resource_overwrite_request,
    build_floating_rate_index_resource_read_request,
    build_floating_rate_indices_resource_create_request,
    build_floating_rate_indices_resource_list_request,
    build_fx_forward_curve_resource_calculate_request,
    build_fx_forward_curve_resource_delete_request,
    build_fx_forward_curve_resource_overwrite_request,
    build_fx_forward_curve_resource_read_request,
    build_fx_forward_curves_resource_build_from_deposits_request,
    build_fx_forward_curves_resource_build_from_fx_forwards_request,
    build_fx_forward_curves_resource_calculate_request,
    build_fx_forward_curves_resource_create_request,
    build_fx_forward_curves_resource_list_request,
    build_fx_forward_resource_delete_request,
    build_fx_forward_resource_overwrite_request,
    build_fx_forward_resource_price_request,
    build_fx_forward_resource_read_request,
    build_fx_forward_resource_value_request,
    build_fx_forwards_resource_build_fx_forward_from_template_request,
    build_fx_forwards_resource_create_request,
    build_fx_forwards_resource_list_request,
    build_fx_forwards_resource_price_request,
    build_fx_forwards_resource_value_request,
    build_fx_spot_resource_delete_request,
    build_fx_spot_resource_overwrite_request,
    build_fx_spot_resource_price_request,
    build_fx_spot_resource_read_request,
    build_fx_spot_resource_value_request,
    build_fx_spots_resource_build_fx_spot_from_template_request,
    build_fx_spots_resource_create_request,
    build_fx_spots_resource_list_request,
    build_fx_spots_resource_price_request,
    build_fx_spots_resource_value_request,
    build_instrument_template_resource_delete_request,
    build_instrument_template_resource_overwrite_request,
    build_instrument_template_resource_read_request,
    build_instrument_templates_resource_create_request,
    build_instrument_templates_resource_list_request,
    build_ir_swap_resource_delete_request,
    build_ir_swap_resource_overwrite_request,
    build_ir_swap_resource_read_request,
    build_ir_swap_resource_solve_request,
    build_ir_swap_resource_value_request,
    build_ir_swaps_resource_create_irs_from_cbs_template_request,
    build_ir_swaps_resource_create_irs_from_ccs_template_request,
    build_ir_swaps_resource_create_irs_from_leg_template_request,
    build_ir_swaps_resource_create_irs_from_tbs_template_request,
    build_ir_swaps_resource_create_irs_from_vanilla_irs_template_request,
    build_ir_swaps_resource_create_request,
    build_ir_swaps_resource_list_request,
    build_ir_swaps_resource_solve_request,
    build_ir_swaps_resource_value_request,
    build_yield_book_rest_abort_job_request,
    build_yield_book_rest_bulk_compact_request_request,
    build_yield_book_rest_bulk_composite_request_request,
    build_yield_book_rest_bulk_yb_port_udi_request_request,
    build_yield_book_rest_bulk_zip_request_request,
    build_yield_book_rest_close_job_request,
    build_yield_book_rest_create_job_request,
    build_yield_book_rest_get_cash_flow_async_request,
    build_yield_book_rest_get_cash_flow_sync_request,
    build_yield_book_rest_get_csv_bulk_result_request,
    build_yield_book_rest_get_formatted_result_request,
    build_yield_book_rest_get_job_data_request,
    build_yield_book_rest_get_job_object_meta_request,
    build_yield_book_rest_get_job_request,
    build_yield_book_rest_get_job_status_request,
    build_yield_book_rest_get_json_result_request,
    build_yield_book_rest_get_result_request,
    build_yield_book_rest_get_tba_pricing_sync_request,
    build_yield_book_rest_post_cash_flow_async_request,
    build_yield_book_rest_post_cash_flow_sync_request,
    build_yield_book_rest_post_csv_bulk_results_sync_request,
    build_yield_book_rest_post_json_bulk_request_sync_request,
    build_yield_book_rest_request_bond_indic_async_get_request,
    build_yield_book_rest_request_bond_indic_async_request,
    build_yield_book_rest_request_bond_indic_sync_get_request,
    build_yield_book_rest_request_bond_indic_sync_request,
    build_yield_book_rest_request_curve_async_request,
    build_yield_book_rest_request_curve_sync_request,
    build_yield_book_rest_request_curves_async_request,
    build_yield_book_rest_request_curves_sync_request,
    build_yield_book_rest_request_get_scen_calc_sys_scen_async_request,
    build_yield_book_rest_request_get_scen_calc_sys_scen_sync_request,
    build_yield_book_rest_request_py_calculation_async_by_id_request,
    build_yield_book_rest_request_py_calculation_async_request,
    build_yield_book_rest_request_py_calculation_sync_by_id_request,
    build_yield_book_rest_request_py_calculation_sync_request,
    build_yield_book_rest_request_return_attribution_async_request,
    build_yield_book_rest_request_return_attribution_sync_request,
    build_yield_book_rest_request_scenario_calculation_async_request,
    build_yield_book_rest_request_scenario_calculation_sync_request,
    build_yield_book_rest_request_volatility_async_request,
    build_yield_book_rest_request_volatility_sync_request,
    build_yield_book_rest_resubmit_job_request,
    build_yield_book_rest_upload_csv_job_data_async_request,
    build_yield_book_rest_upload_csv_job_data_sync_request,
    build_yield_book_rest_upload_csv_job_data_with_name_async_request,
    build_yield_book_rest_upload_csv_job_data_with_name_sync_request,
    build_yield_book_rest_upload_json_job_data_async_request,
    build_yield_book_rest_upload_json_job_data_sync_request,
    build_yield_book_rest_upload_json_job_data_with_name_async_request,
    build_yield_book_rest_upload_json_job_data_with_name_sync_request,
    build_yield_book_rest_upload_text_job_data_async_request,
    build_yield_book_rest_upload_text_job_data_sync_request,
    build_yield_book_rest_upload_text_job_data_with_name_async_request,
    build_yield_book_rest_upload_text_job_data_with_name_sync_request,
)

if sys.version_info >= (3, 9):
    from collections.abc import MutableMapping
else:
    from typing import (
        MutableMapping,  # type: ignore  # pylint: disable=ungrouped-imports
    )

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from ... import _types
JSON = MutableMapping[str, Any]  # pylint: disable=unsubscriptable-object
_Unset: Any = object()
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]


class calendarsResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`calendars_resource` attribute.
    """

    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")

    async def list(
        self,
        *,
        item_per_page: Optional[int] = None,
        page: Optional[int] = None,
        spaces: Optional[List[str]] = None,
        names: Optional[List[str]] = None,
        space_name_sort_order: Optional[Union[str, _models.SortingOrderEnum]] = None,
        tags: Optional[List[str]] = None,
        fields: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[_models.CalendarCollectionResponse, _models.ServiceErrorResponse]:
        """List the Calendars existing in the platform (depending on permissions).

        :keyword item_per_page: A parameter used to select the number of items allowed per page. The
         valid range is 1-500. If not provided, 50 will be used. Default value is None.
        :paramtype item_per_page: int
        :keyword page: A parameter used to define the page number to display. Default value is None.
        :paramtype page: int
        :keyword spaces: A parameter used to search for platform resources stored in a given space.
         Space is like a namespace where resources are stored. By default there are two spaces:
         LSEG is reserved for LSEG maintained resources, HOME is reserved for user's default space.
         If space is not specified, it will search within all spaces. Default value is None.
        :paramtype spaces: list[str]
        :keyword names: A parameter used to search for platform resources with given names. Default
         value is None.
        :paramtype names: list[str]
        :keyword space_name_sort_order: A parameter used to sort platform resources by name based on a
         defined order. Known values are: "Asc" and "Desc". Default value is None.
        :paramtype space_name_sort_order: str or ~analyticsapi.models.SortingOrderEnum
        :keyword tags: A parameter used to search for platform resources with given tags. Default value
         is None.
        :paramtype tags: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: CalendarCollectionResponse or ServiceErrorResponse. The CalendarCollectionResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.CalendarCollectionResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "computeDates": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "generateDateSchedule": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "generateHolidays": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.CalendarCollectionResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_calendars_resource_list_request(
            item_per_page=item_per_page,
            page=page,
            spaces=spaces,
            names=names,
            space_name_sort_order=space_name_sort_order,
            tags=tags,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.CalendarCollectionResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create(
        self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        """Save a new Calendar in the platform.

        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "firstDayOfWeek": "str",
                        "holidayExceptionRules": [
                            {
                                "duration": duration,
                                "name": "str",
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                },
                                "when": when,
                                "description": "str"
                            }
                        ],
                        "holidayRules": [
                            {
                                "duration": duration,
                                "name": "str",
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                },
                                "when": when,
                                "description": "str"
                            }
                        ],
                        "restDays": [
                            {
                                "restDays": [
                                    "str"
                                ],
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                }
                            }
                        ]
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self,
        *,
        location: _models.Location,
        definition: _models.CalendarDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        """Save a new Calendar in the platform.

        :keyword location: Object defining the location of the Calendar in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Calendar definition. Required.
        :paramtype definition: ~analyticsapi.models.CalendarDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Calendar description. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        """Save a new Calendar in the platform.

        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.CalendarDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        """Save a new Calendar in the platform.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the Calendar in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Calendar definition. Required.
        :paramtype definition: ~analyticsapi.models.CalendarDefinition
        :keyword description: Calendar description. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "firstDayOfWeek": "str",
                        "holidayExceptionRules": [
                            {
                                "duration": duration,
                                "name": "str",
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                },
                                "when": when,
                                "description": "str"
                            }
                        ],
                        "holidayRules": [
                            {
                                "duration": duration,
                                "name": "str",
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                },
                                "when": when,
                                "description": "str"
                            }
                        ],
                        "restDays": [
                            {
                                "restDays": [
                                    "str"
                                ],
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                }
                            }
                        ]
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.CalendarResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendars_resource_create_request(
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            201,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 201:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.CalendarResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def generate_holidays(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]:
        """Gets the holidays for the calendar within a date range. Start and End Dates are included in the
        calculation. Only saved calendars are supported.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: GenerateHolidaysResponse or ServiceErrorResponse. The GenerateHolidaysResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateHolidaysResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "calendars": [
                        "str"
                    ],
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "date": "2020-02-20",
                            "names": [
                                {
                                    "calendars": [
                                        "str"
                                    ],
                                    "countries": [
                                        "str"
                                    ],
                                    "name": "str"
                                }
                            ],
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def generate_holidays(
        self,
        *,
        end_date: datetime.date,
        calendars: List[str],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        start_date: Optional[datetime.date] = None,
        **kwargs: Any,
    ) -> Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]:
        """Gets the holidays for the calendar within a date range. Start and End Dates are included in the
        calculation. Only saved calendars are supported.

        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01). Required.
        :paramtype end_date: ~datetime.date
        :keyword calendars: An array of calendar defining objects for which the calculation should be
         done. Each string being composed of the space and name of a calendar. For example 'LSEG/UKG' is
         the string referencing the 'UKG' calendar stored in the 'LSEG' space. Required.
        :paramtype calendars: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Default is today. Default value is None.
        :paramtype start_date: ~datetime.date
        :return: GenerateHolidaysResponse or ServiceErrorResponse. The GenerateHolidaysResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateHolidaysResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "date": "2020-02-20",
                            "names": [
                                {
                                    "calendars": [
                                        "str"
                                    ],
                                    "countries": [
                                        "str"
                                    ],
                                    "name": "str"
                                }
                            ],
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def generate_holidays(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]:
        """Gets the holidays for the calendar within a date range. Start and End Dates are included in the
        calculation. Only saved calendars are supported.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: GenerateHolidaysResponse or ServiceErrorResponse. The GenerateHolidaysResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateHolidaysResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "date": "2020-02-20",
                            "names": [
                                {
                                    "calendars": [
                                        "str"
                                    ],
                                    "countries": [
                                        "str"
                                    ],
                                    "name": "str"
                                }
                            ],
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def generate_holidays(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        end_date: datetime.date = _Unset,
        calendars: List[str] = _Unset,
        fields: Optional[str] = None,
        start_date: Optional[datetime.date] = None,
        **kwargs: Any,
    ) -> Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]:
        """Gets the holidays for the calendar within a date range. Start and End Dates are included in the
        calculation. Only saved calendars are supported.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01). Required.
        :paramtype end_date: ~datetime.date
        :keyword calendars: An array of calendar defining objects for which the calculation should be
         done. Each string being composed of the space and name of a calendar. For example 'LSEG/UKG' is
         the string referencing the 'UKG' calendar stored in the 'LSEG' space. Required.
        :paramtype calendars: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Default is today. Default value is None.
        :paramtype start_date: ~datetime.date
        :return: GenerateHolidaysResponse or ServiceErrorResponse. The GenerateHolidaysResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateHolidaysResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "calendars": [
                        "str"
                    ],
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "date": "2020-02-20",
                            "names": [
                                {
                                    "calendars": [
                                        "str"
                                    ],
                                    "countries": [
                                        "str"
                                    ],
                                    "name": "str"
                                }
                            ],
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if end_date is _Unset:
                raise TypeError("missing required argument: end_date")
            if calendars is _Unset:
                raise TypeError("missing required argument: calendars")
            body = {"calendars": calendars, "endDate": end_date, "startDate": start_date}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendars_resource_generate_holidays_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.GenerateHolidaysResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def compute_dates(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]:
        """Computes dates for the calendar according to specified conditions. Start Date is included in
        the calculation. Only saved calendars are supported.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ComputeDatesResponse or ServiceErrorResponse. The ComputeDatesResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.ComputeDatesResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "calendars": [
                        "str"
                    ],
                    "tenors": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "endOfMonthConvention": "str",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "tenor": "str",
                            "endDate": "2020-02-20",
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def compute_dates(
        self,
        *,
        tenors: List[str],
        calendars: List[str],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        start_date: Optional[datetime.date] = None,
        date_moving_convention: Optional[Union[str, _models.DateMovingConvention]] = None,
        end_of_month_convention: Optional[Union[str, _models.EndOfMonthConvention]] = None,
        **kwargs: Any,
    ) -> Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]:
        """Computes dates for the calendar according to specified conditions. Start Date is included in
        the calculation. Only saved calendars are supported.

        :keyword tenors: Tenors to be added to startDate to calculate the resultant dates (e.g., 1M,
         1Y).
         A tenor expresses a period of time using a specific syntax. There are two kinds of tenor:


         * Ad-hoc tenors explicitly state the length of time in Days (D), Weeks (W), Months (M) and
         Years (Y).
           For example "1D" for one day, "2W" for two weeks or "3M1D" for three months and a day.
           When mixing units, units must be written in descending order of size (Y > M > W > D).  So,
         5M3D is valid, but 3D5M is not.
         * Common tenors are expressed as letter codes:
         * ON (Overnight) - A one business day period that starts today.
         * TN (Tomorrow-Next) - A one business day period that starts next business day.
         * SPOT (Spot Date) - A period that ends on the spot date.  Date is calculated as trade date
         (today) + days to spot.
         * SN (Spot-Next) - A one business day period that starts at the spot date.
         * SW (Spot-Week) - A one business week period that starts at the spot date. Required.
        :paramtype tenors: list[str]
        :keyword calendars: An array of calendar defining objects for which the calculation should be
         done. Each string being composed of the space and name of a calendar. For example 'LSEG/UKG' is
         the string referencing the 'UKG' calendar stored in the 'LSEG' space. Required.
        :paramtype calendars: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Default is Today. Default value is None.
        :paramtype start_date: ~datetime.date
        :keyword date_moving_convention: The method to adjust dates to working days. The default value
         is ModifiedFollowing. Known values are: "ModifiedFollowing", "NextBusinessDay",
         "PreviousBusinessDay", "NoMoving", "EveryThirdWednesday", and "BbswModifiedFollowing". Default
         value is None.
        :paramtype date_moving_convention: str or ~analyticsapi.models.DateMovingConvention
        :keyword end_of_month_convention: Conventions to adjust payment dates when they fall at the end
         of a month. Known values are: "Last", "Same", "Last28", "Same28", and "Same1". Default value is
         None.
        :paramtype end_of_month_convention: str or ~analyticsapi.models.EndOfMonthConvention
        :return: ComputeDatesResponse or ServiceErrorResponse. The ComputeDatesResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.ComputeDatesResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "tenor": "str",
                            "endDate": "2020-02-20",
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def compute_dates(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]:
        """Computes dates for the calendar according to specified conditions. Start Date is included in
        the calculation. Only saved calendars are supported.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ComputeDatesResponse or ServiceErrorResponse. The ComputeDatesResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.ComputeDatesResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "tenor": "str",
                            "endDate": "2020-02-20",
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def compute_dates(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        tenors: List[str] = _Unset,
        calendars: List[str] = _Unset,
        fields: Optional[str] = None,
        start_date: Optional[datetime.date] = None,
        date_moving_convention: Optional[Union[str, _models.DateMovingConvention]] = None,
        end_of_month_convention: Optional[Union[str, _models.EndOfMonthConvention]] = None,
        **kwargs: Any,
    ) -> Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]:
        """Computes dates for the calendar according to specified conditions. Start Date is included in
        the calculation. Only saved calendars are supported.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword tenors: Tenors to be added to startDate to calculate the resultant dates (e.g., 1M,
         1Y).
         A tenor expresses a period of time using a specific syntax. There are two kinds of tenor:


         * Ad-hoc tenors explicitly state the length of time in Days (D), Weeks (W), Months (M) and
         Years (Y).
           For example "1D" for one day, "2W" for two weeks or "3M1D" for three months and a day.
           When mixing units, units must be written in descending order of size (Y > M > W > D).  So,
         5M3D is valid, but 3D5M is not.
         * Common tenors are expressed as letter codes:
         * ON (Overnight) - A one business day period that starts today.
         * TN (Tomorrow-Next) - A one business day period that starts next business day.
         * SPOT (Spot Date) - A period that ends on the spot date.  Date is calculated as trade date
         (today) + days to spot.
         * SN (Spot-Next) - A one business day period that starts at the spot date.
         * SW (Spot-Week) - A one business week period that starts at the spot date. Required.
        :paramtype tenors: list[str]
        :keyword calendars: An array of calendar defining objects for which the calculation should be
         done. Each string being composed of the space and name of a calendar. For example 'LSEG/UKG' is
         the string referencing the 'UKG' calendar stored in the 'LSEG' space. Required.
        :paramtype calendars: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Default is Today. Default value is None.
        :paramtype start_date: ~datetime.date
        :keyword date_moving_convention: The method to adjust dates to working days. The default value
         is ModifiedFollowing. Known values are: "ModifiedFollowing", "NextBusinessDay",
         "PreviousBusinessDay", "NoMoving", "EveryThirdWednesday", and "BbswModifiedFollowing". Default
         value is None.
        :paramtype date_moving_convention: str or ~analyticsapi.models.DateMovingConvention
        :keyword end_of_month_convention: Conventions to adjust payment dates when they fall at the end
         of a month. Known values are: "Last", "Same", "Last28", "Same28", and "Same1". Default value is
         None.
        :paramtype end_of_month_convention: str or ~analyticsapi.models.EndOfMonthConvention
        :return: ComputeDatesResponse or ServiceErrorResponse. The ComputeDatesResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.ComputeDatesResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "calendars": [
                        "str"
                    ],
                    "tenors": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "endOfMonthConvention": "str",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "tenor": "str",
                            "endDate": "2020-02-20",
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if tenors is _Unset:
                raise TypeError("missing required argument: tenors")
            if calendars is _Unset:
                raise TypeError("missing required argument: calendars")
            body = {
                "calendars": calendars,
                "dateMovingConvention": date_moving_convention,
                "endOfMonthConvention": end_of_month_convention,
                "startDate": start_date,
                "tenors": tenors,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendars_resource_compute_dates_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ComputeDatesResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def generate_date_schedule(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]:
        """Generates a date schedule for the calendar according to specified conditions. Start and End
        Dates are included in the calculation. Only saved calendars are supported.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: GenerateDateScheduleResponse or ServiceErrorResponse. The GenerateDateScheduleResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateDateScheduleResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "calendars": [
                        "str"
                    ],
                    "frequency": "str",
                    "calendarDayOfMonth": 0,
                    "count": 0,
                    "dayOfWeek": "str",
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        "2020-02-20"
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def generate_date_schedule(
        self,
        *,
        frequency: Union[str, _models.Frequency],
        calendars: List[str],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        start_date: Optional[datetime.date] = None,
        end_date: Optional[datetime.date] = None,
        calendar_day_of_month: Optional[int] = None,
        count: Optional[int] = None,
        day_of_week: Optional[Union[str, _models.WeekDay]] = None,
        **kwargs: Any,
    ) -> Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]:
        """Generates a date schedule for the calendar according to specified conditions. Start and End
        Dates are included in the calculation. Only saved calendars are supported.

        :keyword frequency: The frequency of dates in the schedule which should be generated. Note that
         "Daily" refers to working days only. Known values are: "Daily", "Weekly", "BiWeekly",
         "Monthly", "Quarterly", and "Anually". Required.
        :paramtype frequency: str or ~analyticsapi.models.Frequency
        :keyword calendars: An array of calendar defining objects for which the calculation should be
         done. Each string being composed of the space and name of a calendar. For example 'LSEG/UKG' is
         the string referencing the 'UKG' calendar stored in the 'LSEG' space. Required.
        :paramtype calendars: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01).
         The start date must be less or equal to the end date.
         Required if endDate is in the past. Default value is None.
        :paramtype start_date: ~datetime.date
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01).
         If startDate is not specified, endDate is used to define the list of dates from today's date
         to the end date.
         The end date must be greater or equal to the start date.
         Required if count is not specified. Only one of endDate and count can be set at a time.
         Default value is None.
        :paramtype end_date: ~datetime.date
        :keyword calendar_day_of_month: The number of the day of the month. Required if frequency is
         Monthly; do not use otherwise. The minimum value is 1. The maximum value is 31. Default value
         is None.
        :paramtype calendar_day_of_month: int
        :keyword count: The number of dates to be generated,  counting from the start date (or today's
         date if the start day is not set) to the end date.
         It should not have a negative value.
         Required if endDate is not specified. Only one of endDate and count can be set at a time.
         Default value is None.
        :paramtype count: int
        :keyword day_of_week: The day of the week. Required if frequency is Weekly or BiWeekly; do not
         use otherwise. Known values are: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
         "Saturday", and "Sunday". Default value is None.
        :paramtype day_of_week: str or ~analyticsapi.models.WeekDay
        :return: GenerateDateScheduleResponse or ServiceErrorResponse. The GenerateDateScheduleResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateDateScheduleResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        "2020-02-20"
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def generate_date_schedule(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]:
        """Generates a date schedule for the calendar according to specified conditions. Start and End
        Dates are included in the calculation. Only saved calendars are supported.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: GenerateDateScheduleResponse or ServiceErrorResponse. The GenerateDateScheduleResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateDateScheduleResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        "2020-02-20"
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def generate_date_schedule(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        frequency: Union[str, _models.Frequency] = _Unset,
        calendars: List[str] = _Unset,
        fields: Optional[str] = None,
        start_date: Optional[datetime.date] = None,
        end_date: Optional[datetime.date] = None,
        calendar_day_of_month: Optional[int] = None,
        count: Optional[int] = None,
        day_of_week: Optional[Union[str, _models.WeekDay]] = None,
        **kwargs: Any,
    ) -> Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]:
        """Generates a date schedule for the calendar according to specified conditions. Start and End
        Dates are included in the calculation. Only saved calendars are supported.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword frequency: The frequency of dates in the schedule which should be generated. Note that
         "Daily" refers to working days only. Known values are: "Daily", "Weekly", "BiWeekly",
         "Monthly", "Quarterly", and "Anually". Required.
        :paramtype frequency: str or ~analyticsapi.models.Frequency
        :keyword calendars: An array of calendar defining objects for which the calculation should be
         done. Each string being composed of the space and name of a calendar. For example 'LSEG/UKG' is
         the string referencing the 'UKG' calendar stored in the 'LSEG' space. Required.
        :paramtype calendars: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01).
         The start date must be less or equal to the end date.
         Required if endDate is in the past. Default value is None.
        :paramtype start_date: ~datetime.date
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01).
         If startDate is not specified, endDate is used to define the list of dates from today's date
         to the end date.
         The end date must be greater or equal to the start date.
         Required if count is not specified. Only one of endDate and count can be set at a time.
         Default value is None.
        :paramtype end_date: ~datetime.date
        :keyword calendar_day_of_month: The number of the day of the month. Required if frequency is
         Monthly; do not use otherwise. The minimum value is 1. The maximum value is 31. Default value
         is None.
        :paramtype calendar_day_of_month: int
        :keyword count: The number of dates to be generated,  counting from the start date (or today's
         date if the start day is not set) to the end date.
         It should not have a negative value.
         Required if endDate is not specified. Only one of endDate and count can be set at a time.
         Default value is None.
        :paramtype count: int
        :keyword day_of_week: The day of the week. Required if frequency is Weekly or BiWeekly; do not
         use otherwise. Known values are: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
         "Saturday", and "Sunday". Default value is None.
        :paramtype day_of_week: str or ~analyticsapi.models.WeekDay
        :return: GenerateDateScheduleResponse or ServiceErrorResponse. The GenerateDateScheduleResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateDateScheduleResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "calendars": [
                        "str"
                    ],
                    "frequency": "str",
                    "calendarDayOfMonth": 0,
                    "count": 0,
                    "dayOfWeek": "str",
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        "2020-02-20"
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            if frequency is _Unset:
                raise TypeError("missing required argument: frequency")
            if calendars is _Unset:
                raise TypeError("missing required argument: calendars")
            body = {
                "calendarDayOfMonth": calendar_day_of_month,
                "calendars": calendars,
                "count": count,
                "dayOfWeek": day_of_week,
                "endDate": end_date,
                "frequency": frequency,
                "startDate": start_date,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendars_resource_generate_date_schedule_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.GenerateDateScheduleResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def count_periods(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]:
        """Counts the time periods that satisfy specified conditions. Note the use of date strings for
        convenience. Start and End Dates are included in the calculation. Only saved calendars are
        supported.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: CountPeriodsResponse or ServiceErrorResponse. The CountPeriodsResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.CountPeriodsResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20",
                    "calendars": [
                        "str"
                    ],
                    "dayCountBasis": "str",
                    "periodType": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "count": 0.0,
                        "periodType": "str",
                        "processingInformation": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def count_periods(
        self,
        *,
        start_date: datetime.date,
        end_date: datetime.date,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        day_count_basis: Optional[Union[str, _models.DayCountBasis]] = None,
        period_type: Optional[Union[str, _models.PeriodType]] = None,
        calendars: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]:
        """Counts the time periods that satisfy specified conditions. Note the use of date strings for
        convenience. Start and End Dates are included in the calculation. Only saved calendars are
        supported.

        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Required.
        :paramtype start_date: ~datetime.date
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01). Required.
        :paramtype end_date: ~datetime.date
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword day_count_basis: The day count basis convention used to calculate the period between
         two dates.
         It is used when periodType is set to Year.
         Each convention defines the number of days between two dates and the year length in days
         (basis) for the period calculation.
         Default is DCB_ACTUAL_ACTUAL. Known values are: "Dcb_30_360", "Dcb_30_360_US",
         "Dcb_30_360_German", "Dcb_30_360_ISDA", "Dcb_30_365_ISDA", "Dcb_30_365_German",
         "Dcb_30_365_Brazil", "Dcb_30_Actual_German", "Dcb_30_Actual", "Dcb_30_Actual_ISDA",
         "Dcb_30E_360_ISMA", "Dcb_Actual_360", "Dcb_Actual_364", "Dcb_Actual_365", "Dcb_Actual_Actual",
         "Dcb_Actual_Actual_ISDA", "Dcb_Actual_Actual_AFB", "Dcb_WorkingDays_252", "Dcb_Actual_365L",
         "Dcb_Actual_365P", "Dcb_ActualLeapDay_365", "Dcb_ActualLeapDay_360", "Dcb_Actual_36525", and
         "Dcb_Actual_365_CanadianConvention". Default value is None.
        :paramtype day_count_basis: str or ~analyticsapi.models.DayCountBasis
        :keyword period_type: The method of the period calculation. Default is Day. Known values are:
         "WorkingDay", "NonWorkingDay", "Day", "Week", "Month", "Quarter", and "Year". Default value is
         None.
        :paramtype period_type: str or ~analyticsapi.models.PeriodType
        :keyword calendars: An array of calendar defining objects for which the calculation should be
         done. Each string being composed of the space and name of a calendar.
         For example 'LSEG/UKG' is the string referencing the 'UKG' calendar stored in the 'LSEG'
         space.
         The calendars parameter is optional only when periodType is "Day" or "Year".
         For a given day to be considered a working day, it must be a working day in all of the
         selected calendars. If it is a non-working day in any of the calendars, it is a non-working
         day. Default value is None.
        :paramtype calendars: list[str]
        :return: CountPeriodsResponse or ServiceErrorResponse. The CountPeriodsResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.CountPeriodsResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "count": 0.0,
                        "periodType": "str",
                        "processingInformation": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def count_periods(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]:
        """Counts the time periods that satisfy specified conditions. Note the use of date strings for
        convenience. Start and End Dates are included in the calculation. Only saved calendars are
        supported.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: CountPeriodsResponse or ServiceErrorResponse. The CountPeriodsResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.CountPeriodsResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "count": 0.0,
                        "periodType": "str",
                        "processingInformation": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def count_periods(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        start_date: datetime.date = _Unset,
        end_date: datetime.date = _Unset,
        fields: Optional[str] = None,
        day_count_basis: Optional[Union[str, _models.DayCountBasis]] = None,
        period_type: Optional[Union[str, _models.PeriodType]] = None,
        calendars: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]:
        """Counts the time periods that satisfy specified conditions. Note the use of date strings for
        convenience. Start and End Dates are included in the calculation. Only saved calendars are
        supported.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Required.
        :paramtype start_date: ~datetime.date
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01). Required.
        :paramtype end_date: ~datetime.date
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword day_count_basis: The day count basis convention used to calculate the period between
         two dates.
         It is used when periodType is set to Year.
         Each convention defines the number of days between two dates and the year length in days
         (basis) for the period calculation.
         Default is DCB_ACTUAL_ACTUAL. Known values are: "Dcb_30_360", "Dcb_30_360_US",
         "Dcb_30_360_German", "Dcb_30_360_ISDA", "Dcb_30_365_ISDA", "Dcb_30_365_German",
         "Dcb_30_365_Brazil", "Dcb_30_Actual_German", "Dcb_30_Actual", "Dcb_30_Actual_ISDA",
         "Dcb_30E_360_ISMA", "Dcb_Actual_360", "Dcb_Actual_364", "Dcb_Actual_365", "Dcb_Actual_Actual",
         "Dcb_Actual_Actual_ISDA", "Dcb_Actual_Actual_AFB", "Dcb_WorkingDays_252", "Dcb_Actual_365L",
         "Dcb_Actual_365P", "Dcb_ActualLeapDay_365", "Dcb_ActualLeapDay_360", "Dcb_Actual_36525", and
         "Dcb_Actual_365_CanadianConvention". Default value is None.
        :paramtype day_count_basis: str or ~analyticsapi.models.DayCountBasis
        :keyword period_type: The method of the period calculation. Default is Day. Known values are:
         "WorkingDay", "NonWorkingDay", "Day", "Week", "Month", "Quarter", and "Year". Default value is
         None.
        :paramtype period_type: str or ~analyticsapi.models.PeriodType
        :keyword calendars: An array of calendar defining objects for which the calculation should be
         done. Each string being composed of the space and name of a calendar.
         For example 'LSEG/UKG' is the string referencing the 'UKG' calendar stored in the 'LSEG'
         space.
         The calendars parameter is optional only when periodType is "Day" or "Year".
         For a given day to be considered a working day, it must be a working day in all of the
         selected calendars. If it is a non-working day in any of the calendars, it is a non-working
         day. Default value is None.
        :paramtype calendars: list[str]
        :return: CountPeriodsResponse or ServiceErrorResponse. The CountPeriodsResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.CountPeriodsResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20",
                    "calendars": [
                        "str"
                    ],
                    "dayCountBasis": "str",
                    "periodType": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "count": 0.0,
                        "periodType": "str",
                        "processingInformation": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if start_date is _Unset:
                raise TypeError("missing required argument: start_date")
            if end_date is _Unset:
                raise TypeError("missing required argument: end_date")
            body = {
                "calendars": calendars,
                "dayCountBasis": day_count_basis,
                "endDate": end_date,
                "periodType": period_type,
                "startDate": start_date,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendars_resource_count_periods_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.CountPeriodsResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class calendarResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`calendar_resource` attribute.
    """

    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")

    async def read(
        self, calendar_id: str, *, fields: Optional[str] = None, **kwargs: Any
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        """Access a Calendar existing in the platform (read).

        :param calendar_id: Required.
        :type calendar_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.CalendarResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_calendar_resource_read_request(
            calendar_id=calendar_id,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.CalendarResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def delete(self, calendar_id: str, **kwargs: Any) -> Optional[_models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Delete a Calendar that exists in the platform.

        :param calendar_id: Required.
        :type calendar_id: str
        :return: ServiceErrorResponse or None. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.ServiceErrorResponse or None
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_calendar_resource_delete_request(
            calendar_id=calendar_id,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            204,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        deserialized = None
        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def overwrite(
        self, calendar_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a Calendar that exists in the platform.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "firstDayOfWeek": "str",
                        "holidayExceptionRules": [
                            {
                                "duration": duration,
                                "name": "str",
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                },
                                "when": when,
                                "description": "str"
                            }
                        ],
                        "holidayRules": [
                            {
                                "duration": duration,
                                "name": "str",
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                },
                                "when": when,
                                "description": "str"
                            }
                        ],
                        "restDays": [
                            {
                                "restDays": [
                                    "str"
                                ],
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                }
                            }
                        ]
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self,
        calendar_id: str,
        *,
        location: _models.Location,
        definition: _models.CalendarDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a Calendar that exists in the platform.

        :param calendar_id: Required.
        :type calendar_id: str
        :keyword location: Object defining the location of the Calendar in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Calendar definition. Required.
        :paramtype definition: ~analyticsapi.models.CalendarDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Calendar description. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self, calendar_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a Calendar that exists in the platform.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def overwrite(
        self,
        calendar_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.CalendarDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.CalendarResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a Calendar that exists in the platform.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the Calendar in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Calendar definition. Required.
        :paramtype definition: ~analyticsapi.models.CalendarDefinition
        :keyword description: Calendar description. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: CalendarResponse or ServiceErrorResponse. The CalendarResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.CalendarResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "firstDayOfWeek": "str",
                        "holidayExceptionRules": [
                            {
                                "duration": duration,
                                "name": "str",
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                },
                                "when": when,
                                "description": "str"
                            }
                        ],
                        "holidayRules": [
                            {
                                "duration": duration,
                                "name": "str",
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                },
                                "when": when,
                                "description": "str"
                            }
                        ],
                        "restDays": [
                            {
                                "restDays": [
                                    "str"
                                ],
                                "validityPeriod": {
                                    "endDate": "2020-02-20",
                                    "startDate": "2020-02-20"
                                }
                            }
                        ]
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstDayOfWeek": "str",
                            "holidayExceptionRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "holidayRules": [
                                {
                                    "duration": duration,
                                    "name": "str",
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    },
                                    "when": when,
                                    "description": "str"
                                }
                            ],
                            "restDays": [
                                {
                                    "restDays": [
                                        "str"
                                    ],
                                    "validityPeriod": {
                                        "endDate": "2020-02-20",
                                        "startDate": "2020-02-20"
                                    }
                                }
                            ]
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.CalendarResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendar_resource_overwrite_request(
            calendar_id=calendar_id,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.CalendarResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def generate_holidays(
        self,
        calendar_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]:
        """Gets the holidays for the calendar within a date range. Start and End Dates are included in the
        calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: GenerateHolidaysResponse or ServiceErrorResponse. The GenerateHolidaysResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateHolidaysResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "date": "2020-02-20",
                            "names": [
                                {
                                    "calendars": [
                                        "str"
                                    ],
                                    "countries": [
                                        "str"
                                    ],
                                    "name": "str"
                                }
                            ],
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def generate_holidays(
        self,
        calendar_id: str,
        *,
        end_date: datetime.date,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        start_date: Optional[datetime.date] = None,
        **kwargs: Any,
    ) -> Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]:
        """Gets the holidays for the calendar within a date range. Start and End Dates are included in the
        calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01). Required.
        :paramtype end_date: ~datetime.date
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Default is today. Default value is None.
        :paramtype start_date: ~datetime.date
        :return: GenerateHolidaysResponse or ServiceErrorResponse. The GenerateHolidaysResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateHolidaysResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "date": "2020-02-20",
                            "names": [
                                {
                                    "calendars": [
                                        "str"
                                    ],
                                    "countries": [
                                        "str"
                                    ],
                                    "name": "str"
                                }
                            ],
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def generate_holidays(
        self,
        calendar_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]:
        """Gets the holidays for the calendar within a date range. Start and End Dates are included in the
        calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: GenerateHolidaysResponse or ServiceErrorResponse. The GenerateHolidaysResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateHolidaysResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "date": "2020-02-20",
                            "names": [
                                {
                                    "calendars": [
                                        "str"
                                    ],
                                    "countries": [
                                        "str"
                                    ],
                                    "name": "str"
                                }
                            ],
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def generate_holidays(
        self,
        calendar_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        end_date: datetime.date = _Unset,
        fields: Optional[str] = None,
        start_date: Optional[datetime.date] = None,
        **kwargs: Any,
    ) -> Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]:
        """Gets the holidays for the calendar within a date range. Start and End Dates are included in the
        calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01). Required.
        :paramtype end_date: ~datetime.date
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Default is today. Default value is None.
        :paramtype start_date: ~datetime.date
        :return: GenerateHolidaysResponse or ServiceErrorResponse. The GenerateHolidaysResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateHolidaysResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "date": "2020-02-20",
                            "names": [
                                {
                                    "calendars": [
                                        "str"
                                    ],
                                    "countries": [
                                        "str"
                                    ],
                                    "name": "str"
                                }
                            ],
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.GenerateHolidaysResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if end_date is _Unset:
                raise TypeError("missing required argument: end_date")
            body = {"endDate": end_date, "startDate": start_date}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendar_resource_generate_holidays_request(
            calendar_id=calendar_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.GenerateHolidaysResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def compute_dates(
        self,
        calendar_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]:
        """Computes dates for the calendar according to specified conditions. Start Date is included in
        the calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ComputeDatesResponse or ServiceErrorResponse. The ComputeDatesResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.ComputeDatesResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "tenors": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "endOfMonthConvention": "str",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "tenor": "str",
                            "endDate": "2020-02-20",
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def compute_dates(
        self,
        calendar_id: str,
        *,
        tenors: List[str],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        start_date: Optional[datetime.date] = None,
        date_moving_convention: Optional[Union[str, _models.DateMovingConvention]] = None,
        end_of_month_convention: Optional[Union[str, _models.EndOfMonthConvention]] = None,
        **kwargs: Any,
    ) -> Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]:
        """Computes dates for the calendar according to specified conditions. Start Date is included in
        the calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :keyword tenors: Tenors to be added to startDate to calculate the resultant dates (e.g., 1M,
         1Y).
         A tenor expresses a period of time using a specific syntax. There are two kinds of tenor:


         * Ad-hoc tenors explicitly state the length of time in Days (D), Weeks (W), Months (M) and
         Years (Y).
           For example "1D" for one day, "2W" for two weeks or "3M1D" for three months and a day.
           When mixing units, units must be written in descending order of size (Y > M > W > D).  So,
         5M3D is valid, but 3D5M is not.
         * Common tenors are expressed as letter codes:
         * ON (Overnight) - A one business day period that starts today.
         * TN (Tomorrow-Next) - A one business day period that starts next business day.
         * SPOT (Spot Date) - A period that ends on the spot date.  Date is calculated as trade date
         (today) + days to spot.
         * SN (Spot-Next) - A one business day period that starts at the spot date.
         * SW (Spot-Week) - A one business week period that starts at the spot date. Required.
        :paramtype tenors: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Default is Today. Default value is None.
        :paramtype start_date: ~datetime.date
        :keyword date_moving_convention: The method to adjust dates to working days. The default value
         is ModifiedFollowing. Known values are: "ModifiedFollowing", "NextBusinessDay",
         "PreviousBusinessDay", "NoMoving", "EveryThirdWednesday", and "BbswModifiedFollowing". Default
         value is None.
        :paramtype date_moving_convention: str or ~analyticsapi.models.DateMovingConvention
        :keyword end_of_month_convention: Conventions to adjust payment dates when they fall at the end
         of a month. Known values are: "Last", "Same", "Last28", "Same28", and "Same1". Default value is
         None.
        :paramtype end_of_month_convention: str or ~analyticsapi.models.EndOfMonthConvention
        :return: ComputeDatesResponse or ServiceErrorResponse. The ComputeDatesResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.ComputeDatesResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "tenor": "str",
                            "endDate": "2020-02-20",
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def compute_dates(
        self,
        calendar_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]:
        """Computes dates for the calendar according to specified conditions. Start Date is included in
        the calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ComputeDatesResponse or ServiceErrorResponse. The ComputeDatesResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.ComputeDatesResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "tenor": "str",
                            "endDate": "2020-02-20",
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def compute_dates(
        self,
        calendar_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        tenors: List[str] = _Unset,
        fields: Optional[str] = None,
        start_date: Optional[datetime.date] = None,
        date_moving_convention: Optional[Union[str, _models.DateMovingConvention]] = None,
        end_of_month_convention: Optional[Union[str, _models.EndOfMonthConvention]] = None,
        **kwargs: Any,
    ) -> Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]:
        """Computes dates for the calendar according to specified conditions. Start Date is included in
        the calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword tenors: Tenors to be added to startDate to calculate the resultant dates (e.g., 1M,
         1Y).
         A tenor expresses a period of time using a specific syntax. There are two kinds of tenor:


         * Ad-hoc tenors explicitly state the length of time in Days (D), Weeks (W), Months (M) and
         Years (Y).
           For example "1D" for one day, "2W" for two weeks or "3M1D" for three months and a day.
           When mixing units, units must be written in descending order of size (Y > M > W > D).  So,
         5M3D is valid, but 3D5M is not.
         * Common tenors are expressed as letter codes:
         * ON (Overnight) - A one business day period that starts today.
         * TN (Tomorrow-Next) - A one business day period that starts next business day.
         * SPOT (Spot Date) - A period that ends on the spot date.  Date is calculated as trade date
         (today) + days to spot.
         * SN (Spot-Next) - A one business day period that starts at the spot date.
         * SW (Spot-Week) - A one business week period that starts at the spot date. Required.
        :paramtype tenors: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Default is Today. Default value is None.
        :paramtype start_date: ~datetime.date
        :keyword date_moving_convention: The method to adjust dates to working days. The default value
         is ModifiedFollowing. Known values are: "ModifiedFollowing", "NextBusinessDay",
         "PreviousBusinessDay", "NoMoving", "EveryThirdWednesday", and "BbswModifiedFollowing". Default
         value is None.
        :paramtype date_moving_convention: str or ~analyticsapi.models.DateMovingConvention
        :keyword end_of_month_convention: Conventions to adjust payment dates when they fall at the end
         of a month. Known values are: "Last", "Same", "Last28", "Same28", and "Same1". Default value is
         None.
        :paramtype end_of_month_convention: str or ~analyticsapi.models.EndOfMonthConvention
        :return: ComputeDatesResponse or ServiceErrorResponse. The ComputeDatesResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.ComputeDatesResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "tenors": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "endOfMonthConvention": "str",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "tenor": "str",
                            "endDate": "2020-02-20",
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "processingInformation": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.ComputeDatesResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if tenors is _Unset:
                raise TypeError("missing required argument: tenors")
            body = {
                "dateMovingConvention": date_moving_convention,
                "endOfMonthConvention": end_of_month_convention,
                "startDate": start_date,
                "tenors": tenors,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendar_resource_compute_dates_request(
            calendar_id=calendar_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ComputeDatesResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def generate_date_schedule(
        self,
        calendar_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]:
        """Generates a date schedule for the calendar according to specified conditions. Start and End
        Dates are included in the calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: GenerateDateScheduleResponse or ServiceErrorResponse. The GenerateDateScheduleResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateDateScheduleResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "frequency": "str",
                    "calendarDayOfMonth": 0,
                    "count": 0,
                    "dayOfWeek": "str",
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        "2020-02-20"
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def generate_date_schedule(
        self,
        calendar_id: str,
        *,
        frequency: Union[str, _models.Frequency],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        start_date: Optional[datetime.date] = None,
        end_date: Optional[datetime.date] = None,
        calendar_day_of_month: Optional[int] = None,
        count: Optional[int] = None,
        day_of_week: Optional[Union[str, _models.WeekDay]] = None,
        **kwargs: Any,
    ) -> Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]:
        """Generates a date schedule for the calendar according to specified conditions. Start and End
        Dates are included in the calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :keyword frequency: The frequency of dates in the schedule which should be generated. Note that
         "Daily" refers to working days only. Known values are: "Daily", "Weekly", "BiWeekly",
         "Monthly", "Quarterly", and "Anually". Required.
        :paramtype frequency: str or ~analyticsapi.models.Frequency
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01).
         The start date must be less or equal to the end date.
         Required if endDate is in the past. Default value is None.
        :paramtype start_date: ~datetime.date
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01).
         If startDate is not specified, endDate is used to define the list of dates from today's date
         to the end date.
         The end date must be greater or equal to the start date.
         Required if count is not specified. Only one of endDate and count can be set at a time.
         Default value is None.
        :paramtype end_date: ~datetime.date
        :keyword calendar_day_of_month: The number of the day of the month. Required if frequency is
         Monthly; do not use otherwise. The minimum value is 1. The maximum value is 31. Default value
         is None.
        :paramtype calendar_day_of_month: int
        :keyword count: The number of dates to be generated,  counting from the start date (or today's
         date if the start day is not set) to the end date.
         It should not have a negative value.
         Required if endDate is not specified. Only one of endDate and count can be set at a time.
         Default value is None.
        :paramtype count: int
        :keyword day_of_week: The day of the week. Required if frequency is Weekly or BiWeekly; do not
         use otherwise. Known values are: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
         "Saturday", and "Sunday". Default value is None.
        :paramtype day_of_week: str or ~analyticsapi.models.WeekDay
        :return: GenerateDateScheduleResponse or ServiceErrorResponse. The GenerateDateScheduleResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateDateScheduleResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        "2020-02-20"
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def generate_date_schedule(
        self,
        calendar_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]:
        """Generates a date schedule for the calendar according to specified conditions. Start and End
        Dates are included in the calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: GenerateDateScheduleResponse or ServiceErrorResponse. The GenerateDateScheduleResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateDateScheduleResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        "2020-02-20"
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def generate_date_schedule(
        self,
        calendar_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        frequency: Union[str, _models.Frequency] = _Unset,
        fields: Optional[str] = None,
        start_date: Optional[datetime.date] = None,
        end_date: Optional[datetime.date] = None,
        calendar_day_of_month: Optional[int] = None,
        count: Optional[int] = None,
        day_of_week: Optional[Union[str, _models.WeekDay]] = None,
        **kwargs: Any,
    ) -> Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]:
        """Generates a date schedule for the calendar according to specified conditions. Start and End
        Dates are included in the calculation. Only saved calendars are supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword frequency: The frequency of dates in the schedule which should be generated. Note that
         "Daily" refers to working days only. Known values are: "Daily", "Weekly", "BiWeekly",
         "Monthly", "Quarterly", and "Anually". Required.
        :paramtype frequency: str or ~analyticsapi.models.Frequency
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01).
         The start date must be less or equal to the end date.
         Required if endDate is in the past. Default value is None.
        :paramtype start_date: ~datetime.date
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01).
         If startDate is not specified, endDate is used to define the list of dates from today's date
         to the end date.
         The end date must be greater or equal to the start date.
         Required if count is not specified. Only one of endDate and count can be set at a time.
         Default value is None.
        :paramtype end_date: ~datetime.date
        :keyword calendar_day_of_month: The number of the day of the month. Required if frequency is
         Monthly; do not use otherwise. The minimum value is 1. The maximum value is 31. Default value
         is None.
        :paramtype calendar_day_of_month: int
        :keyword count: The number of dates to be generated,  counting from the start date (or today's
         date if the start day is not set) to the end date.
         It should not have a negative value.
         Required if endDate is not specified. Only one of endDate and count can be set at a time.
         Default value is None.
        :paramtype count: int
        :keyword day_of_week: The day of the week. Required if frequency is Weekly or BiWeekly; do not
         use otherwise. Known values are: "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
         "Saturday", and "Sunday". Default value is None.
        :paramtype day_of_week: str or ~analyticsapi.models.WeekDay
        :return: GenerateDateScheduleResponse or ServiceErrorResponse. The GenerateDateScheduleResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.GenerateDateScheduleResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "frequency": "str",
                    "calendarDayOfMonth": 0,
                    "count": 0,
                    "dayOfWeek": "str",
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20"
                }

                # response body for status code(s): 200
                response == {
                    "data": [
                        "2020-02-20"
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.GenerateDateScheduleResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            if frequency is _Unset:
                raise TypeError("missing required argument: frequency")
            body = {
                "calendarDayOfMonth": calendar_day_of_month,
                "count": count,
                "dayOfWeek": day_of_week,
                "endDate": end_date,
                "frequency": frequency,
                "startDate": start_date,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendar_resource_generate_date_schedule_request(
            calendar_id=calendar_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.GenerateDateScheduleResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def count_periods(
        self,
        calendar_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]:
        """Counts the time periods that satisfy specified conditions. Note the use of date strings for
        convenience. Start and End Dates are included in the calculation. Only saved calendars are
        supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: CountPeriodsResponse or ServiceErrorResponse. The CountPeriodsResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.CountPeriodsResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20",
                    "dayCountBasis": "str",
                    "periodType": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "count": 0.0,
                        "periodType": "str",
                        "processingInformation": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def count_periods(
        self,
        calendar_id: str,
        *,
        start_date: datetime.date,
        end_date: datetime.date,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        day_count_basis: Optional[Union[str, _models.DayCountBasis]] = None,
        period_type: Optional[Union[str, _models.PeriodType]] = None,
        **kwargs: Any,
    ) -> Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]:
        """Counts the time periods that satisfy specified conditions. Note the use of date strings for
        convenience. Start and End Dates are included in the calculation. Only saved calendars are
        supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Required.
        :paramtype start_date: ~datetime.date
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01). Required.
        :paramtype end_date: ~datetime.date
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword day_count_basis: The day count basis convention used to calculate the period between
         two dates.
         It is used when periodType is set to Year.
         Each convention defines the number of days between two dates and the year length in days
         (basis) for the period calculation.
         Default is DCB_ACTUAL_ACTUAL. Known values are: "Dcb_30_360", "Dcb_30_360_US",
         "Dcb_30_360_German", "Dcb_30_360_ISDA", "Dcb_30_365_ISDA", "Dcb_30_365_German",
         "Dcb_30_365_Brazil", "Dcb_30_Actual_German", "Dcb_30_Actual", "Dcb_30_Actual_ISDA",
         "Dcb_30E_360_ISMA", "Dcb_Actual_360", "Dcb_Actual_364", "Dcb_Actual_365", "Dcb_Actual_Actual",
         "Dcb_Actual_Actual_ISDA", "Dcb_Actual_Actual_AFB", "Dcb_WorkingDays_252", "Dcb_Actual_365L",
         "Dcb_Actual_365P", "Dcb_ActualLeapDay_365", "Dcb_ActualLeapDay_360", "Dcb_Actual_36525", and
         "Dcb_Actual_365_CanadianConvention". Default value is None.
        :paramtype day_count_basis: str or ~analyticsapi.models.DayCountBasis
        :keyword period_type: The method of the period calculation. Default is Day. Known values are:
         "WorkingDay", "NonWorkingDay", "Day", "Week", "Month", "Quarter", and "Year". Default value is
         None.
        :paramtype period_type: str or ~analyticsapi.models.PeriodType
        :return: CountPeriodsResponse or ServiceErrorResponse. The CountPeriodsResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.CountPeriodsResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "count": 0.0,
                        "periodType": "str",
                        "processingInformation": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def count_periods(
        self,
        calendar_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]:
        """Counts the time periods that satisfy specified conditions. Note the use of date strings for
        convenience. Start and End Dates are included in the calculation. Only saved calendars are
        supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: CountPeriodsResponse or ServiceErrorResponse. The CountPeriodsResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.CountPeriodsResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "count": 0.0,
                        "periodType": "str",
                        "processingInformation": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def count_periods(
        self,
        calendar_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        start_date: datetime.date = _Unset,
        end_date: datetime.date = _Unset,
        fields: Optional[str] = None,
        day_count_basis: Optional[Union[str, _models.DayCountBasis]] = None,
        period_type: Optional[Union[str, _models.PeriodType]] = None,
        **kwargs: Any,
    ) -> Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]:
        """Counts the time periods that satisfy specified conditions. Note the use of date strings for
        convenience. Start and End Dates are included in the calculation. Only saved calendars are
        supported.

        :param calendar_id: Required.
        :type calendar_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword start_date: The start date of the calculation. The value is expressed in ISO 8601
         format: YYYY-MM-DD (e.g., 2023-01-01). Required.
        :paramtype start_date: ~datetime.date
        :keyword end_date: The end date of the calculation. The value is expressed in ISO 8601 format:
         YYYY-MM-DD (e.g., 2024-01-01). Required.
        :paramtype end_date: ~datetime.date
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword day_count_basis: The day count basis convention used to calculate the period between
         two dates.
         It is used when periodType is set to Year.
         Each convention defines the number of days between two dates and the year length in days
         (basis) for the period calculation.
         Default is DCB_ACTUAL_ACTUAL. Known values are: "Dcb_30_360", "Dcb_30_360_US",
         "Dcb_30_360_German", "Dcb_30_360_ISDA", "Dcb_30_365_ISDA", "Dcb_30_365_German",
         "Dcb_30_365_Brazil", "Dcb_30_Actual_German", "Dcb_30_Actual", "Dcb_30_Actual_ISDA",
         "Dcb_30E_360_ISMA", "Dcb_Actual_360", "Dcb_Actual_364", "Dcb_Actual_365", "Dcb_Actual_Actual",
         "Dcb_Actual_Actual_ISDA", "Dcb_Actual_Actual_AFB", "Dcb_WorkingDays_252", "Dcb_Actual_365L",
         "Dcb_Actual_365P", "Dcb_ActualLeapDay_365", "Dcb_ActualLeapDay_360", "Dcb_Actual_36525", and
         "Dcb_Actual_365_CanadianConvention". Default value is None.
        :paramtype day_count_basis: str or ~analyticsapi.models.DayCountBasis
        :keyword period_type: The method of the period calculation. Default is Day. Known values are:
         "WorkingDay", "NonWorkingDay", "Day", "Week", "Month", "Quarter", and "Year". Default value is
         None.
        :paramtype period_type: str or ~analyticsapi.models.PeriodType
        :return: CountPeriodsResponse or ServiceErrorResponse. The CountPeriodsResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.CountPeriodsResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "endDate": "2020-02-20",
                    "startDate": "2020-02-20",
                    "dayCountBasis": "str",
                    "periodType": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "count": 0.0,
                        "periodType": "str",
                        "processingInformation": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.CountPeriodsResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if start_date is _Unset:
                raise TypeError("missing required argument: start_date")
            if end_date is _Unset:
                raise TypeError("missing required argument: end_date")
            body = {
                "dayCountBasis": day_count_basis,
                "endDate": end_date,
                "periodType": period_type,
                "startDate": start_date,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_calendar_resource_count_periods_request(
            calendar_id=calendar_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.CountPeriodsResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class fxForwardCurvesResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`fx_forward_curves_resource` attribute.
    """

    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")

    async def list(
        self,
        *,
        item_per_page: Optional[int] = None,
        page: Optional[int] = None,
        spaces: Optional[List[str]] = None,
        names: Optional[List[str]] = None,
        space_name_sort_order: Optional[Union[str, _models.SortingOrderEnum]] = None,
        tags: Optional[List[str]] = None,
        fields: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveCollectionResponse, _models.ServiceErrorResponse]:
        """List the FxForwardCurves existing in the platform (depending on permissions).

        :keyword item_per_page: A parameter used to select the number of items allowed per page. The
         valid range is 1-500. If not provided, 50 will be used. Default value is None.
        :paramtype item_per_page: int
        :keyword page: A parameter used to define the page number to display. Default value is None.
        :paramtype page: int
        :keyword spaces: A parameter used to search for platform resources stored in a given space.
         Space is like a namespace where resources are stored. By default there are two spaces:
         LSEG is reserved for LSEG maintained resources, HOME is reserved for user's default space.
         If space is not specified, it will search within all spaces. Default value is None.
        :paramtype spaces: list[str]
        :keyword names: A parameter used to search for platform resources with given names. Default
         value is None.
        :paramtype names: list[str]
        :keyword space_name_sort_order: A parameter used to sort platform resources by name based on a
         defined order. Known values are: "Asc" and "Desc". Default value is None.
        :paramtype space_name_sort_order: str or ~analyticsapi.models.SortingOrderEnum
        :keyword tags: A parameter used to search for platform resources with given tags. Default value
         is None.
        :paramtype tags: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: FxForwardCurveCollectionResponse or ServiceErrorResponse. The
         FxForwardCurveCollectionResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCollectionResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.FxForwardCurveCollectionResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        _request = build_fx_forward_curves_resource_list_request(
            item_per_page=item_per_page,
            page=page,
            spaces=spaces,
            names=names,
            space_name_sort_order=space_name_sort_order,
            tags=tags,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardCurveCollectionResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create(
        self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        """Save a new FxForwardCurve in the platform.

        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self,
        *,
        location: _models.Location,
        definition: _models.FxForwardCurveDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        """Save a new FxForwardCurve in the platform.

        :keyword location: Object defining the location of the FxForwardCurve in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxForwardCurve. Required.
        :paramtype definition: ~analyticsapi.models.FxForwardCurveDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the FxForwardCurve. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        """Save a new FxForwardCurve in the platform.

        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.FxForwardCurveDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        """Save a new FxForwardCurve in the platform.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the FxForwardCurve in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxForwardCurve. Required.
        :paramtype definition: ~analyticsapi.models.FxForwardCurveDefinition
        :keyword description: Object defining metadata for the FxForwardCurve. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_curves_resource_create_request(
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            201,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 201:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardCurveResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def build_from_fx_forwards(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.BuildResponse, _models.ServiceErrorResponse]:
        """The request used to build a curve from FxSpot and FxForward constituents when the
        cross-currency quotation can be derived via a reference currency.
        For example, if a reference currency is specified, available constituents are returned for each
        currency in the pair against the reference (e.g., EURGBP via EURUSD and GBPUSD).
        If the reference currency is one of the pair, only constituents for that pair are returned; if
        not specified, the first currency of the pair is used as the reference.
        The output tenors depend on the construction path; by default, market-contributed tenors are
        returned.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: BuildResponse or ServiceErrorResponse. The BuildResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.BuildResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "crossCurrency": "str",
                    "additionalTenorTypes": [
                        "str"
                    ],
                    "referenceCurrency": "str",
                    "sources": {
                        "baseFxForwards": "str",
                        "baseFxSpot": "str",
                        "quotedFxForwards": "str",
                        "quotedFxSpot": "str"
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def build_from_fx_forwards(
        self,
        *,
        cross_currency: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        reference_currency: Optional[str] = None,
        additional_tenor_types: Optional[List[Union[str, _models.TenorType]]] = None,
        sources: Optional[_models.IndirectSourcesSwaps] = None,
        **kwargs: Any,
    ) -> Union[_models.BuildResponse, _models.ServiceErrorResponse]:
        """The request used to build a curve from FxSpot and FxForward constituents when the
        cross-currency quotation can be derived via a reference currency.
        For example, if a reference currency is specified, available constituents are returned for each
        currency in the pair against the reference (e.g., EURGBP via EURUSD and GBPUSD).
        If the reference currency is one of the pair, only constituents for that pair are returned; if
        not specified, the first currency of the pair is used as the reference.
        The output tenors depend on the construction path; by default, market-contributed tenors are
        returned.

        :keyword cross_currency: A string to define the cross currency pair of the curve, expressed in
         ISO 4217 alphabetical format (e.g., 'EURCHF'). Maximum of 6 characters. Required.
        :paramtype cross_currency: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword reference_currency: A string to define the reference currency for the cross-currency
         pair of the curve, expressed in ISO 4217 alphabetical format (e.g., 'EUR'). Maximum of 3
         characters. Default is the base currency of the specified cross currency pair. Default value is
         None.
        :paramtype reference_currency: str
        :keyword additional_tenor_types: An array of tenor types that can be used for instruments, in
         addition to the standard tenor. When passing a string value, it must be one of the TenorType
         types. Default value is None.
        :paramtype additional_tenor_types: list[str or ~analyticsapi.models.TenorType]
        :keyword sources: An object that defines the sources containing the market data for the
         instruments used to create the curve definition. It will return from all the accessible sources
         if not specified. Default value is None.
        :paramtype sources: ~analyticsapi.models.IndirectSourcesSwaps
        :return: BuildResponse or ServiceErrorResponse. The BuildResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.BuildResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def build_from_fx_forwards(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.BuildResponse, _models.ServiceErrorResponse]:
        """The request used to build a curve from FxSpot and FxForward constituents when the
        cross-currency quotation can be derived via a reference currency.
        For example, if a reference currency is specified, available constituents are returned for each
        currency in the pair against the reference (e.g., EURGBP via EURUSD and GBPUSD).
        If the reference currency is one of the pair, only constituents for that pair are returned; if
        not specified, the first currency of the pair is used as the reference.
        The output tenors depend on the construction path; by default, market-contributed tenors are
        returned.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: BuildResponse or ServiceErrorResponse. The BuildResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.BuildResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def build_from_fx_forwards(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        cross_currency: str = _Unset,
        fields: Optional[str] = None,
        reference_currency: Optional[str] = None,
        additional_tenor_types: Optional[List[Union[str, _models.TenorType]]] = None,
        sources: Optional[_models.IndirectSourcesSwaps] = None,
        **kwargs: Any,
    ) -> Union[_models.BuildResponse, _models.ServiceErrorResponse]:
        """The request used to build a curve from FxSpot and FxForward constituents when the
        cross-currency quotation can be derived via a reference currency.
        For example, if a reference currency is specified, available constituents are returned for each
        currency in the pair against the reference (e.g., EURGBP via EURUSD and GBPUSD).
        If the reference currency is one of the pair, only constituents for that pair are returned; if
        not specified, the first currency of the pair is used as the reference.
        The output tenors depend on the construction path; by default, market-contributed tenors are
        returned.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword cross_currency: A string to define the cross currency pair of the curve, expressed in
         ISO 4217 alphabetical format (e.g., 'EURCHF'). Maximum of 6 characters. Required.
        :paramtype cross_currency: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword reference_currency: A string to define the reference currency for the cross-currency
         pair of the curve, expressed in ISO 4217 alphabetical format (e.g., 'EUR'). Maximum of 3
         characters. Default is the base currency of the specified cross currency pair. Default value is
         None.
        :paramtype reference_currency: str
        :keyword additional_tenor_types: An array of tenor types that can be used for instruments, in
         addition to the standard tenor. When passing a string value, it must be one of the TenorType
         types. Default value is None.
        :paramtype additional_tenor_types: list[str or ~analyticsapi.models.TenorType]
        :keyword sources: An object that defines the sources containing the market data for the
         instruments used to create the curve definition. It will return from all the accessible sources
         if not specified. Default value is None.
        :paramtype sources: ~analyticsapi.models.IndirectSourcesSwaps
        :return: BuildResponse or ServiceErrorResponse. The BuildResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.BuildResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "crossCurrency": "str",
                    "additionalTenorTypes": [
                        "str"
                    ],
                    "referenceCurrency": "str",
                    "sources": {
                        "baseFxForwards": "str",
                        "baseFxSpot": "str",
                        "quotedFxForwards": "str",
                        "quotedFxSpot": "str"
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.BuildResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if cross_currency is _Unset:
                raise TypeError("missing required argument: cross_currency")
            body = {
                "additionalTenorTypes": additional_tenor_types,
                "crossCurrency": cross_currency,
                "referenceCurrency": reference_currency,
                "sources": sources,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_curves_resource_build_from_fx_forwards_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.BuildResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def build_from_deposits(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.BuildResponse, _models.ServiceErrorResponse]:
        """The request used to build a curve from FxSpot and Deposit constituents when the cross-currency
        quotation can be derived via a reference currency.
        For example, if a reference currency is specified, available FxSpot constituents are returned
        for each currency in the pair against the reference (e.g., EURGBP via EURUSD and GBPUSD).
        If the reference currency is one of the pair, only constituents for that pair are returned; if
        not specified, the first currency of the pair is used as the reference.
        Available Deposit constituents are returned for each currency of the pair.
        The output tenors depend on the construction path; by default, market-contributed tenors are
        returned.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: BuildResponse or ServiceErrorResponse. The BuildResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.BuildResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "crossCurrency": "str",
                    "additionalTenorTypes": [
                        "str"
                    ],
                    "referenceCurrency": "str",
                    "sources": {
                        "baseDeposit": "str",
                        "baseFxSpot": "str",
                        "quotedDeposit": "str",
                        "quotedFxSpot": "str"
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def build_from_deposits(
        self,
        *,
        cross_currency: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        reference_currency: Optional[str] = None,
        additional_tenor_types: Optional[List[Union[str, _models.TenorType]]] = None,
        sources: Optional[_models.IndirectSourcesDeposits] = None,
        **kwargs: Any,
    ) -> Union[_models.BuildResponse, _models.ServiceErrorResponse]:
        """The request used to build a curve from FxSpot and Deposit constituents when the cross-currency
        quotation can be derived via a reference currency.
        For example, if a reference currency is specified, available FxSpot constituents are returned
        for each currency in the pair against the reference (e.g., EURGBP via EURUSD and GBPUSD).
        If the reference currency is one of the pair, only constituents for that pair are returned; if
        not specified, the first currency of the pair is used as the reference.
        Available Deposit constituents are returned for each currency of the pair.
        The output tenors depend on the construction path; by default, market-contributed tenors are
        returned.

        :keyword cross_currency: A string to define the cross currency pair of the curve, expressed in
         ISO 4217 alphabetical format (e.g., 'EURCHF'). Maximum of 6 characters. Required.
        :paramtype cross_currency: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword reference_currency: A string to define the reference currency for the cross-currency
         pair of the curve, expressed in ISO 4217 alphabetical format (e.g., 'EUR'). Maximum of 3
         characters. Default is the base currency of the specified cross currency pair. Default value is
         None.
        :paramtype reference_currency: str
        :keyword additional_tenor_types: An array of tenor types that can be used for instruments, in
         addition to the standard tenor. When passing a string value, it must be one of the TenorType
         values. Default value is None.
        :paramtype additional_tenor_types: list[str or ~analyticsapi.models.TenorType]
        :keyword sources: An object that defines the sources containing the market data for the
         instruments used to create the curve definition. Default value is None.
        :paramtype sources: ~analyticsapi.models.IndirectSourcesDeposits
        :return: BuildResponse or ServiceErrorResponse. The BuildResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.BuildResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def build_from_deposits(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.BuildResponse, _models.ServiceErrorResponse]:
        """The request used to build a curve from FxSpot and Deposit constituents when the cross-currency
        quotation can be derived via a reference currency.
        For example, if a reference currency is specified, available FxSpot constituents are returned
        for each currency in the pair against the reference (e.g., EURGBP via EURUSD and GBPUSD).
        If the reference currency is one of the pair, only constituents for that pair are returned; if
        not specified, the first currency of the pair is used as the reference.
        Available Deposit constituents are returned for each currency of the pair.
        The output tenors depend on the construction path; by default, market-contributed tenors are
        returned.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: BuildResponse or ServiceErrorResponse. The BuildResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.BuildResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def build_from_deposits(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        cross_currency: str = _Unset,
        fields: Optional[str] = None,
        reference_currency: Optional[str] = None,
        additional_tenor_types: Optional[List[Union[str, _models.TenorType]]] = None,
        sources: Optional[_models.IndirectSourcesDeposits] = None,
        **kwargs: Any,
    ) -> Union[_models.BuildResponse, _models.ServiceErrorResponse]:
        """The request used to build a curve from FxSpot and Deposit constituents when the cross-currency
        quotation can be derived via a reference currency.
        For example, if a reference currency is specified, available FxSpot constituents are returned
        for each currency in the pair against the reference (e.g., EURGBP via EURUSD and GBPUSD).
        If the reference currency is one of the pair, only constituents for that pair are returned; if
        not specified, the first currency of the pair is used as the reference.
        Available Deposit constituents are returned for each currency of the pair.
        The output tenors depend on the construction path; by default, market-contributed tenors are
        returned.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword cross_currency: A string to define the cross currency pair of the curve, expressed in
         ISO 4217 alphabetical format (e.g., 'EURCHF'). Maximum of 6 characters. Required.
        :paramtype cross_currency: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword reference_currency: A string to define the reference currency for the cross-currency
         pair of the curve, expressed in ISO 4217 alphabetical format (e.g., 'EUR'). Maximum of 3
         characters. Default is the base currency of the specified cross currency pair. Default value is
         None.
        :paramtype reference_currency: str
        :keyword additional_tenor_types: An array of tenor types that can be used for instruments, in
         addition to the standard tenor. When passing a string value, it must be one of the TenorType
         values. Default value is None.
        :paramtype additional_tenor_types: list[str or ~analyticsapi.models.TenorType]
        :keyword sources: An object that defines the sources containing the market data for the
         instruments used to create the curve definition. Default value is None.
        :paramtype sources: ~analyticsapi.models.IndirectSourcesDeposits
        :return: BuildResponse or ServiceErrorResponse. The BuildResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.BuildResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "crossCurrency": "str",
                    "additionalTenorTypes": [
                        "str"
                    ],
                    "referenceCurrency": "str",
                    "sources": {
                        "baseDeposit": "str",
                        "baseFxSpot": "str",
                        "quotedDeposit": "str",
                        "quotedFxSpot": "str"
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.BuildResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if cross_currency is _Unset:
                raise TypeError("missing required argument: cross_currency")
            body = {
                "additionalTenorTypes": additional_tenor_types,
                "crossCurrency": cross_currency,
                "referenceCurrency": reference_currency,
                "sources": sources,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_curves_resource_build_from_deposits_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.BuildResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def calculate(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardCurveCalculateArrayResponse, _models.ServiceErrorResponse]:
        """Calculate fx forward curve points from curve constituents - on the fly.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardCurveCalculateArrayResponse or ServiceErrorResponse. The
         FxForwardCurveCalculateArrayResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCalculateArrayResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "crossCurrency": "str",
                                "constituents": [
                                    fx_constituent
                                ],
                                "referenceCurrency": "str"
                            },
                            "reference": "str"
                        }
                    ],
                    "pricingPreferences": {
                        "curveTenors": [
                            "str"
                        ],
                        "fxForwardCurveCalculationPreferences": {
                            "extrapolationMode": "str",
                            "ignoreInvalidInstruments": bool,
                            "ignorePivotCurrencyHolidays": bool,
                            "interpolationMode": "str",
                            "useDelayedDataIfDenied": bool
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "outrightCurve": {
                                    "crossCurrency": "str",
                                    "curveType": "str",
                                    "points": [
                                        {
                                            "endDate": "2020-02-20",
                                            "outright": {
                                                "ask": 0.0,
                                                "bid": 0.0,
                                                "mid": 0.0
                                            },
                                            "startDate": "2020-02-20",
                                            "tenor": "str",
                                            "instruments": [
                                                {
                                                    "instrumentCode": "str"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "constituents": [
                                    fx_constituent
                                ],
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "invalidConstituents": [
                                    fx_constituent
                                ],
                                "underlyingCurves": [
                                    curve
                                ]
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "crossCurrency": "str",
                                    "constituents": [
                                        fx_constituent
                                    ],
                                    "referenceCurrency": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "pricingPreferences": {
                            "curveTenors": [
                                "str"
                            ],
                            "fxForwardCurveCalculationPreferences": {
                                "extrapolationMode": "str",
                                "ignoreInvalidInstruments": bool,
                                "ignorePivotCurrencyHolidays": bool,
                                "interpolationMode": "str",
                                "useDelayedDataIfDenied": bool
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def calculate(
        self,
        *,
        definitions: List[_models.FxForwardCurveDefinitionInstrument],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxForwardCurveCalculationParameters] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveCalculateArrayResponse, _models.ServiceErrorResponse]:
        """Calculate fx forward curve points from curve constituents - on the fly.

        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxForwardCurveDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxForwardCurveCalculationParameters
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardCurveCalculateArrayResponse or ServiceErrorResponse. The
         FxForwardCurveCalculateArrayResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCalculateArrayResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "outrightCurve": {
                                    "crossCurrency": "str",
                                    "curveType": "str",
                                    "points": [
                                        {
                                            "endDate": "2020-02-20",
                                            "outright": {
                                                "ask": 0.0,
                                                "bid": 0.0,
                                                "mid": 0.0
                                            },
                                            "startDate": "2020-02-20",
                                            "tenor": "str",
                                            "instruments": [
                                                {
                                                    "instrumentCode": "str"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "constituents": [
                                    fx_constituent
                                ],
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "invalidConstituents": [
                                    fx_constituent
                                ],
                                "underlyingCurves": [
                                    curve
                                ]
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "crossCurrency": "str",
                                    "constituents": [
                                        fx_constituent
                                    ],
                                    "referenceCurrency": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "pricingPreferences": {
                            "curveTenors": [
                                "str"
                            ],
                            "fxForwardCurveCalculationPreferences": {
                                "extrapolationMode": "str",
                                "ignoreInvalidInstruments": bool,
                                "ignorePivotCurrencyHolidays": bool,
                                "interpolationMode": "str",
                                "useDelayedDataIfDenied": bool
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def calculate(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardCurveCalculateArrayResponse, _models.ServiceErrorResponse]:
        """Calculate fx forward curve points from curve constituents - on the fly.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardCurveCalculateArrayResponse or ServiceErrorResponse. The
         FxForwardCurveCalculateArrayResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCalculateArrayResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "outrightCurve": {
                                    "crossCurrency": "str",
                                    "curveType": "str",
                                    "points": [
                                        {
                                            "endDate": "2020-02-20",
                                            "outright": {
                                                "ask": 0.0,
                                                "bid": 0.0,
                                                "mid": 0.0
                                            },
                                            "startDate": "2020-02-20",
                                            "tenor": "str",
                                            "instruments": [
                                                {
                                                    "instrumentCode": "str"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "constituents": [
                                    fx_constituent
                                ],
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "invalidConstituents": [
                                    fx_constituent
                                ],
                                "underlyingCurves": [
                                    curve
                                ]
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "crossCurrency": "str",
                                    "constituents": [
                                        fx_constituent
                                    ],
                                    "referenceCurrency": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "pricingPreferences": {
                            "curveTenors": [
                                "str"
                            ],
                            "fxForwardCurveCalculationPreferences": {
                                "extrapolationMode": "str",
                                "ignoreInvalidInstruments": bool,
                                "ignorePivotCurrencyHolidays": bool,
                                "interpolationMode": "str",
                                "useDelayedDataIfDenied": bool
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def calculate(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        definitions: List[_models.FxForwardCurveDefinitionInstrument] = _Unset,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxForwardCurveCalculationParameters] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveCalculateArrayResponse, _models.ServiceErrorResponse]:
        """Calculate fx forward curve points from curve constituents - on the fly.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxForwardCurveDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxForwardCurveCalculationParameters
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardCurveCalculateArrayResponse or ServiceErrorResponse. The
         FxForwardCurveCalculateArrayResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCalculateArrayResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "crossCurrency": "str",
                                "constituents": [
                                    fx_constituent
                                ],
                                "referenceCurrency": "str"
                            },
                            "reference": "str"
                        }
                    ],
                    "pricingPreferences": {
                        "curveTenors": [
                            "str"
                        ],
                        "fxForwardCurveCalculationPreferences": {
                            "extrapolationMode": "str",
                            "ignoreInvalidInstruments": bool,
                            "ignorePivotCurrencyHolidays": bool,
                            "interpolationMode": "str",
                            "useDelayedDataIfDenied": bool
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "outrightCurve": {
                                    "crossCurrency": "str",
                                    "curveType": "str",
                                    "points": [
                                        {
                                            "endDate": "2020-02-20",
                                            "outright": {
                                                "ask": 0.0,
                                                "bid": 0.0,
                                                "mid": 0.0
                                            },
                                            "startDate": "2020-02-20",
                                            "tenor": "str",
                                            "instruments": [
                                                {
                                                    "instrumentCode": "str"
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "constituents": [
                                    fx_constituent
                                ],
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "invalidConstituents": [
                                    fx_constituent
                                ],
                                "underlyingCurves": [
                                    curve
                                ]
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "crossCurrency": "str",
                                    "constituents": [
                                        fx_constituent
                                    ],
                                    "referenceCurrency": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "pricingPreferences": {
                            "curveTenors": [
                                "str"
                            ],
                            "fxForwardCurveCalculationPreferences": {
                                "extrapolationMode": "str",
                                "ignoreInvalidInstruments": bool,
                                "ignorePivotCurrencyHolidays": bool,
                                "interpolationMode": "str",
                                "useDelayedDataIfDenied": bool
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardCurveCalculateArrayResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            if definitions is _Unset:
                raise TypeError("missing required argument: definitions")
            body = {
                "definitions": definitions,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_curves_resource_calculate_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardCurveCalculateArrayResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class fxForwardCurveResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`fx_forward_curve_resource` attribute.
    """

    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")

    async def read(
        self, curve_id: str, *, fields: Optional[str] = None, **kwargs: Any
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        """Access a FxForwardCurve existing in the platform (read).

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.FxForwardCurveResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_fx_forward_curve_resource_read_request(
            curve_id=curve_id,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardCurveResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def delete(self, curve_id: str, **kwargs: Any) -> Optional[_models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Delete a FxForwardCurve that exists in the platform.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :return: ServiceErrorResponse or None. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.ServiceErrorResponse or None
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_fx_forward_curve_resource_delete_request(
            curve_id=curve_id,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            204,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        deserialized = None
        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def overwrite(
        self, curve_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxForwardCurve that exists in the platform.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self,
        curve_id: str,
        *,
        location: _models.Location,
        definition: _models.FxForwardCurveDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxForwardCurve that exists in the platform.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :keyword location: Object defining the location of the FxForwardCurve in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxForwardCurve. Required.
        :paramtype definition: ~analyticsapi.models.FxForwardCurveDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the FxForwardCurve. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self, curve_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxForwardCurve that exists in the platform.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def overwrite(
        self,
        curve_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.FxForwardCurveDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxForwardCurve that exists in the platform.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the FxForwardCurve in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxForwardCurve. Required.
        :paramtype definition: ~analyticsapi.models.FxForwardCurveDefinition
        :keyword description: Object defining metadata for the FxForwardCurve. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxForwardCurveResponse or ServiceErrorResponse. The FxForwardCurveResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "crossCurrency": "str",
                        "constituents": [
                            fx_constituent
                        ],
                        "referenceCurrency": "str"
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "crossCurrency": "str",
                            "constituents": [
                                fx_constituent
                            ],
                            "referenceCurrency": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardCurveResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_curve_resource_overwrite_request(
            curve_id=curve_id,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardCurveResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def calculate(
        self,
        curve_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveCalculateResponse, _models.ServiceErrorResponse]:
        """Calculate fx forward curve points from curve definition.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardCurveCalculateResponse or ServiceErrorResponse. The
         FxForwardCurveCalculateResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCalculateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "pricingPreferences": {
                        "curveTenors": [
                            "str"
                        ],
                        "fxForwardCurveCalculationPreferences": {
                            "extrapolationMode": "str",
                            "ignoreInvalidInstruments": bool,
                            "ignorePivotCurrencyHolidays": bool,
                            "interpolationMode": "str",
                            "useDelayedDataIfDenied": bool
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "outrightCurve": {
                                "crossCurrency": "str",
                                "curveType": "str",
                                "points": [
                                    {
                                        "endDate": "2020-02-20",
                                        "outright": {
                                            "ask": 0.0,
                                            "bid": 0.0,
                                            "mid": 0.0
                                        },
                                        "startDate": "2020-02-20",
                                        "tenor": "str",
                                        "instruments": [
                                            {
                                                "instrumentCode": "str"
                                            }
                                        ]
                                    }
                                ]
                            },
                            "constituents": [
                                fx_constituent
                            ],
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "invalidConstituents": [
                                fx_constituent
                            ],
                            "underlyingCurves": [
                                curve
                            ]
                        },
                        "pricingPreferences": {
                            "curveTenors": [
                                "str"
                            ],
                            "fxForwardCurveCalculationPreferences": {
                                "extrapolationMode": "str",
                                "ignoreInvalidInstruments": bool,
                                "ignorePivotCurrencyHolidays": bool,
                                "interpolationMode": "str",
                                "useDelayedDataIfDenied": bool
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "crossCurrency": "str",
                                "constituents": [
                                    fx_constituent
                                ],
                                "referenceCurrency": "str"
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def calculate(
        self,
        curve_id: str,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxForwardCurveCalculationParameters] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveCalculateResponse, _models.ServiceErrorResponse]:
        """Calculate fx forward curve points from curve definition.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxForwardCurveCalculationParameters
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardCurveCalculateResponse or ServiceErrorResponse. The
         FxForwardCurveCalculateResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCalculateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "outrightCurve": {
                                "crossCurrency": "str",
                                "curveType": "str",
                                "points": [
                                    {
                                        "endDate": "2020-02-20",
                                        "outright": {
                                            "ask": 0.0,
                                            "bid": 0.0,
                                            "mid": 0.0
                                        },
                                        "startDate": "2020-02-20",
                                        "tenor": "str",
                                        "instruments": [
                                            {
                                                "instrumentCode": "str"
                                            }
                                        ]
                                    }
                                ]
                            },
                            "constituents": [
                                fx_constituent
                            ],
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "invalidConstituents": [
                                fx_constituent
                            ],
                            "underlyingCurves": [
                                curve
                            ]
                        },
                        "pricingPreferences": {
                            "curveTenors": [
                                "str"
                            ],
                            "fxForwardCurveCalculationPreferences": {
                                "extrapolationMode": "str",
                                "ignoreInvalidInstruments": bool,
                                "ignorePivotCurrencyHolidays": bool,
                                "interpolationMode": "str",
                                "useDelayedDataIfDenied": bool
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "crossCurrency": "str",
                                "constituents": [
                                    fx_constituent
                                ],
                                "referenceCurrency": "str"
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def calculate(
        self,
        curve_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveCalculateResponse, _models.ServiceErrorResponse]:
        """Calculate fx forward curve points from curve definition.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardCurveCalculateResponse or ServiceErrorResponse. The
         FxForwardCurveCalculateResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCalculateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "outrightCurve": {
                                "crossCurrency": "str",
                                "curveType": "str",
                                "points": [
                                    {
                                        "endDate": "2020-02-20",
                                        "outright": {
                                            "ask": 0.0,
                                            "bid": 0.0,
                                            "mid": 0.0
                                        },
                                        "startDate": "2020-02-20",
                                        "tenor": "str",
                                        "instruments": [
                                            {
                                                "instrumentCode": "str"
                                            }
                                        ]
                                    }
                                ]
                            },
                            "constituents": [
                                fx_constituent
                            ],
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "invalidConstituents": [
                                fx_constituent
                            ],
                            "underlyingCurves": [
                                curve
                            ]
                        },
                        "pricingPreferences": {
                            "curveTenors": [
                                "str"
                            ],
                            "fxForwardCurveCalculationPreferences": {
                                "extrapolationMode": "str",
                                "ignoreInvalidInstruments": bool,
                                "ignorePivotCurrencyHolidays": bool,
                                "interpolationMode": "str",
                                "useDelayedDataIfDenied": bool
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "crossCurrency": "str",
                                "constituents": [
                                    fx_constituent
                                ],
                                "referenceCurrency": "str"
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def calculate(
        self,
        curve_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxForwardCurveCalculationParameters] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCurveCalculateResponse, _models.ServiceErrorResponse]:
        """Calculate fx forward curve points from curve definition.

        :param curve_id: The curve identifier. Required.
        :type curve_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxForwardCurveCalculationParameters
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardCurveCalculateResponse or ServiceErrorResponse. The
         FxForwardCurveCalculateResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCurveCalculateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "pricingPreferences": {
                        "curveTenors": [
                            "str"
                        ],
                        "fxForwardCurveCalculationPreferences": {
                            "extrapolationMode": "str",
                            "ignoreInvalidInstruments": bool,
                            "ignorePivotCurrencyHolidays": bool,
                            "interpolationMode": "str",
                            "useDelayedDataIfDenied": bool
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "outrightCurve": {
                                "crossCurrency": "str",
                                "curveType": "str",
                                "points": [
                                    {
                                        "endDate": "2020-02-20",
                                        "outright": {
                                            "ask": 0.0,
                                            "bid": 0.0,
                                            "mid": 0.0
                                        },
                                        "startDate": "2020-02-20",
                                        "tenor": "str",
                                        "instruments": [
                                            {
                                                "instrumentCode": "str"
                                            }
                                        ]
                                    }
                                ]
                            },
                            "constituents": [
                                fx_constituent
                            ],
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "invalidConstituents": [
                                fx_constituent
                            ],
                            "underlyingCurves": [
                                curve
                            ]
                        },
                        "pricingPreferences": {
                            "curveTenors": [
                                "str"
                            ],
                            "fxForwardCurveCalculationPreferences": {
                                "extrapolationMode": "str",
                                "ignoreInvalidInstruments": bool,
                                "ignorePivotCurrencyHolidays": bool,
                                "interpolationMode": "str",
                                "useDelayedDataIfDenied": bool
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "crossCurrency": "str",
                                "constituents": [
                                    fx_constituent
                                ],
                                "referenceCurrency": "str"
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardCurveCalculateResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            body = {"pricingPreferences": pricing_preferences, "returnMarketData": return_market_data}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_curve_resource_calculate_request(
            curve_id=curve_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardCurveCalculateResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class fxForwardsResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`fx_forwards_resource` attribute.
    """

    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")

    async def list(
        self,
        *,
        item_per_page: Optional[int] = None,
        page: Optional[int] = None,
        spaces: Optional[List[str]] = None,
        names: Optional[List[str]] = None,
        space_name_sort_order: Optional[Union[str, _models.SortingOrderEnum]] = None,
        tags: Optional[List[str]] = None,
        fields: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardCollectionResponse, _models.ServiceErrorResponse]:
        """List the FxForwards existing in the platform (depending on permissions).

        :keyword item_per_page: A parameter used to select the number of items allowed per page. The
         valid range is 1-500. If not provided, 50 will be used. Default value is None.
        :paramtype item_per_page: int
        :keyword page: A parameter used to define the page number to display. Default value is None.
        :paramtype page: int
        :keyword spaces: A parameter used to search for platform resources stored in a given space.
         Space is like a namespace where resources are stored. By default there are two spaces:
         LSEG is reserved for LSEG maintained resources, HOME is reserved for user's default space.
         If space is not specified, it will search within all spaces. Default value is None.
        :paramtype spaces: list[str]
        :keyword names: A parameter used to search for platform resources with given names. Default
         value is None.
        :paramtype names: list[str]
        :keyword space_name_sort_order: A parameter used to sort platform resources by name based on a
         defined order. Known values are: "Asc" and "Desc". Default value is None.
        :paramtype space_name_sort_order: str or ~analyticsapi.models.SortingOrderEnum
        :keyword tags: A parameter used to search for platform resources with given tags. Default value
         is None.
        :paramtype tags: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: FxForwardCollectionResponse or ServiceErrorResponse. The FxForwardCollectionResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardCollectionResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.FxForwardCollectionResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_fx_forwards_resource_list_request(
            item_per_page=item_per_page,
            page=page,
            spaces=spaces,
            names=names,
            space_name_sort_order=space_name_sort_order,
            tags=tags,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardCollectionResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create(
        self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        """Save a new FxForward in the platform.

        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "settlementType": "str",
                        "startDate": date
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self,
        *,
        location: _models.Location,
        definition: _models.FxForwardDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        """Save a new FxForward in the platform.

        :keyword location: Object defining the location of the FxForward in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxForward. Required.
        :paramtype definition: ~analyticsapi.models.FxForwardDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the FxForward. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        """Save a new FxForward in the platform.

        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.FxForwardDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        """Save a new FxForward in the platform.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the FxForward in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxForward. Required.
        :paramtype definition: ~analyticsapi.models.FxForwardDefinition
        :keyword description: Object defining metadata for the FxForward. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "settlementType": "str",
                        "startDate": date
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forwards_resource_create_request(
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            201,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 201:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def price(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardArrayPriceResponse, _models.ServiceErrorResponse]:
        """Pricing FxForwards by providing their definitions.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardArrayPriceResponse or ServiceErrorResponse. The FxForwardArrayPriceResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardArrayPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "pricingAnalysis": {
                                    "rate": 0.0,
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "fxOutrightCcy1Ccy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSpot": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy1": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy1Ccy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "settlementAmount": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "settlementType": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def price(
        self,
        *,
        definitions: List[_models.FxForwardDefinitionInstrument],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardArrayPriceResponse, _models.ServiceErrorResponse]:
        """Pricing FxForwards by providing their definitions.

        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxForwardDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardArrayPriceResponse or ServiceErrorResponse. The FxForwardArrayPriceResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardArrayPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "pricingAnalysis": {
                                    "rate": 0.0,
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "fxOutrightCcy1Ccy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSpot": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy1": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy1Ccy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "settlementAmount": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "settlementType": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def price(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardArrayPriceResponse, _models.ServiceErrorResponse]:
        """Pricing FxForwards by providing their definitions.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardArrayPriceResponse or ServiceErrorResponse. The FxForwardArrayPriceResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardArrayPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "pricingAnalysis": {
                                    "rate": 0.0,
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "fxOutrightCcy1Ccy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSpot": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy1": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy1Ccy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "settlementAmount": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "settlementType": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def price(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        definitions: List[_models.FxForwardDefinitionInstrument] = _Unset,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardArrayPriceResponse, _models.ServiceErrorResponse]:
        """Pricing FxForwards by providing their definitions.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxForwardDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardArrayPriceResponse or ServiceErrorResponse. The FxForwardArrayPriceResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardArrayPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "pricingAnalysis": {
                                    "rate": 0.0,
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "fxOutrightCcy1Ccy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSpot": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy1": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy1Ccy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "fxSwapsCcy2": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    },
                                    "settlementAmount": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "settlementType": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardArrayPriceResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if definitions is _Unset:
                raise TypeError("missing required argument: definitions")
            body = {
                "definitions": definitions,
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forwards_resource_price_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardArrayPriceResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def value(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardArrayValuationResponse, _models.ServiceErrorResponse]:
        """Valuing FxForwards by providing their definitions.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardArrayValuationResponse or ServiceErrorResponse. The
         FxForwardArrayValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "valuation": {
                                    "discountFactor": 0.0,
                                    "marketValueInContraCcy": 0.0,
                                    "marketValueInDealCcy": 0.0,
                                    "marketValueInReportCcy": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "settlementType": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        *,
        definitions: List[_models.FxForwardDefinitionInstrument],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardArrayValuationResponse, _models.ServiceErrorResponse]:
        """Valuing FxForwards by providing their definitions.

        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxForwardDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardArrayValuationResponse or ServiceErrorResponse. The
         FxForwardArrayValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "valuation": {
                                    "discountFactor": 0.0,
                                    "marketValueInContraCcy": 0.0,
                                    "marketValueInDealCcy": 0.0,
                                    "marketValueInReportCcy": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "settlementType": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardArrayValuationResponse, _models.ServiceErrorResponse]:
        """Valuing FxForwards by providing their definitions.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardArrayValuationResponse or ServiceErrorResponse. The
         FxForwardArrayValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "valuation": {
                                    "discountFactor": 0.0,
                                    "marketValueInContraCcy": 0.0,
                                    "marketValueInDealCcy": 0.0,
                                    "marketValueInReportCcy": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "settlementType": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def value(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        definitions: List[_models.FxForwardDefinitionInstrument] = _Unset,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardArrayValuationResponse, _models.ServiceErrorResponse]:
        """Valuing FxForwards by providing their definitions.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxForwardDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardArrayValuationResponse or ServiceErrorResponse. The
         FxForwardArrayValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "valuation": {
                                    "discountFactor": 0.0,
                                    "marketValueInContraCcy": 0.0,
                                    "marketValueInDealCcy": 0.0,
                                    "marketValueInReportCcy": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "settlementType": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardArrayValuationResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            if definitions is _Unset:
                raise TypeError("missing required argument: definitions")
            body = {
                "definitions": definitions,
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forwards_resource_value_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardArrayValuationResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def build_fx_forward_from_template(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardFromTemplateResponse, _models.ServiceErrorResponse]:
        """Creating FxForwards from an existing template and a set of overrides.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardFromTemplateResponse or ServiceErrorResponse. The
         FxForwardFromTemplateResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardFromTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "reference": "str",
                    "overrides": {
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "settlementType": "str",
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "settlementType": "str",
                        "startDate": date
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def build_fx_forward_from_template(
        self,
        *,
        reference: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        overrides: Optional[_models.FxForwardOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardFromTemplateResponse, _models.ServiceErrorResponse]:
        """Creating FxForwards from an existing template and a set of overrides.

        :keyword reference: The reference to the Fx Forward template. Required.
        :paramtype reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword overrides: The object that contains the overridden properties. Default value is None.
        :paramtype overrides: ~analyticsapi.models.FxForwardOverride
        :return: FxForwardFromTemplateResponse or ServiceErrorResponse. The
         FxForwardFromTemplateResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardFromTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "settlementType": "str",
                        "startDate": date
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def build_fx_forward_from_template(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardFromTemplateResponse, _models.ServiceErrorResponse]:
        """Creating FxForwards from an existing template and a set of overrides.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardFromTemplateResponse or ServiceErrorResponse. The
         FxForwardFromTemplateResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardFromTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "settlementType": "str",
                        "startDate": date
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def build_fx_forward_from_template(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        reference: str = _Unset,
        fields: Optional[str] = None,
        overrides: Optional[_models.FxForwardOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardFromTemplateResponse, _models.ServiceErrorResponse]:
        """Creating FxForwards from an existing template and a set of overrides.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword reference: The reference to the Fx Forward template. Required.
        :paramtype reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword overrides: The object that contains the overridden properties. Default value is None.
        :paramtype overrides: ~analyticsapi.models.FxForwardOverride
        :return: FxForwardFromTemplateResponse or ServiceErrorResponse. The
         FxForwardFromTemplateResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardFromTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "reference": "str",
                    "overrides": {
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "settlementType": "str",
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "settlementType": "str",
                        "startDate": date
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardFromTemplateResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            if reference is _Unset:
                raise TypeError("missing required argument: reference")
            body = {"overrides": overrides, "reference": reference}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forwards_resource_build_fx_forward_from_template_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardFromTemplateResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class fxForwardResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`fx_forward_resource` attribute.
    """

    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")

    async def read(
        self, instrument_id: str, *, fields: Optional[str] = None, **kwargs: Any
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        """Access a FxForward existing in the platform (read).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.FxForwardResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_fx_forward_resource_read_request(
            instrument_id=instrument_id,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def delete(self, instrument_id: str, **kwargs: Any) -> Optional[_models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Delete a FxForward that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :return: ServiceErrorResponse or None. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.ServiceErrorResponse or None
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_fx_forward_resource_delete_request(
            instrument_id=instrument_id,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            204,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        deserialized = None
        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def overwrite(
        self, instrument_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxForward that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "settlementType": "str",
                        "startDate": date
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self,
        instrument_id: str,
        *,
        location: _models.Location,
        definition: _models.FxForwardDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxForward that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword location: Object defining the location of the FxForward in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxForward. Required.
        :paramtype definition: ~analyticsapi.models.FxForwardDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the FxForward. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self, instrument_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxForward that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def overwrite(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.FxForwardDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxForward that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the FxForward in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxForward. Required.
        :paramtype definition: ~analyticsapi.models.FxForwardDefinition
        :keyword description: Object defining metadata for the FxForward. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxForwardResponse or ServiceErrorResponse. The FxForwardResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxForwardResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "settlementType": "str",
                        "startDate": date
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "settlementType": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_resource_overwrite_request(
            instrument_id=instrument_id,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def price(
        self,
        instrument_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxForwardPriceResponse, _models.ServiceErrorResponse]:
        """Pricing a FxForward existing in the platform (FxForward must be saved or loaded beforehand).
        Currently, only NextBusinessDay is supported for the date moving convention in the start date
        or end date.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardPriceResponse or ServiceErrorResponse. The FxForwardPriceResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "pricingAnalysis": {
                                "rate": 0.0,
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "fxOutrightCcy1Ccy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSpot": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy1": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy1Ccy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "settlementAmount": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def price(
        self,
        instrument_id: str,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardPriceResponse, _models.ServiceErrorResponse]:
        """Pricing a FxForward existing in the platform (FxForward must be saved or loaded beforehand).
        Currently, only NextBusinessDay is supported for the date moving convention in the start date
        or end date.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardPriceResponse or ServiceErrorResponse. The FxForwardPriceResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "pricingAnalysis": {
                                "rate": 0.0,
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "fxOutrightCcy1Ccy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSpot": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy1": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy1Ccy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "settlementAmount": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def price(
        self,
        instrument_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxForwardPriceResponse, _models.ServiceErrorResponse]:
        """Pricing a FxForward existing in the platform (FxForward must be saved or loaded beforehand).
        Currently, only NextBusinessDay is supported for the date moving convention in the start date
        or end date.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardPriceResponse or ServiceErrorResponse. The FxForwardPriceResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "pricingAnalysis": {
                                "rate": 0.0,
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "fxOutrightCcy1Ccy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSpot": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy1": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy1Ccy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "settlementAmount": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def price(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardPriceResponse, _models.ServiceErrorResponse]:
        """Pricing a FxForward existing in the platform (FxForward must be saved or loaded beforehand).
        Currently, only NextBusinessDay is supported for the date moving convention in the start date
        or end date.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardPriceResponse or ServiceErrorResponse. The FxForwardPriceResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "pricingAnalysis": {
                                "rate": 0.0,
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "fxOutrightCcy1Ccy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSpot": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy1": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy1Ccy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "fxSwapsCcy2": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                },
                                "settlementAmount": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardPriceResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            body = {
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_resource_price_request(
            instrument_id=instrument_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardPriceResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def value(
        self,
        instrument_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxForwardValuationResponse, _models.ServiceErrorResponse]:
        """Valuing a FxForward existing in the platform (FxForward must be saved or loaded beforehand).
        Currently, only NextBusinessDay is supported for the date moving convention in the start date
        or end date.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardValuationResponse or ServiceErrorResponse. The FxForwardValuationResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "valuation": {
                                "discountFactor": 0.0,
                                "marketValueInContraCcy": 0.0,
                                "marketValueInDealCcy": 0.0,
                                "marketValueInReportCcy": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        instrument_id: str,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardValuationResponse, _models.ServiceErrorResponse]:
        """Valuing a FxForward existing in the platform (FxForward must be saved or loaded beforehand).
        Currently, only NextBusinessDay is supported for the date moving convention in the start date
        or end date.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardValuationResponse or ServiceErrorResponse. The FxForwardValuationResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "valuation": {
                                "discountFactor": 0.0,
                                "marketValueInContraCcy": 0.0,
                                "marketValueInDealCcy": 0.0,
                                "marketValueInReportCcy": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        instrument_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxForwardValuationResponse, _models.ServiceErrorResponse]:
        """Valuing a FxForward existing in the platform (FxForward must be saved or loaded beforehand).
        Currently, only NextBusinessDay is supported for the date moving convention in the start date
        or end date.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxForwardValuationResponse or ServiceErrorResponse. The FxForwardValuationResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "valuation": {
                                "discountFactor": 0.0,
                                "marketValueInContraCcy": 0.0,
                                "marketValueInDealCcy": 0.0,
                                "marketValueInReportCcy": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def value(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxForwardValuationResponse, _models.ServiceErrorResponse]:
        """Valuing a FxForward existing in the platform (FxForward must be saved or loaded beforehand).
        Currently, only NextBusinessDay is supported for the date moving convention in the start date
        or end date.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxForwardValuationResponse or ServiceErrorResponse. The FxForwardValuationResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxForwardValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "valuation": {
                                "discountFactor": 0.0,
                                "marketValueInContraCcy": 0.0,
                                "marketValueInDealCcy": 0.0,
                                "marketValueInReportCcy": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "settlementType": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxForwardValuationResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            body = {
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_forward_resource_value_request(
            instrument_id=instrument_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxForwardValuationResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class fxSpotsResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`fx_spots_resource` attribute.
    """

    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")

    async def list(
        self,
        *,
        item_per_page: Optional[int] = None,
        page: Optional[int] = None,
        spaces: Optional[List[str]] = None,
        names: Optional[List[str]] = None,
        space_name_sort_order: Optional[Union[str, _models.SortingOrderEnum]] = None,
        tags: Optional[List[str]] = None,
        fields: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotCollectionResponse, _models.ServiceErrorResponse]:
        """List the FxSpots existing in the platform (depending on permissions).

        :keyword item_per_page: A parameter used to select the number of items allowed per page. The
         valid range is 1-500. If not provided, 50 will be used. Default value is None.
        :paramtype item_per_page: int
        :keyword page: A parameter used to define the page number to display. Default value is None.
        :paramtype page: int
        :keyword spaces: A parameter used to search for platform resources stored in a given space.
         Space is like a namespace where resources are stored. By default there are two spaces:
         LSEG is reserved for LSEG maintained resources, HOME is reserved for user's default space.
         If space is not specified, it will search within all spaces. Default value is None.
        :paramtype spaces: list[str]
        :keyword names: A parameter used to search for platform resources with given names. Default
         value is None.
        :paramtype names: list[str]
        :keyword space_name_sort_order: A parameter used to sort platform resources by name based on a
         defined order. Known values are: "Asc" and "Desc". Default value is None.
        :paramtype space_name_sort_order: str or ~analyticsapi.models.SortingOrderEnum
        :keyword tags: A parameter used to search for platform resources with given tags. Default value
         is None.
        :paramtype tags: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: FxSpotCollectionResponse or ServiceErrorResponse. The FxSpotCollectionResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotCollectionResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.FxSpotCollectionResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_fx_spots_resource_list_request(
            item_per_page=item_per_page,
            page=page,
            spaces=spaces,
            names=names,
            space_name_sort_order=space_name_sort_order,
            tags=tags,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotCollectionResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create(
        self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        """Save a new FxSpot in the platform.

        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "startDate": date
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self,
        *,
        location: _models.Location,
        definition: _models.FxSpotDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        """Save a new FxSpot in the platform.

        :keyword location: Object defining the location of the FxSpot in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxSpot. Required.
        :paramtype definition: ~analyticsapi.models.FxSpotDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the FxSpot. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        """Save a new FxSpot in the platform.

        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.FxSpotDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        """Save a new FxSpot in the platform.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the FxSpot in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxSpot. Required.
        :paramtype definition: ~analyticsapi.models.FxSpotDefinition
        :keyword description: Object defining metadata for the FxSpot. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "startDate": date
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxSpotResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_spots_resource_create_request(
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            201,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 201:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def price(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotArrayPriceResponse, _models.ServiceErrorResponse]:
        """Pricing FxSpots by providing their definitions.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotArrayPriceResponse or ServiceErrorResponse. The FxSpotArrayPriceResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotArrayPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "pricingAnalysis": {
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "fxSpot": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    }
                                },
                                "processingInformation": [
                                    "str"
                                ]
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def price(
        self,
        *,
        definitions: List[_models.FxSpotDefinitionInstrument],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotArrayPriceResponse, _models.ServiceErrorResponse]:
        """Pricing FxSpots by providing their definitions.

        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxSpotDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxSpotArrayPriceResponse or ServiceErrorResponse. The FxSpotArrayPriceResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotArrayPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "pricingAnalysis": {
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "fxSpot": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    }
                                },
                                "processingInformation": [
                                    "str"
                                ]
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def price(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotArrayPriceResponse, _models.ServiceErrorResponse]:
        """Pricing FxSpots by providing their definitions.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotArrayPriceResponse or ServiceErrorResponse. The FxSpotArrayPriceResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotArrayPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "pricingAnalysis": {
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "fxSpot": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    }
                                },
                                "processingInformation": [
                                    "str"
                                ]
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def price(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        definitions: List[_models.FxSpotDefinitionInstrument] = _Unset,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotArrayPriceResponse, _models.ServiceErrorResponse]:
        """Pricing FxSpots by providing their definitions.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxSpotDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxSpotArrayPriceResponse or ServiceErrorResponse. The FxSpotArrayPriceResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotArrayPriceResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "pricingAnalysis": {
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "fxSpot": {
                                        "ask": 0.0,
                                        "bid": 0.0
                                    }
                                },
                                "processingInformation": [
                                    "str"
                                ]
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxSpotArrayPriceResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if definitions is _Unset:
                raise TypeError("missing required argument: definitions")
            body = {
                "definitions": definitions,
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_spots_resource_price_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotArrayPriceResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def value(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotArrayValuationResponse, _models.ServiceErrorResponse]:
        """Valuing FxSpots by providing their definitions.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotArrayValuationResponse or ServiceErrorResponse. The FxSpotArrayValuationResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "processingInformation": [
                                    "str"
                                ],
                                "valuation": {
                                    "marketValueInContraCcy": 0.0,
                                    "marketValueInDealCcy": 0.0,
                                    "marketValueInReportCcy": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        *,
        definitions: List[_models.FxSpotDefinitionInstrument],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotArrayValuationResponse, _models.ServiceErrorResponse]:
        """Valuing FxSpots by providing their definitions.

        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxSpotDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxSpotArrayValuationResponse or ServiceErrorResponse. The FxSpotArrayValuationResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "processingInformation": [
                                    "str"
                                ],
                                "valuation": {
                                    "marketValueInContraCcy": 0.0,
                                    "marketValueInDealCcy": 0.0,
                                    "marketValueInReportCcy": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotArrayValuationResponse, _models.ServiceErrorResponse]:
        """Valuing FxSpots by providing their definitions.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotArrayValuationResponse or ServiceErrorResponse. The FxSpotArrayValuationResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "processingInformation": [
                                    "str"
                                ],
                                "valuation": {
                                    "marketValueInContraCcy": 0.0,
                                    "marketValueInDealCcy": 0.0,
                                    "marketValueInReportCcy": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def value(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        definitions: List[_models.FxSpotDefinitionInstrument] = _Unset,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotArrayValuationResponse, _models.ServiceErrorResponse]:
        """Valuing FxSpots by providing their definitions.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.FxSpotDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxSpotArrayValuationResponse or ServiceErrorResponse. The FxSpotArrayValuationResponse
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "startDate": {
                                        "adjusted": "2020-02-20",
                                        "dateMovingConvention": "str",
                                        "unAdjusted": "2020-02-20",
                                        "date": "2020-02-20",
                                        "processingInformation": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    },
                                    "valuationDate": "2020-02-20"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "greeks": {
                                    "deltaAmountInContraCcy": 0.0,
                                    "deltaAmountInDealCcy": 0.0,
                                    "deltaPercent": 0.0
                                },
                                "processingInformation": [
                                    "str"
                                ],
                                "valuation": {
                                    "marketValueInContraCcy": 0.0,
                                    "marketValueInDealCcy": 0.0,
                                    "marketValueInReportCcy": 0.0
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "baseCurrency": "str",
                                    "quotedCurrency": "str",
                                    "contraAmount": 0.0,
                                    "dealAmount": 0.0,
                                    "endDate": date,
                                    "payer": "str",
                                    "rate": {
                                        "ratePrecision": 0,
                                        "scalingFactor": 0.0,
                                        "value": 0.0
                                    },
                                    "receiver": "str",
                                    "startDate": date
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxSpotArrayValuationResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            if definitions is _Unset:
                raise TypeError("missing required argument: definitions")
            body = {
                "definitions": definitions,
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_spots_resource_value_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotArrayValuationResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def build_fx_spot_from_template(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotFromTemplateResponse, _models.ServiceErrorResponse]:
        """Creating FxSpots from an existing template and a set of overrides.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotFromTemplateResponse or ServiceErrorResponse. The FxSpotFromTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotFromTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "reference": "str",
                    "overrides": {
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "startDate": date
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def build_fx_spot_from_template(
        self,
        *,
        reference: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        overrides: Optional[_models.FxSpotOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotFromTemplateResponse, _models.ServiceErrorResponse]:
        """Creating FxSpots from an existing template and a set of overrides.

        :keyword reference: The reference to the Fx Spot template. Required.
        :paramtype reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword overrides: The object that contains the overridden properties. Default value is None.
        :paramtype overrides: ~analyticsapi.models.FxSpotOverride
        :return: FxSpotFromTemplateResponse or ServiceErrorResponse. The FxSpotFromTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotFromTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "startDate": date
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def build_fx_spot_from_template(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotFromTemplateResponse, _models.ServiceErrorResponse]:
        """Creating FxSpots from an existing template and a set of overrides.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotFromTemplateResponse or ServiceErrorResponse. The FxSpotFromTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotFromTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "startDate": date
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def build_fx_spot_from_template(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        reference: str = _Unset,
        fields: Optional[str] = None,
        overrides: Optional[_models.FxSpotOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotFromTemplateResponse, _models.ServiceErrorResponse]:
        """Creating FxSpots from an existing template and a set of overrides.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword reference: The reference to the Fx Spot template. Required.
        :paramtype reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword overrides: The object that contains the overridden properties. Default value is None.
        :paramtype overrides: ~analyticsapi.models.FxSpotOverride
        :return: FxSpotFromTemplateResponse or ServiceErrorResponse. The FxSpotFromTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotFromTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "reference": "str",
                    "overrides": {
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "startDate": date
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxSpotFromTemplateResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if reference is _Unset:
                raise TypeError("missing required argument: reference")
            body = {"overrides": overrides, "reference": reference}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_spots_resource_build_fx_spot_from_template_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotFromTemplateResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class fxSpotResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`fx_spot_resource` attribute.
    """

    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")

    async def read(
        self, instrument_id: str, *, fields: Optional[str] = None, **kwargs: Any
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        """Access a FxSpot existing in the platform (read).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.FxSpotResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_fx_spot_resource_read_request(
            instrument_id=instrument_id,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def delete(self, instrument_id: str, **kwargs: Any) -> Optional[_models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Delete a FxSpot that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :return: ServiceErrorResponse or None. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.ServiceErrorResponse or None
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_fx_spot_resource_delete_request(
            instrument_id=instrument_id,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            204,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        deserialized = None
        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def overwrite(
        self, instrument_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxSpot that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "startDate": date
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self,
        instrument_id: str,
        *,
        location: _models.Location,
        definition: _models.FxSpotDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxSpot that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword location: Object defining the location of the FxSpot in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxSpot. Required.
        :paramtype definition: ~analyticsapi.models.FxSpotDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the FxSpot. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self, instrument_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxSpot that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def overwrite(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.FxSpotDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FxSpot that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the FxSpot in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FxSpot. Required.
        :paramtype definition: ~analyticsapi.models.FxSpotDefinition
        :keyword description: Object defining metadata for the FxSpot. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FxSpotResponse or ServiceErrorResponse. The FxSpotResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.FxSpotResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "baseCurrency": "str",
                        "quotedCurrency": "str",
                        "contraAmount": 0.0,
                        "dealAmount": 0.0,
                        "endDate": date,
                        "payer": "str",
                        "rate": {
                            "ratePrecision": 0,
                            "scalingFactor": 0.0,
                            "value": 0.0
                        },
                        "receiver": "str",
                        "startDate": date
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "baseCurrency": "str",
                            "quotedCurrency": "str",
                            "contraAmount": 0.0,
                            "dealAmount": 0.0,
                            "endDate": date,
                            "payer": "str",
                            "rate": {
                                "ratePrecision": 0,
                                "scalingFactor": 0.0,
                                "value": 0.0
                            },
                            "receiver": "str",
                            "startDate": date
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxSpotResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_spot_resource_overwrite_request(
            instrument_id=instrument_id,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def price(
        self,
        instrument_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxSpotPriceResponse, _models.ServiceErrorResponse]:
        """Pricing a FxForward existing on the platform (FxSpot must be saved or loaded beforehand).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotPriceResponse or ServiceErrorResponse. The FxSpotPriceResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotPriceResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "pricingAnalysis": {
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "fxSpot": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                }
                            },
                            "processingInformation": [
                                "str"
                            ]
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def price(
        self,
        instrument_id: str,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotPriceResponse, _models.ServiceErrorResponse]:
        """Pricing a FxForward existing on the platform (FxSpot must be saved or loaded beforehand).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxSpotPriceResponse or ServiceErrorResponse. The FxSpotPriceResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotPriceResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "pricingAnalysis": {
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "fxSpot": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                }
                            },
                            "processingInformation": [
                                "str"
                            ]
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def price(
        self,
        instrument_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxSpotPriceResponse, _models.ServiceErrorResponse]:
        """Pricing a FxForward existing on the platform (FxSpot must be saved or loaded beforehand).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotPriceResponse or ServiceErrorResponse. The FxSpotPriceResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotPriceResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "pricingAnalysis": {
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "fxSpot": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                }
                            },
                            "processingInformation": [
                                "str"
                            ]
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def price(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotPriceResponse, _models.ServiceErrorResponse]:
        """Pricing a FxForward existing on the platform (FxSpot must be saved or loaded beforehand).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxSpotPriceResponse or ServiceErrorResponse. The FxSpotPriceResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotPriceResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "pricingAnalysis": {
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "fxSpot": {
                                    "ask": 0.0,
                                    "bid": 0.0
                                }
                            },
                            "processingInformation": [
                                "str"
                            ]
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxSpotPriceResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            body = {
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_spot_resource_price_request(
            instrument_id=instrument_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotPriceResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def value(
        self,
        instrument_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxSpotValuationResponse, _models.ServiceErrorResponse]:
        """Valuing a FxForward existing on the platform (FxSpot must be saved or loaded beforehand).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotValuationResponse or ServiceErrorResponse. The FxSpotValuationResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "processingInformation": [
                                "str"
                            ],
                            "valuation": {
                                "marketValueInContraCcy": 0.0,
                                "marketValueInDealCcy": 0.0,
                                "marketValueInReportCcy": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        instrument_id: str,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotValuationResponse, _models.ServiceErrorResponse]:
        """Valuing a FxForward existing on the platform (FxSpot must be saved or loaded beforehand).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxSpotValuationResponse or ServiceErrorResponse. The FxSpotValuationResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "processingInformation": [
                                "str"
                            ],
                            "valuation": {
                                "marketValueInContraCcy": 0.0,
                                "marketValueInDealCcy": 0.0,
                                "marketValueInReportCcy": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        instrument_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.FxSpotValuationResponse, _models.ServiceErrorResponse]:
        """Valuing a FxForward existing on the platform (FxSpot must be saved or loaded beforehand).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FxSpotValuationResponse or ServiceErrorResponse. The FxSpotValuationResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "processingInformation": [
                                "str"
                            ],
                            "valuation": {
                                "marketValueInContraCcy": 0.0,
                                "marketValueInDealCcy": 0.0,
                                "marketValueInReportCcy": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def value(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.FxPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.FxSpotValuationResponse, _models.ServiceErrorResponse]:
        """Valuing a FxForward existing on the platform (FxSpot must be saved or loaded beforehand).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.FxPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: FxSpotValuationResponse or ServiceErrorResponse. The FxSpotValuationResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FxSpotValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "ignoreReferenceCurrencyHolidays": bool,
                        "referenceCurrency": "str",
                        "reportCurrency": "str",
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "startDate": {
                                    "adjusted": "2020-02-20",
                                    "dateMovingConvention": "str",
                                    "unAdjusted": "2020-02-20",
                                    "date": "2020-02-20",
                                    "processingInformation": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                },
                                "valuationDate": "2020-02-20"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "greeks": {
                                "deltaAmountInContraCcy": 0.0,
                                "deltaAmountInDealCcy": 0.0,
                                "deltaPercent": 0.0
                            },
                            "processingInformation": [
                                "str"
                            ],
                            "valuation": {
                                "marketValueInContraCcy": 0.0,
                                "marketValueInDealCcy": 0.0,
                                "marketValueInReportCcy": 0.0
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "ignoreReferenceCurrencyHolidays": bool,
                            "referenceCurrency": "str",
                            "reportCurrency": "str",
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "baseCurrency": "str",
                                "quotedCurrency": "str",
                                "contraAmount": 0.0,
                                "dealAmount": 0.0,
                                "endDate": date,
                                "payer": "str",
                                "rate": {
                                    "ratePrecision": 0,
                                    "scalingFactor": 0.0,
                                    "value": 0.0
                                },
                                "receiver": "str",
                                "startDate": date
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FxSpotValuationResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            body = {
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_fx_spot_resource_value_request(
            instrument_id=instrument_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FxSpotValuationResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


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

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`yield_book_rest` attribute.
    """

    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")

    @overload
    async def request_bond_indic_sync(
        self,
        body: _models.BondIndicRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.MappedResponseRefData, _models.ServiceErrorResponse]:
        """Request Bond Indic Sync data via Post.

        Synchronous Post method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve instrument
        reference data given a BondIndicRequest - 'Input' - parameter that includes the information of
        which security or list of securities to be queried by CUSIP, ISIN, or other identifier type to
        obtain basic contractual information in the MappedResponseRefData such as security type,
        sector,  maturity, credit ratings, coupon, and specific information based on security type like
        current pool factor if the requested identifier is a mortgage. Recommended and preferred method
        for single or low-volume instrument queries (up to 50-70 per request, 250 max).

        :param body: Required.
        :type body: ~analyticsapi.models.BondIndicRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: MappedResponseRefData or ServiceErrorResponse. The MappedResponseRefData is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.MappedResponseRefData or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "input": [
                        {
                            "idType": "str",
                            "identifier": "str",
                            "props": {
                                "str": {}
                            },
                            "userInstrument": {
                                "$ref": "str"
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "meta": {
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "resultsStatus": "ALL",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {}
                    ]
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_bond_indic_sync(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.MappedResponseRefData, _models.ServiceErrorResponse]:
        """Request Bond Indic Sync data via Post.

        Synchronous Post method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve instrument
        reference data given a BondIndicRequest - 'Input' - parameter that includes the information of
        which security or list of securities to be queried by CUSIP, ISIN, or other identifier type to
        obtain basic contractual information in the MappedResponseRefData such as security type,
        sector,  maturity, credit ratings, coupon, and specific information based on security type like
        current pool factor if the requested identifier is a mortgage. Recommended and preferred method
        for single or low-volume instrument queries (up to 50-70 per request, 250 max).

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: MappedResponseRefData or ServiceErrorResponse. The MappedResponseRefData is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.MappedResponseRefData or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "meta": {
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "resultsStatus": "ALL",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {}
                    ]
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_bond_indic_sync(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.MappedResponseRefData, _models.ServiceErrorResponse]:
        """Request Bond Indic Sync data via Post.

        Synchronous Post method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve instrument
        reference data given a BondIndicRequest - 'Input' - parameter that includes the information of
        which security or list of securities to be queried by CUSIP, ISIN, or other identifier type to
        obtain basic contractual information in the MappedResponseRefData such as security type,
        sector,  maturity, credit ratings, coupon, and specific information based on security type like
        current pool factor if the requested identifier is a mortgage. Recommended and preferred method
        for single or low-volume instrument queries (up to 50-70 per request, 250 max).

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: MappedResponseRefData or ServiceErrorResponse. The MappedResponseRefData is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.MappedResponseRefData or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "meta": {
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "resultsStatus": "ALL",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {}
                    ]
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_bond_indic_sync(
        self,
        body: Union[_models.BondIndicRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.MappedResponseRefData, _models.ServiceErrorResponse]:
        """Request Bond Indic Sync data via Post.

        Synchronous Post method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve instrument
        reference data given a BondIndicRequest - 'Input' - parameter that includes the information of
        which security or list of securities to be queried by CUSIP, ISIN, or other identifier type to
        obtain basic contractual information in the MappedResponseRefData such as security type,
        sector,  maturity, credit ratings, coupon, and specific information based on security type like
        current pool factor if the requested identifier is a mortgage. Recommended and preferred method
        for single or low-volume instrument queries (up to 50-70 per request, 250 max).

        :param body: Is one of the following types: BondIndicRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.BondIndicRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: MappedResponseRefData or ServiceErrorResponse. The MappedResponseRefData is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.MappedResponseRefData or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "input": [
                        {
                            "idType": "str",
                            "identifier": "str",
                            "props": {
                                "str": {}
                            },
                            "userInstrument": {
                                "$ref": "str"
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "meta": {
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "resultsStatus": "ALL",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {}
                    ]
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.MappedResponseRefData, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_bond_indic_sync_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.MappedResponseRefData, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_bond_indic_async(
        self,
        body: _models.BondIndicRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request Bond Indic Async data via Post.

        Asynchronous Post method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve a request ID by
        which, using subsequent API 'getResult' endpoint, instrument reference data can be obtained
        given a BondIndicRequest - 'Input' - parameter that includes the information of which security
        or list of securities to be queried by CUSIP, ISIN, or other identifier type to obtain basic
        contractual information such as security type, sector,  maturity, credit ratings, coupon, and
        specific information based on security type like current pool factor if the requested
        identifier is a mortgage. Recommended and preferred method for high-volume instrument queries
        (single requsts broken to recommended 100 items, up to 250 max).

        :param body: Required.
        :type body: ~analyticsapi.models.BondIndicRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "input": [
                        {
                            "idType": "str",
                            "identifier": "str",
                            "props": {
                                "str": {}
                            },
                            "userInstrument": {
                                "$ref": "str"
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_bond_indic_async(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request Bond Indic Async data via Post.

        Asynchronous Post method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve a request ID by
        which, using subsequent API 'getResult' endpoint, instrument reference data can be obtained
        given a BondIndicRequest - 'Input' - parameter that includes the information of which security
        or list of securities to be queried by CUSIP, ISIN, or other identifier type to obtain basic
        contractual information such as security type, sector,  maturity, credit ratings, coupon, and
        specific information based on security type like current pool factor if the requested
        identifier is a mortgage. Recommended and preferred method for high-volume instrument queries
        (single requsts broken to recommended 100 items, up to 250 max).

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_bond_indic_async(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request Bond Indic Async data via Post.

        Asynchronous Post method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve a request ID by
        which, using subsequent API 'getResult' endpoint, instrument reference data can be obtained
        given a BondIndicRequest - 'Input' - parameter that includes the information of which security
        or list of securities to be queried by CUSIP, ISIN, or other identifier type to obtain basic
        contractual information such as security type, sector,  maturity, credit ratings, coupon, and
        specific information based on security type like current pool factor if the requested
        identifier is a mortgage. Recommended and preferred method for high-volume instrument queries
        (single requsts broken to recommended 100 items, up to 250 max).

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_bond_indic_async(
        self,
        body: Union[_models.BondIndicRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request Bond Indic Async data via Post.

        Asynchronous Post method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve a request ID by
        which, using subsequent API 'getResult' endpoint, instrument reference data can be obtained
        given a BondIndicRequest - 'Input' - parameter that includes the information of which security
        or list of securities to be queried by CUSIP, ISIN, or other identifier type to obtain basic
        contractual information such as security type, sector,  maturity, credit ratings, coupon, and
        specific information based on security type like current pool factor if the requested
        identifier is a mortgage. Recommended and preferred method for high-volume instrument queries
        (single requsts broken to recommended 100 items, up to 250 max).

        :param body: Is one of the following types: BondIndicRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.BondIndicRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "input": [
                        {
                            "idType": "str",
                            "identifier": "str",
                            "props": {
                                "str": {}
                            },
                            "userInstrument": {
                                "$ref": "str"
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_bond_indic_async_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_bond_indic_sync_get(
        self,
        id: str,
        *,
        id_type: Optional[Union[str, _models.IdTypeEnum]] = None,
        keywords: Optional[List[str]] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request Bond Indic Sync data via Get.

        Synchronous Get method to retrieve the contractual information about the reference data of an
        instrument, which will typically not need any further calculations. Retrieve instrument
        reference data given an instrument ID and optionaly an ID type as input parameters to obtain
        basic contractual information in the Record structure with information such as security type,
        sector,  maturity, credit ratings, coupon, and specific information based on security type like
        current pool factor if the requested identifier is a mortgage.

        :param id: Required.
        :type id: str
        :keyword id_type: Known values are: "SecurityIDEntry", "SecurityID", "CUSIP", "ISIN",
         "REGSISIN", "SEDOL", "Identifier", "ChinaInterbankCode", "ShanghaiExchangeCode",
         "ShenzhenExchangeCode", and "MXTickerID". Default value is None.
        :paramtype id_type: str or ~analyticsapi.models.IdTypeEnum
        :keyword keywords: Default value is None.
        :paramtype keywords: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_bond_indic_sync_get_request(
            id=id,
            id_type=id_type,
            keywords=keywords,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_bond_indic_async_get(
        self,
        id: str,
        *,
        id_type: Optional[Union[str, _models.IdTypeEnum]] = None,
        keywords: Optional[List[str]] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request Bond Indic Async data via Get.

        Asynchronous Get method to retrieve the contractual information about the reference data of
        instruments, which will typically not need any further calculations. Retrieve a request ID by
        which, using subsequent API 'getResult' endpoint, instrument reference data can be obtained
        given a BondIndicRequest - 'Input' - parameter that includes the information of which security
        or list of securities to be queried by CUSIP, ISIN, or other identifier type to obtain basic
        contractual information such as security type, sector,  maturity, credit ratings, coupon, and
        specific information based on security type like current pool factor if the requested
        identifier is a mortgage.

        :param id: Required.
        :type id: str
        :keyword id_type: Known values are: "SecurityIDEntry", "SecurityID", "CUSIP", "ISIN",
         "REGSISIN", "SEDOL", "Identifier", "ChinaInterbankCode", "ShanghaiExchangeCode",
         "ShenzhenExchangeCode", and "MXTickerID". Default value is None.
        :paramtype id_type: str or ~analyticsapi.models.IdTypeEnum
        :keyword keywords: Default value is None.
        :paramtype keywords: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_bond_indic_async_get_request(
            id=id,
            id_type=id_type,
            keywords=keywords,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create_job(
        self, body: _models.JobCreationRequest, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Create a new job.

        Create a new job.

        :param body: Required.
        :type body: ~analyticsapi.models.JobCreationRequest
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "asof": "2020-02-20",
                    "chain": "str",
                    "desc": "str",
                    "hold": bool,
                    "name": "str",
                    "order": "FAST",
                    "priority": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00"
                }

                # response body for status code(s): 201
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_job(
        self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Create a new job.

        Create a new job.

        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 201
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_job(
        self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Create a new job.

        Create a new job.

        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 201
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create_job(
        self, body: Union[_models.JobCreationRequest, JSON, IO[bytes]], **kwargs: Any
    ) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Create a new job.

        Create a new job.

        :param body: Is one of the following types: JobCreationRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.JobCreationRequest or JSON or IO[bytes]
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "asof": "2020-02-20",
                    "chain": "str",
                    "desc": "str",
                    "hold": bool,
                    "name": "str",
                    "order": "FAST",
                    "priority": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00"
                }

                # response body for status code(s): 201
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.JobResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_create_job_request(
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            201,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 201:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.JobResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def resubmit_job(
        self,
        job_ref: str,
        body: _models.JobResubmissionRequest,
        *,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Resubmit a job.

        Resubmit a job.

        :param job_ref: Job reference. This can be of the form J-number or job name. Required.
        :type job_ref: str
        :param body: Required.
        :type body: ~analyticsapi.models.JobResubmissionRequest
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "ids": [
                        "str"
                    ],
                    "scope": "OK"
                }

                # response body for status code(s): 200
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def resubmit_job(
        self, job_ref: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Resubmit a job.

        Resubmit a job.

        :param job_ref: Job reference. This can be of the form J-number or job name. Required.
        :type job_ref: str
        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def resubmit_job(
        self, job_ref: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Resubmit a job.

        Resubmit a job.

        :param job_ref: Job reference. This can be of the form J-number or job name. Required.
        :type job_ref: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def resubmit_job(
        self, job_ref: str, body: Union[_models.JobResubmissionRequest, JSON, IO[bytes]], **kwargs: Any
    ) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Resubmit a job.

        Resubmit a job.

        :param job_ref: Job reference. This can be of the form J-number or job name. Required.
        :type job_ref: str
        :param body: Is one of the following types: JobResubmissionRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.JobResubmissionRequest or JSON or IO[bytes]
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "ids": [
                        "str"
                    ],
                    "scope": "OK"
                }

                # response body for status code(s): 200
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.JobResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_resubmit_job_request(
            job_ref=job_ref,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.JobResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def close_job(self, job_ref: str, **kwargs: Any) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Close a job.

        Close a job.

        :param job_ref: Job reference. This can be of the form J-number or job name. Required.
        :type job_ref: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.JobResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_close_job_request(
            job_ref=job_ref,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.JobResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def abort_job(self, job_ref: str, **kwargs: Any) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Abort a job.

        Abort a job.

        :param job_ref: Job reference. This can be of the form J-number or job name. Required.
        :type job_ref: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.JobResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_abort_job_request(
            job_ref=job_ref,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.JobResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_job(self, job_ref: str, **kwargs: Any) -> Union[_models.JobResponse, _models.ServiceErrorResponse]:
        """Get job details.

        Get job details.

        :param job_ref: Job reference. This can be of the form J-number or job name. Required.
        :type job_ref: str
        :return: JobResponse or ServiceErrorResponse. The JobResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.JobResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "id": "str",
                    "aborted": bool,
                    "abortedCount": 0,
                    "actualHold": bool,
                    "asOf": "2020-02-20",
                    "chain": "str",
                    "closed": bool,
                    "createdAt": "2020-02-20 00:00:00",
                    "description": "str",
                    "errorCount": 0,
                    "exitStatus": "DONE",
                    "name": "str",
                    "okCount": 0,
                    "onHold": bool,
                    "order": "FAST",
                    "pendingCount": 0,
                    "priority": 0,
                    "requestCount": 0,
                    "runningCount": 0,
                    "sequence": 0,
                    "skipCount": 0,
                    "startAfter": "2020-02-20 00:00:00",
                    "stopAfter": "2020-02-20 00:00:00",
                    "timeline": [
                        {
                            "errorCount": 0,
                            "interval": 0,
                            "okCount": 0,
                            "ts": "2020-02-20 00:00:00"
                        }
                    ],
                    "updatedAt": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.JobResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_job_request(
            job_ref=job_ref,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.JobResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_job_status(
        self, job_ref: str, **kwargs: Any
    ) -> Union[_models.JobStatusResponse, _models.ServiceErrorResponse]:
        """Get job status.

        Get job status.

        :param job_ref: Job reference. This can be of the form J-number or job name. Required.
        :type job_ref: str
        :return: JobStatusResponse or ServiceErrorResponse. The JobStatusResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.JobStatusResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "abortedCount": 0,
                    "asOf": "2020-02-20",
                    "canManage": bool,
                    "errorCount": 0,
                    "id": "str",
                    "jobStatus": "OPEN",
                    "name": "str",
                    "okCount": 0,
                    "pendingCount": 0,
                    "poolId": "str",
                    "priority": 0,
                    "requestCount": 0,
                    "runTime": "str",
                    "runningCount": 0,
                    "skippedCount": 0,
                    "startTime": "2020-02-20 00:00:00"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.JobStatusResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_job_status_request(
            job_ref=job_ref,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.JobStatusResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_result(
        self, request_id_parameter: str, *, job: Optional[str] = None, **kwargs: Any
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Retrieve single result using request id or request name.

        :param request_id_parameter: Unique request id. This can be of the format R-number or request
         name. If request name is used, corresponding job information should be passed in the query
         parameter. Required.
        :type request_id_parameter: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_result_request(
            request_id_parameter=request_id_parameter,
            job=job,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_formatted_result(
        self, request_id_parameter: str, format: str, *, job: Optional[str] = None, **kwargs: Any
    ) -> Union[Any, _models.ServiceErrorResponse]:
        """Retrieve single formatted result using request id or request name.

        :param request_id_parameter: Unique request id. This can be of the format R-number or request
         name. If request name is used, corresponding job information should be passed in the query
         parameter. Required.
        :type request_id_parameter: str
        :param format: Only "html" format supported for now. Required.
        :type format: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :return: any or ServiceErrorResponse. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: any or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Any, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_formatted_result_request(
            request_id_parameter=request_id_parameter,
            format=format,
            job=job,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Any, response.text())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_csv_bulk_result(
        self, *, ids: List[str], fields: List[str], job: Optional[str] = None, **kwargs: Any
    ) -> Union[str, _models.ServiceErrorResponse]:
        """Retrieve bulk results with multiple request id or request name.

        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword fields: Required.
        :paramtype fields: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :return: str or ServiceErrorResponse. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: str or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[str, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_csv_bulk_result_request(
            ids=ids,
            fields=fields,
            job=job,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(str, response.text())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def post_csv_bulk_results_sync(
        self,
        body: _models.BulkResultRequest,
        *,
        ids: List[str],
        job: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[str, _models.ServiceErrorResponse]:
        """Retrieve bulk result using request id or request name in csv format.

        :param body: Required.
        :type body: ~analyticsapi.models.BulkResultRequest
        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: str or ServiceErrorResponse. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: str or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "defaultSettings": {
                        "bom": bool,
                        "boolFalse": "str",
                        "boolTrue": "str",
                        "charset": "str",
                        "condQuote": bool,
                        "dateFormat": "str",
                        "errorValue": "str",
                        "escapeChar": "str",
                        "footer": "str",
                        "header": bool,
                        "nullValue": "str",
                        "numPrec": 0,
                        "numScale": 0,
                        "numberFormat": "str",
                        "precision": 0,
                        "quoteChar": "str",
                        "relaxed": bool,
                        "scale": 0,
                        "separator": "str",
                        "strWidth": 0
                    },
                    "fields": [
                        {
                            "boolFalse": "str",
                            "boolTrue": "str",
                            "charset": "str",
                            "dateFormat": "str",
                            "defaultValue": "str",
                            "field": "str",
                            "format": "str",
                            "header": "str",
                            "lookup": {
                                "table": "str",
                                "default": {},
                                "defaultValue": {},
                                "show": "str"
                            },
                            "newField": "str",
                            "numScale": 0,
                            "precision": 0,
                            "scale": 0,
                            "strWidth": 0,
                            "type": "str"
                        }
                    ],
                    "globalSettings": {
                        "sqlSettings": {
                            "createTable": bool,
                            "defaultId": bool,
                            "dropTable": bool,
                            "insertRowLimit": 0,
                            "insertTranLimit": 0,
                            "multiValueInsertEnabled": bool,
                            "pkListAsString": "str",
                            "primaryKey": [
                                "str"
                            ],
                            "tableName": "str"
                        }
                    }
                }

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def post_csv_bulk_results_sync(
        self,
        body: JSON,
        *,
        ids: List[str],
        job: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[str, _models.ServiceErrorResponse]:
        """Retrieve bulk result using request id or request name in csv format.

        :param body: Required.
        :type body: JSON
        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: str or ServiceErrorResponse. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: str or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def post_csv_bulk_results_sync(
        self,
        body: IO[bytes],
        *,
        ids: List[str],
        job: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[str, _models.ServiceErrorResponse]:
        """Retrieve bulk result using request id or request name in csv format.

        :param body: Required.
        :type body: IO[bytes]
        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: str or ServiceErrorResponse. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: str or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def post_csv_bulk_results_sync(
        self,
        body: Union[_models.BulkResultRequest, JSON, IO[bytes]],
        *,
        ids: List[str],
        job: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[str, _models.ServiceErrorResponse]:
        """Retrieve bulk result using request id or request name in csv format.

        :param body: Is one of the following types: BulkResultRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.BulkResultRequest or JSON or IO[bytes]
        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :return: str or ServiceErrorResponse. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: str or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "defaultSettings": {
                        "bom": bool,
                        "boolFalse": "str",
                        "boolTrue": "str",
                        "charset": "str",
                        "condQuote": bool,
                        "dateFormat": "str",
                        "errorValue": "str",
                        "escapeChar": "str",
                        "footer": "str",
                        "header": bool,
                        "nullValue": "str",
                        "numPrec": 0,
                        "numScale": 0,
                        "numberFormat": "str",
                        "precision": 0,
                        "quoteChar": "str",
                        "relaxed": bool,
                        "scale": 0,
                        "separator": "str",
                        "strWidth": 0
                    },
                    "fields": [
                        {
                            "boolFalse": "str",
                            "boolTrue": "str",
                            "charset": "str",
                            "dateFormat": "str",
                            "defaultValue": "str",
                            "field": "str",
                            "format": "str",
                            "header": "str",
                            "lookup": {
                                "table": "str",
                                "default": {},
                                "defaultValue": {},
                                "show": "str"
                            },
                            "newField": "str",
                            "numScale": 0,
                            "precision": 0,
                            "scale": 0,
                            "strWidth": 0,
                            "type": "str"
                        }
                    ],
                    "globalSettings": {
                        "sqlSettings": {
                            "createTable": bool,
                            "defaultId": bool,
                            "dropTable": bool,
                            "insertRowLimit": 0,
                            "insertTranLimit": 0,
                            "multiValueInsertEnabled": bool,
                            "pkListAsString": "str",
                            "primaryKey": [
                                "str"
                            ],
                            "tableName": "str"
                        }
                    }
                }

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[str, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_post_csv_bulk_results_sync_request(
            ids=ids,
            job=job,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(str, response.text())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_json_result(
        self,
        *,
        ids: List[str],
        job: Optional[str] = None,
        fields: Optional[List[str]] = None,
        format: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Retrieve json result using request id or request name.

        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword fields: Default value is None.
        :paramtype fields: list[str]
        :keyword format: Default value is None.
        :paramtype format: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_json_result_request(
            ids=ids,
            job=job,
            fields=fields,
            format=format,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def post_json_bulk_request_sync(
        self,
        body: _models.BulkResultRequest,
        *,
        ids: List[str],
        job: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Retrieve bulk json result using request id or request name.

        :param body: Required.
        :type body: ~analyticsapi.models.BulkResultRequest
        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "defaultSettings": {
                        "bom": bool,
                        "boolFalse": "str",
                        "boolTrue": "str",
                        "charset": "str",
                        "condQuote": bool,
                        "dateFormat": "str",
                        "errorValue": "str",
                        "escapeChar": "str",
                        "footer": "str",
                        "header": bool,
                        "nullValue": "str",
                        "numPrec": 0,
                        "numScale": 0,
                        "numberFormat": "str",
                        "precision": 0,
                        "quoteChar": "str",
                        "relaxed": bool,
                        "scale": 0,
                        "separator": "str",
                        "strWidth": 0
                    },
                    "fields": [
                        {
                            "boolFalse": "str",
                            "boolTrue": "str",
                            "charset": "str",
                            "dateFormat": "str",
                            "defaultValue": "str",
                            "field": "str",
                            "format": "str",
                            "header": "str",
                            "lookup": {
                                "table": "str",
                                "default": {},
                                "defaultValue": {},
                                "show": "str"
                            },
                            "newField": "str",
                            "numScale": 0,
                            "precision": 0,
                            "scale": 0,
                            "strWidth": 0,
                            "type": "str"
                        }
                    ],
                    "globalSettings": {
                        "sqlSettings": {
                            "createTable": bool,
                            "defaultId": bool,
                            "dropTable": bool,
                            "insertRowLimit": 0,
                            "insertTranLimit": 0,
                            "multiValueInsertEnabled": bool,
                            "pkListAsString": "str",
                            "primaryKey": [
                                "str"
                            ],
                            "tableName": "str"
                        }
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def post_json_bulk_request_sync(
        self,
        body: JSON,
        *,
        ids: List[str],
        job: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Retrieve bulk json result using request id or request name.

        :param body: Required.
        :type body: JSON
        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def post_json_bulk_request_sync(
        self,
        body: IO[bytes],
        *,
        ids: List[str],
        job: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Retrieve bulk json result using request id or request name.

        :param body: Required.
        :type body: IO[bytes]
        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def post_json_bulk_request_sync(
        self,
        body: Union[_models.BulkResultRequest, JSON, IO[bytes]],
        *,
        ids: List[str],
        job: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Retrieve bulk json result using request id or request name.

        :param body: Is one of the following types: BulkResultRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.BulkResultRequest or JSON or IO[bytes]
        :keyword ids: Ids can be provided comma separated. Different formats for id are:
           1) RequestId R-number
           2) Request name R:name. In this case also provide jobid (J-number) or jobname (J:name)
           3) Jobid J-number
           4) Job name J:name - only 1 active job with the jobname
           5) Tag name T:name. In this case also provide jobid (J-number) or jobname (J:name).
         Required.
        :paramtype ids: list[str]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "defaultSettings": {
                        "bom": bool,
                        "boolFalse": "str",
                        "boolTrue": "str",
                        "charset": "str",
                        "condQuote": bool,
                        "dateFormat": "str",
                        "errorValue": "str",
                        "escapeChar": "str",
                        "footer": "str",
                        "header": bool,
                        "nullValue": "str",
                        "numPrec": 0,
                        "numScale": 0,
                        "numberFormat": "str",
                        "precision": 0,
                        "quoteChar": "str",
                        "relaxed": bool,
                        "scale": 0,
                        "separator": "str",
                        "strWidth": 0
                    },
                    "fields": [
                        {
                            "boolFalse": "str",
                            "boolTrue": "str",
                            "charset": "str",
                            "dateFormat": "str",
                            "defaultValue": "str",
                            "field": "str",
                            "format": "str",
                            "header": "str",
                            "lookup": {
                                "table": "str",
                                "default": {},
                                "defaultValue": {},
                                "show": "str"
                            },
                            "newField": "str",
                            "numScale": 0,
                            "precision": 0,
                            "scale": 0,
                            "strWidth": 0,
                            "type": "str"
                        }
                    ],
                    "globalSettings": {
                        "sqlSettings": {
                            "createTable": bool,
                            "defaultId": bool,
                            "dropTable": bool,
                            "insertRowLimit": 0,
                            "insertTranLimit": 0,
                            "multiValueInsertEnabled": bool,
                            "pkListAsString": "str",
                            "primaryKey": [
                                "str"
                            ],
                            "tableName": "str"
                        }
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_post_json_bulk_request_sync_request(
            ids=ids,
            job=job,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def upload_csv_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: str,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload csv job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/csv"))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _content = data

        _request = build_yield_book_rest_upload_csv_job_data_with_name_async_request(
            job=job,
            store_type=store_type,
            request_name=request_name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def upload_text_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: str,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload text job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/plain"))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _content = data

        _request = build_yield_book_rest_upload_text_job_data_with_name_async_request(
            job=job,
            store_type=store_type,
            request_name=request_name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def upload_json_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.PrepayDialsInput,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.PrepayDialsInput
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "dials": {
                        "agencyEligibility": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "annualMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "armSpikeHeight": 0.0,
                        "armSpikeLength": 0.0,
                        "brokerCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveSlope": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashouts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "creditScoreBase": 0.0,
                        "creditScoreSlope": 0.0,
                        "curtailmentMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "defaultMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ioSpikeElbow": 0.0,
                        "ioSpikeHeight": 0.0,
                        "ioSpikeLength": 0.0,
                        "loanSizeBase": 0.0,
                        "loanSizeSlope": 0.0,
                        "loanToValueBase": 0.0,
                        "loanToValueSlope": 0.0,
                        "onlineRefiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepayVectorShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepaymentDecay": 0.0,
                        "propertyInspectionWaiverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadFloor": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadRate": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiBurnout": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCapacityConstraint": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCurveSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiFHAToConventional": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMediaEffect": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftAgeDecayMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverLockin": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "upfrontMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        }
                    },
                    "settings": {
                        "cmoGeographicInfoFlag": bool,
                        "commingledSuperAsFNFlag": bool,
                        "cprAdjustment": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "currentCouponSpreadAdjustment": 0.0,
                        "delinquencyResolutionPeriod": 0,
                        "fnmaModelForALTALoansFlag": bool,
                        "fnmaModelForGNMALoansFlag": bool,
                        "fnmaModelForWholeLoansFlag": bool,
                        "harpCutoffDate": "str",
                        "homePriceAppreciation": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ignoreCurrentDelinquencyFlag": bool,
                        "ignoreDTIDispersionFlag": bool,
                        "ignoreDisclosureInfo": bool,
                        "ignoreFICODispersionFlag": bool,
                        "ignoreHousingInflationFlag": bool,
                        "ignoreLTVDispersionFlag": bool,
                        "ignoreModelHPAScenarioFlag": bool,
                        "ignoreSSHPAFlag": bool,
                        "ignoreSSUserHPAFlag": bool,
                        "ignoreServicerFlag": bool,
                        "ignoreWACDispersionFlag": bool,
                        "ignoreWALADispersionFlag": bool,
                        "psSpreadLookback": 0,
                        "psSpreadModelFlag": bool,
                        "shortTermPrepayAdjustmentFlag": bool,
                        "stateHomePriceAppreciation": [
                            {
                                "homePriceAppreciation": {
                                    "interpolationType": "LINEAR",
                                    "vector": [
                                        {
                                            "term": 0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "hpaState": "AL"
                            }
                        ],
                        "termUnit": "MONTH",
                        "unemploymentProjection": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "useLPHPAFlag": bool
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.UserCurve,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.UserCurve
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "asof": "str",
                    "compoundingFreq": 0,
                    "currency": "str",
                    "curveType": "GVT",
                    "points": [
                        {
                            "rate": 0.0,
                            "term": 0.0
                        }
                    ],
                    "rateType": "Spot",
                    "relative": bool,
                    "source": "str",
                    "swapFixedDayType": "str",
                    "swapFloatDayType": "str",
                    "swapIndex": "str",
                    "swapResetConvention": "str",
                    "validate": bool
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.UserVol,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.UserVol
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "asof": "str",
                    "capVolatility": [
                        {
                            "expiration": 0.0,
                            "term": 0.0,
                            "value": 0.0
                        }
                    ],
                    "currency": "str",
                    "shiftType": "str",
                    "swaptionVolatility": [
                        {
                            "expiration": 0.0,
                            "term": 0.0,
                            "value": 0.0
                        }
                    ],
                    "termUnit": "MONTH",
                    "volatilityType": "str"
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.CMOModification,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.CMOModification
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "class": {
                        "classAmount": 0.0,
                        "currentCoupon": 0.0,
                        "ignoreAmount": 0.0,
                        "index": "str",
                        "leverage": 0.0,
                        "lifeCap": 0.0,
                        "lifeFloor": 0.0,
                        "modifyClassCalcType": "str",
                        "modifyInterestFlag": bool,
                        "notionalFlag": bool,
                        "paymentDayOfMonth": 0,
                        "paymentDelay": 0,
                        "resetMargin": 0.0
                    },
                    "collateral": {
                        "str": {
                            "adjustedCurrentLoanSize": 0.0,
                            "adjustedLTV": 0.0,
                            "adjustedOriginalLoanSize": 0.0,
                            "adjustedSpreadAtOrigination": 0.0,
                            "cleanPayMonths": 0,
                            "collateralNetCoupon": 0.0,
                            "combinedLTV": 0.0,
                            "creditScore": 0,
                            "current3RdPartyOrigination": 0.0,
                            "currentLTV": 0.0,
                            "forbearanceAmount": 0.0,
                            "forbearanceModification": 0.0,
                            "grossWAC": 0.0,
                            "loanAge": 0,
                            "loanPurposeCashout": 0.0,
                            "ltv": 0.0,
                            "modifyCollateralType": "str",
                            "newCurrentLoanSize": 0.0,
                            "newOriginalLoanSize": 0.0,
                            "occupancySecondHome": 0.0,
                            "originalWeightedAvgLoanSize": 0.0,
                            "originationChannel": {
                                "broker": 0.0,
                                "correspondence": 0.0,
                                "retail": 0.0,
                                "unspecified": 0.0
                            },
                            "percent2To4Unit": 0.0,
                            "percentDTI": 0.0,
                            "percentFHA": 0.0,
                            "percentFirstTimeHomeBuyer": 0.0,
                            "percentHAMPMods": 0.0,
                            "percentHARP": 0.0,
                            "percentHARP2": 0.0,
                            "percentHomeReadyHomePossible": 0.0,
                            "percentInv": 0.0,
                            "percentPIH": 0.0,
                            "percentPIWAppraisal": 0.0,
                            "percentPIWGSERefinance": 0.0,
                            "percentPIWOnsiteAVM": 0.0,
                            "percentPIWWaiver": 0.0,
                            "percentPaymentReduction": 0.0,
                            "percentPrevLossMitigation": 0.0,
                            "percentRH": 0.0,
                            "percentRefi": 0.0,
                            "percentRegularMods": 0.0,
                            "percentReperformer": 0.0,
                            "percentRetail": 0.0,
                            "percentStateHFA": 0.0,
                            "percentUnspecified": 0.0,
                            "percentVA": 0.0,
                            "permanentJumboFrac": 0.0,
                            "postModificationCreditScore": 0.0,
                            "postModificationLTV": 0.0,
                            "prepayModelSeller": [
                                {
                                    "percent": 0.0,
                                    "seller": "str"
                                }
                            ],
                            "prepayModelServicer": [
                                {
                                    "percent": 0.0,
                                    "servicer": "str"
                                }
                            ],
                            "reperformerMonths": 0,
                            "secondLienFrac": 0.0,
                            "spreadAtOrigination": 0.0,
                            "unitsMulti": 0.0,
                            "weightedAvgLoanSize": 0.0
                        }
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.UserScenarioInput,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.UserScenarioInput
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "curve": {
                        "currentCouponSpreadChange": 0.0,
                        "definition": {
                            "userScenario": {
                                "curveMultiShifts": [
                                    {
                                        "curveShifts": [
                                            {
                                                "value": 0.0,
                                                "year": 0.0
                                            }
                                        ],
                                        "period": 0.0
                                    }
                                ],
                                "curvePoints": [
                                    {
                                        "discountFactor": 0.0,
                                        "forwardRate": 0.0,
                                        "rate": 0.0,
                                        "spotRate": 0.0,
                                        "term": 0.0
                                    }
                                ],
                                "curveShifts": [
                                    {
                                        "value": 0.0,
                                        "year": 0.0
                                    }
                                ],
                                "interpolationType": "Years",
                                "shiftType": "Forward",
                                "swapSpreadConst": bool
                            }
                        },
                        "reinvestmentRate": "str",
                        "timing": "Immediate"
                    },
                    "volatility": {
                        "capVolatility": {
                            "valueType": "ABS",
                            "values": [
                                {
                                    "expiration": 0.0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "parallelShift": 0.0,
                        "swaptionVolatility": {
                            "valueType": "ABS",
                            "values": [
                                {
                                    "expiration": 0.0,
                                    "term": 0.0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "termUnit": "MONTH",
                        "valueType": "ABS"
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.DataTable,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.DataTable
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "columnDetails": [
                        {
                            "field": "str",
                            "format": "str",
                            "header": "str"
                        }
                    ],
                    "data": [
                        {
                            "str": {}
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.YBPortUserBond,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.YBPortUserBond
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "distribution": {
                        "servicer": {
                            "str": 0.0
                        },
                        "state": {
                            "str": 0.0
                        }
                    },
                    "extends": {
                        "identifier": "str"
                    },
                    "id": "str",
                    "indic": {
                        "str": {}
                    },
                    "schedule": {
                        "str": [
                            {
                                "date": "2020-02-20",
                                "value": 0.0
                            }
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def upload_json_job_data_with_name_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: "_types.JobStoreInputData",
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Async upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Is one of the following types: PrepayDialsInput, UserCurve, UserVol,
         CMOModification, UserScenarioInput, DataTable, YBPortUserBond Required.
        :type data: ~analyticsapi.models.PrepayDialsInput or ~analyticsapi.models.UserCurve or
         ~analyticsapi.models.UserVol or ~analyticsapi.models.CMOModification or
         ~analyticsapi.models.UserScenarioInput or ~analyticsapi.models.DataTable or
         ~analyticsapi.models.YBPortUserBond
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "dials": {
                        "agencyEligibility": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "annualMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "armSpikeHeight": 0.0,
                        "armSpikeLength": 0.0,
                        "brokerCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveSlope": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashouts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "creditScoreBase": 0.0,
                        "creditScoreSlope": 0.0,
                        "curtailmentMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "defaultMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ioSpikeElbow": 0.0,
                        "ioSpikeHeight": 0.0,
                        "ioSpikeLength": 0.0,
                        "loanSizeBase": 0.0,
                        "loanSizeSlope": 0.0,
                        "loanToValueBase": 0.0,
                        "loanToValueSlope": 0.0,
                        "onlineRefiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepayVectorShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepaymentDecay": 0.0,
                        "propertyInspectionWaiverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadFloor": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadRate": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiBurnout": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCapacityConstraint": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCurveSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiFHAToConventional": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMediaEffect": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftAgeDecayMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverLockin": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "upfrontMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        }
                    },
                    "settings": {
                        "cmoGeographicInfoFlag": bool,
                        "commingledSuperAsFNFlag": bool,
                        "cprAdjustment": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "currentCouponSpreadAdjustment": 0.0,
                        "delinquencyResolutionPeriod": 0,
                        "fnmaModelForALTALoansFlag": bool,
                        "fnmaModelForGNMALoansFlag": bool,
                        "fnmaModelForWholeLoansFlag": bool,
                        "harpCutoffDate": "str",
                        "homePriceAppreciation": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ignoreCurrentDelinquencyFlag": bool,
                        "ignoreDTIDispersionFlag": bool,
                        "ignoreDisclosureInfo": bool,
                        "ignoreFICODispersionFlag": bool,
                        "ignoreHousingInflationFlag": bool,
                        "ignoreLTVDispersionFlag": bool,
                        "ignoreModelHPAScenarioFlag": bool,
                        "ignoreSSHPAFlag": bool,
                        "ignoreSSUserHPAFlag": bool,
                        "ignoreServicerFlag": bool,
                        "ignoreWACDispersionFlag": bool,
                        "ignoreWALADispersionFlag": bool,
                        "psSpreadLookback": 0,
                        "psSpreadModelFlag": bool,
                        "shortTermPrepayAdjustmentFlag": bool,
                        "stateHomePriceAppreciation": [
                            {
                                "homePriceAppreciation": {
                                    "interpolationType": "LINEAR",
                                    "vector": [
                                        {
                                            "term": 0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "hpaState": "AL"
                            }
                        ],
                        "termUnit": "MONTH",
                        "unemploymentProjection": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "useLPHPAFlag": bool
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(data, _models.PrepayDialsInput):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserCurve):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserVol):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.CMOModification):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserScenarioInput):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.DataTable):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.YBPortUserBond):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_upload_json_job_data_with_name_async_request(
            job=job,
            store_type=store_type,
            request_name=request_name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def upload_csv_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: str,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload csv job with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/csv"))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _content = data

        _request = build_yield_book_rest_upload_csv_job_data_with_name_sync_request(
            job=job,
            store_type=store_type,
            request_name=request_name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def upload_text_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: str,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload text job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/plain"))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _content = data

        _request = build_yield_book_rest_upload_text_job_data_with_name_sync_request(
            job=job,
            store_type=store_type,
            request_name=request_name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def upload_json_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.PrepayDialsInput,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.PrepayDialsInput
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "dials": {
                        "agencyEligibility": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "annualMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "armSpikeHeight": 0.0,
                        "armSpikeLength": 0.0,
                        "brokerCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveSlope": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashouts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "creditScoreBase": 0.0,
                        "creditScoreSlope": 0.0,
                        "curtailmentMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "defaultMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ioSpikeElbow": 0.0,
                        "ioSpikeHeight": 0.0,
                        "ioSpikeLength": 0.0,
                        "loanSizeBase": 0.0,
                        "loanSizeSlope": 0.0,
                        "loanToValueBase": 0.0,
                        "loanToValueSlope": 0.0,
                        "onlineRefiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepayVectorShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepaymentDecay": 0.0,
                        "propertyInspectionWaiverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadFloor": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadRate": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiBurnout": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCapacityConstraint": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCurveSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiFHAToConventional": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMediaEffect": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftAgeDecayMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverLockin": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "upfrontMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        }
                    },
                    "settings": {
                        "cmoGeographicInfoFlag": bool,
                        "commingledSuperAsFNFlag": bool,
                        "cprAdjustment": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "currentCouponSpreadAdjustment": 0.0,
                        "delinquencyResolutionPeriod": 0,
                        "fnmaModelForALTALoansFlag": bool,
                        "fnmaModelForGNMALoansFlag": bool,
                        "fnmaModelForWholeLoansFlag": bool,
                        "harpCutoffDate": "str",
                        "homePriceAppreciation": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ignoreCurrentDelinquencyFlag": bool,
                        "ignoreDTIDispersionFlag": bool,
                        "ignoreDisclosureInfo": bool,
                        "ignoreFICODispersionFlag": bool,
                        "ignoreHousingInflationFlag": bool,
                        "ignoreLTVDispersionFlag": bool,
                        "ignoreModelHPAScenarioFlag": bool,
                        "ignoreSSHPAFlag": bool,
                        "ignoreSSUserHPAFlag": bool,
                        "ignoreServicerFlag": bool,
                        "ignoreWACDispersionFlag": bool,
                        "ignoreWALADispersionFlag": bool,
                        "psSpreadLookback": 0,
                        "psSpreadModelFlag": bool,
                        "shortTermPrepayAdjustmentFlag": bool,
                        "stateHomePriceAppreciation": [
                            {
                                "homePriceAppreciation": {
                                    "interpolationType": "LINEAR",
                                    "vector": [
                                        {
                                            "term": 0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "hpaState": "AL"
                            }
                        ],
                        "termUnit": "MONTH",
                        "unemploymentProjection": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "useLPHPAFlag": bool
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.UserCurve,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.UserCurve
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "asof": "str",
                    "compoundingFreq": 0,
                    "currency": "str",
                    "curveType": "GVT",
                    "points": [
                        {
                            "rate": 0.0,
                            "term": 0.0
                        }
                    ],
                    "rateType": "Spot",
                    "relative": bool,
                    "source": "str",
                    "swapFixedDayType": "str",
                    "swapFloatDayType": "str",
                    "swapIndex": "str",
                    "swapResetConvention": "str",
                    "validate": bool
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.UserVol,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.UserVol
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "asof": "str",
                    "capVolatility": [
                        {
                            "expiration": 0.0,
                            "term": 0.0,
                            "value": 0.0
                        }
                    ],
                    "currency": "str",
                    "shiftType": "str",
                    "swaptionVolatility": [
                        {
                            "expiration": 0.0,
                            "term": 0.0,
                            "value": 0.0
                        }
                    ],
                    "termUnit": "MONTH",
                    "volatilityType": "str"
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.CMOModification,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.CMOModification
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "class": {
                        "classAmount": 0.0,
                        "currentCoupon": 0.0,
                        "ignoreAmount": 0.0,
                        "index": "str",
                        "leverage": 0.0,
                        "lifeCap": 0.0,
                        "lifeFloor": 0.0,
                        "modifyClassCalcType": "str",
                        "modifyInterestFlag": bool,
                        "notionalFlag": bool,
                        "paymentDayOfMonth": 0,
                        "paymentDelay": 0,
                        "resetMargin": 0.0
                    },
                    "collateral": {
                        "str": {
                            "adjustedCurrentLoanSize": 0.0,
                            "adjustedLTV": 0.0,
                            "adjustedOriginalLoanSize": 0.0,
                            "adjustedSpreadAtOrigination": 0.0,
                            "cleanPayMonths": 0,
                            "collateralNetCoupon": 0.0,
                            "combinedLTV": 0.0,
                            "creditScore": 0,
                            "current3RdPartyOrigination": 0.0,
                            "currentLTV": 0.0,
                            "forbearanceAmount": 0.0,
                            "forbearanceModification": 0.0,
                            "grossWAC": 0.0,
                            "loanAge": 0,
                            "loanPurposeCashout": 0.0,
                            "ltv": 0.0,
                            "modifyCollateralType": "str",
                            "newCurrentLoanSize": 0.0,
                            "newOriginalLoanSize": 0.0,
                            "occupancySecondHome": 0.0,
                            "originalWeightedAvgLoanSize": 0.0,
                            "originationChannel": {
                                "broker": 0.0,
                                "correspondence": 0.0,
                                "retail": 0.0,
                                "unspecified": 0.0
                            },
                            "percent2To4Unit": 0.0,
                            "percentDTI": 0.0,
                            "percentFHA": 0.0,
                            "percentFirstTimeHomeBuyer": 0.0,
                            "percentHAMPMods": 0.0,
                            "percentHARP": 0.0,
                            "percentHARP2": 0.0,
                            "percentHomeReadyHomePossible": 0.0,
                            "percentInv": 0.0,
                            "percentPIH": 0.0,
                            "percentPIWAppraisal": 0.0,
                            "percentPIWGSERefinance": 0.0,
                            "percentPIWOnsiteAVM": 0.0,
                            "percentPIWWaiver": 0.0,
                            "percentPaymentReduction": 0.0,
                            "percentPrevLossMitigation": 0.0,
                            "percentRH": 0.0,
                            "percentRefi": 0.0,
                            "percentRegularMods": 0.0,
                            "percentReperformer": 0.0,
                            "percentRetail": 0.0,
                            "percentStateHFA": 0.0,
                            "percentUnspecified": 0.0,
                            "percentVA": 0.0,
                            "permanentJumboFrac": 0.0,
                            "postModificationCreditScore": 0.0,
                            "postModificationLTV": 0.0,
                            "prepayModelSeller": [
                                {
                                    "percent": 0.0,
                                    "seller": "str"
                                }
                            ],
                            "prepayModelServicer": [
                                {
                                    "percent": 0.0,
                                    "servicer": "str"
                                }
                            ],
                            "reperformerMonths": 0,
                            "secondLienFrac": 0.0,
                            "spreadAtOrigination": 0.0,
                            "unitsMulti": 0.0,
                            "weightedAvgLoanSize": 0.0
                        }
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.UserScenarioInput,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.UserScenarioInput
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "curve": {
                        "currentCouponSpreadChange": 0.0,
                        "definition": {
                            "userScenario": {
                                "curveMultiShifts": [
                                    {
                                        "curveShifts": [
                                            {
                                                "value": 0.0,
                                                "year": 0.0
                                            }
                                        ],
                                        "period": 0.0
                                    }
                                ],
                                "curvePoints": [
                                    {
                                        "discountFactor": 0.0,
                                        "forwardRate": 0.0,
                                        "rate": 0.0,
                                        "spotRate": 0.0,
                                        "term": 0.0
                                    }
                                ],
                                "curveShifts": [
                                    {
                                        "value": 0.0,
                                        "year": 0.0
                                    }
                                ],
                                "interpolationType": "Years",
                                "shiftType": "Forward",
                                "swapSpreadConst": bool
                            }
                        },
                        "reinvestmentRate": "str",
                        "timing": "Immediate"
                    },
                    "volatility": {
                        "capVolatility": {
                            "valueType": "ABS",
                            "values": [
                                {
                                    "expiration": 0.0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "parallelShift": 0.0,
                        "swaptionVolatility": {
                            "valueType": "ABS",
                            "values": [
                                {
                                    "expiration": 0.0,
                                    "term": 0.0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "termUnit": "MONTH",
                        "valueType": "ABS"
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.DataTable,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.DataTable
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "columnDetails": [
                        {
                            "field": "str",
                            "format": "str",
                            "header": "str"
                        }
                    ],
                    "data": [
                        {
                            "str": {}
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: _models.YBPortUserBond,
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Required.
        :type data: ~analyticsapi.models.YBPortUserBond
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "distribution": {
                        "servicer": {
                            "str": 0.0
                        },
                        "state": {
                            "str": 0.0
                        }
                    },
                    "extends": {
                        "identifier": "str"
                    },
                    "id": "str",
                    "indic": {
                        "str": {}
                    },
                    "schedule": {
                        "str": [
                            {
                                "date": "2020-02-20",
                                "value": 0.0
                            }
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def upload_json_job_data_with_name_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        request_name: str,
        data: "_types.JobStoreInputData",
        *,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Sync upload json job data with a user-provided name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: User provided name for the request. Required.
        :type request_name: str
        :param data: Is one of the following types: PrepayDialsInput, UserCurve, UserVol,
         CMOModification, UserScenarioInput, DataTable, YBPortUserBond Required.
        :type data: ~analyticsapi.models.PrepayDialsInput or ~analyticsapi.models.UserCurve or
         ~analyticsapi.models.UserVol or ~analyticsapi.models.CMOModification or
         ~analyticsapi.models.UserScenarioInput or ~analyticsapi.models.DataTable or
         ~analyticsapi.models.YBPortUserBond
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "dials": {
                        "agencyEligibility": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "annualMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "armSpikeHeight": 0.0,
                        "armSpikeLength": 0.0,
                        "brokerCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveSlope": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashouts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "creditScoreBase": 0.0,
                        "creditScoreSlope": 0.0,
                        "curtailmentMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "defaultMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ioSpikeElbow": 0.0,
                        "ioSpikeHeight": 0.0,
                        "ioSpikeLength": 0.0,
                        "loanSizeBase": 0.0,
                        "loanSizeSlope": 0.0,
                        "loanToValueBase": 0.0,
                        "loanToValueSlope": 0.0,
                        "onlineRefiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepayVectorShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepaymentDecay": 0.0,
                        "propertyInspectionWaiverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadFloor": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadRate": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiBurnout": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCapacityConstraint": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCurveSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiFHAToConventional": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMediaEffect": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftAgeDecayMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverLockin": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "upfrontMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        }
                    },
                    "settings": {
                        "cmoGeographicInfoFlag": bool,
                        "commingledSuperAsFNFlag": bool,
                        "cprAdjustment": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "currentCouponSpreadAdjustment": 0.0,
                        "delinquencyResolutionPeriod": 0,
                        "fnmaModelForALTALoansFlag": bool,
                        "fnmaModelForGNMALoansFlag": bool,
                        "fnmaModelForWholeLoansFlag": bool,
                        "harpCutoffDate": "str",
                        "homePriceAppreciation": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ignoreCurrentDelinquencyFlag": bool,
                        "ignoreDTIDispersionFlag": bool,
                        "ignoreDisclosureInfo": bool,
                        "ignoreFICODispersionFlag": bool,
                        "ignoreHousingInflationFlag": bool,
                        "ignoreLTVDispersionFlag": bool,
                        "ignoreModelHPAScenarioFlag": bool,
                        "ignoreSSHPAFlag": bool,
                        "ignoreSSUserHPAFlag": bool,
                        "ignoreServicerFlag": bool,
                        "ignoreWACDispersionFlag": bool,
                        "ignoreWALADispersionFlag": bool,
                        "psSpreadLookback": 0,
                        "psSpreadModelFlag": bool,
                        "shortTermPrepayAdjustmentFlag": bool,
                        "stateHomePriceAppreciation": [
                            {
                                "homePriceAppreciation": {
                                    "interpolationType": "LINEAR",
                                    "vector": [
                                        {
                                            "term": 0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "hpaState": "AL"
                            }
                        ],
                        "termUnit": "MONTH",
                        "unemploymentProjection": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "useLPHPAFlag": bool
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(data, _models.PrepayDialsInput):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserCurve):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserVol):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.CMOModification):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserScenarioInput):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.DataTable):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.YBPortUserBond):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_upload_json_job_data_with_name_sync_request(
            job=job,
            store_type=store_type,
            request_name=request_name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def upload_csv_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: str,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload csv job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: str
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/csv"))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _content = data

        _request = build_yield_book_rest_upload_csv_job_data_async_request(
            job=job,
            store_type=store_type,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def upload_text_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: str,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload text job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: str
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/plain"))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _content = data

        _request = build_yield_book_rest_upload_text_job_data_async_request(
            job=job,
            store_type=store_type,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def upload_json_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.PrepayDialsInput,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.PrepayDialsInput
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "dials": {
                        "agencyEligibility": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "annualMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "armSpikeHeight": 0.0,
                        "armSpikeLength": 0.0,
                        "brokerCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveSlope": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashouts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "creditScoreBase": 0.0,
                        "creditScoreSlope": 0.0,
                        "curtailmentMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "defaultMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ioSpikeElbow": 0.0,
                        "ioSpikeHeight": 0.0,
                        "ioSpikeLength": 0.0,
                        "loanSizeBase": 0.0,
                        "loanSizeSlope": 0.0,
                        "loanToValueBase": 0.0,
                        "loanToValueSlope": 0.0,
                        "onlineRefiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepayVectorShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepaymentDecay": 0.0,
                        "propertyInspectionWaiverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadFloor": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadRate": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiBurnout": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCapacityConstraint": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCurveSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiFHAToConventional": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMediaEffect": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftAgeDecayMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverLockin": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "upfrontMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        }
                    },
                    "settings": {
                        "cmoGeographicInfoFlag": bool,
                        "commingledSuperAsFNFlag": bool,
                        "cprAdjustment": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "currentCouponSpreadAdjustment": 0.0,
                        "delinquencyResolutionPeriod": 0,
                        "fnmaModelForALTALoansFlag": bool,
                        "fnmaModelForGNMALoansFlag": bool,
                        "fnmaModelForWholeLoansFlag": bool,
                        "harpCutoffDate": "str",
                        "homePriceAppreciation": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ignoreCurrentDelinquencyFlag": bool,
                        "ignoreDTIDispersionFlag": bool,
                        "ignoreDisclosureInfo": bool,
                        "ignoreFICODispersionFlag": bool,
                        "ignoreHousingInflationFlag": bool,
                        "ignoreLTVDispersionFlag": bool,
                        "ignoreModelHPAScenarioFlag": bool,
                        "ignoreSSHPAFlag": bool,
                        "ignoreSSUserHPAFlag": bool,
                        "ignoreServicerFlag": bool,
                        "ignoreWACDispersionFlag": bool,
                        "ignoreWALADispersionFlag": bool,
                        "psSpreadLookback": 0,
                        "psSpreadModelFlag": bool,
                        "shortTermPrepayAdjustmentFlag": bool,
                        "stateHomePriceAppreciation": [
                            {
                                "homePriceAppreciation": {
                                    "interpolationType": "LINEAR",
                                    "vector": [
                                        {
                                            "term": 0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "hpaState": "AL"
                            }
                        ],
                        "termUnit": "MONTH",
                        "unemploymentProjection": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "useLPHPAFlag": bool
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.UserCurve,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.UserCurve
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "asof": "str",
                    "compoundingFreq": 0,
                    "currency": "str",
                    "curveType": "GVT",
                    "points": [
                        {
                            "rate": 0.0,
                            "term": 0.0
                        }
                    ],
                    "rateType": "Spot",
                    "relative": bool,
                    "source": "str",
                    "swapFixedDayType": "str",
                    "swapFloatDayType": "str",
                    "swapIndex": "str",
                    "swapResetConvention": "str",
                    "validate": bool
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.UserVol,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.UserVol
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "asof": "str",
                    "capVolatility": [
                        {
                            "expiration": 0.0,
                            "term": 0.0,
                            "value": 0.0
                        }
                    ],
                    "currency": "str",
                    "shiftType": "str",
                    "swaptionVolatility": [
                        {
                            "expiration": 0.0,
                            "term": 0.0,
                            "value": 0.0
                        }
                    ],
                    "termUnit": "MONTH",
                    "volatilityType": "str"
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.CMOModification,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.CMOModification
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "class": {
                        "classAmount": 0.0,
                        "currentCoupon": 0.0,
                        "ignoreAmount": 0.0,
                        "index": "str",
                        "leverage": 0.0,
                        "lifeCap": 0.0,
                        "lifeFloor": 0.0,
                        "modifyClassCalcType": "str",
                        "modifyInterestFlag": bool,
                        "notionalFlag": bool,
                        "paymentDayOfMonth": 0,
                        "paymentDelay": 0,
                        "resetMargin": 0.0
                    },
                    "collateral": {
                        "str": {
                            "adjustedCurrentLoanSize": 0.0,
                            "adjustedLTV": 0.0,
                            "adjustedOriginalLoanSize": 0.0,
                            "adjustedSpreadAtOrigination": 0.0,
                            "cleanPayMonths": 0,
                            "collateralNetCoupon": 0.0,
                            "combinedLTV": 0.0,
                            "creditScore": 0,
                            "current3RdPartyOrigination": 0.0,
                            "currentLTV": 0.0,
                            "forbearanceAmount": 0.0,
                            "forbearanceModification": 0.0,
                            "grossWAC": 0.0,
                            "loanAge": 0,
                            "loanPurposeCashout": 0.0,
                            "ltv": 0.0,
                            "modifyCollateralType": "str",
                            "newCurrentLoanSize": 0.0,
                            "newOriginalLoanSize": 0.0,
                            "occupancySecondHome": 0.0,
                            "originalWeightedAvgLoanSize": 0.0,
                            "originationChannel": {
                                "broker": 0.0,
                                "correspondence": 0.0,
                                "retail": 0.0,
                                "unspecified": 0.0
                            },
                            "percent2To4Unit": 0.0,
                            "percentDTI": 0.0,
                            "percentFHA": 0.0,
                            "percentFirstTimeHomeBuyer": 0.0,
                            "percentHAMPMods": 0.0,
                            "percentHARP": 0.0,
                            "percentHARP2": 0.0,
                            "percentHomeReadyHomePossible": 0.0,
                            "percentInv": 0.0,
                            "percentPIH": 0.0,
                            "percentPIWAppraisal": 0.0,
                            "percentPIWGSERefinance": 0.0,
                            "percentPIWOnsiteAVM": 0.0,
                            "percentPIWWaiver": 0.0,
                            "percentPaymentReduction": 0.0,
                            "percentPrevLossMitigation": 0.0,
                            "percentRH": 0.0,
                            "percentRefi": 0.0,
                            "percentRegularMods": 0.0,
                            "percentReperformer": 0.0,
                            "percentRetail": 0.0,
                            "percentStateHFA": 0.0,
                            "percentUnspecified": 0.0,
                            "percentVA": 0.0,
                            "permanentJumboFrac": 0.0,
                            "postModificationCreditScore": 0.0,
                            "postModificationLTV": 0.0,
                            "prepayModelSeller": [
                                {
                                    "percent": 0.0,
                                    "seller": "str"
                                }
                            ],
                            "prepayModelServicer": [
                                {
                                    "percent": 0.0,
                                    "servicer": "str"
                                }
                            ],
                            "reperformerMonths": 0,
                            "secondLienFrac": 0.0,
                            "spreadAtOrigination": 0.0,
                            "unitsMulti": 0.0,
                            "weightedAvgLoanSize": 0.0
                        }
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.UserScenarioInput,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.UserScenarioInput
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "curve": {
                        "currentCouponSpreadChange": 0.0,
                        "definition": {
                            "userScenario": {
                                "curveMultiShifts": [
                                    {
                                        "curveShifts": [
                                            {
                                                "value": 0.0,
                                                "year": 0.0
                                            }
                                        ],
                                        "period": 0.0
                                    }
                                ],
                                "curvePoints": [
                                    {
                                        "discountFactor": 0.0,
                                        "forwardRate": 0.0,
                                        "rate": 0.0,
                                        "spotRate": 0.0,
                                        "term": 0.0
                                    }
                                ],
                                "curveShifts": [
                                    {
                                        "value": 0.0,
                                        "year": 0.0
                                    }
                                ],
                                "interpolationType": "Years",
                                "shiftType": "Forward",
                                "swapSpreadConst": bool
                            }
                        },
                        "reinvestmentRate": "str",
                        "timing": "Immediate"
                    },
                    "volatility": {
                        "capVolatility": {
                            "valueType": "ABS",
                            "values": [
                                {
                                    "expiration": 0.0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "parallelShift": 0.0,
                        "swaptionVolatility": {
                            "valueType": "ABS",
                            "values": [
                                {
                                    "expiration": 0.0,
                                    "term": 0.0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "termUnit": "MONTH",
                        "valueType": "ABS"
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.DataTable,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.DataTable
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "columnDetails": [
                        {
                            "field": "str",
                            "format": "str",
                            "header": "str"
                        }
                    ],
                    "data": [
                        {
                            "str": {}
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.YBPortUserBond,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.YBPortUserBond
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "distribution": {
                        "servicer": {
                            "str": 0.0
                        },
                        "state": {
                            "str": 0.0
                        }
                    },
                    "extends": {
                        "identifier": "str"
                    },
                    "id": "str",
                    "indic": {
                        "str": {}
                    },
                    "schedule": {
                        "str": [
                            {
                                "date": "2020-02-20",
                                "value": 0.0
                            }
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def upload_json_job_data_async(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: "_types.JobStoreInputData",
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Async upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Is one of the following types: PrepayDialsInput, UserCurve, UserVol,
         CMOModification, UserScenarioInput, DataTable, YBPortUserBond Required.
        :type data: ~analyticsapi.models.PrepayDialsInput or ~analyticsapi.models.UserCurve or
         ~analyticsapi.models.UserVol or ~analyticsapi.models.CMOModification or
         ~analyticsapi.models.UserScenarioInput or ~analyticsapi.models.DataTable or
         ~analyticsapi.models.YBPortUserBond
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "dials": {
                        "agencyEligibility": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "annualMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "armSpikeHeight": 0.0,
                        "armSpikeLength": 0.0,
                        "brokerCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveSlope": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashouts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "creditScoreBase": 0.0,
                        "creditScoreSlope": 0.0,
                        "curtailmentMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "defaultMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ioSpikeElbow": 0.0,
                        "ioSpikeHeight": 0.0,
                        "ioSpikeLength": 0.0,
                        "loanSizeBase": 0.0,
                        "loanSizeSlope": 0.0,
                        "loanToValueBase": 0.0,
                        "loanToValueSlope": 0.0,
                        "onlineRefiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepayVectorShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepaymentDecay": 0.0,
                        "propertyInspectionWaiverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadFloor": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadRate": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiBurnout": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCapacityConstraint": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCurveSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiFHAToConventional": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMediaEffect": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftAgeDecayMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverLockin": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "upfrontMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        }
                    },
                    "settings": {
                        "cmoGeographicInfoFlag": bool,
                        "commingledSuperAsFNFlag": bool,
                        "cprAdjustment": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "currentCouponSpreadAdjustment": 0.0,
                        "delinquencyResolutionPeriod": 0,
                        "fnmaModelForALTALoansFlag": bool,
                        "fnmaModelForGNMALoansFlag": bool,
                        "fnmaModelForWholeLoansFlag": bool,
                        "harpCutoffDate": "str",
                        "homePriceAppreciation": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ignoreCurrentDelinquencyFlag": bool,
                        "ignoreDTIDispersionFlag": bool,
                        "ignoreDisclosureInfo": bool,
                        "ignoreFICODispersionFlag": bool,
                        "ignoreHousingInflationFlag": bool,
                        "ignoreLTVDispersionFlag": bool,
                        "ignoreModelHPAScenarioFlag": bool,
                        "ignoreSSHPAFlag": bool,
                        "ignoreSSUserHPAFlag": bool,
                        "ignoreServicerFlag": bool,
                        "ignoreWACDispersionFlag": bool,
                        "ignoreWALADispersionFlag": bool,
                        "psSpreadLookback": 0,
                        "psSpreadModelFlag": bool,
                        "shortTermPrepayAdjustmentFlag": bool,
                        "stateHomePriceAppreciation": [
                            {
                                "homePriceAppreciation": {
                                    "interpolationType": "LINEAR",
                                    "vector": [
                                        {
                                            "term": 0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "hpaState": "AL"
                            }
                        ],
                        "termUnit": "MONTH",
                        "unemploymentProjection": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "useLPHPAFlag": bool
                    }
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(data, _models.PrepayDialsInput):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserCurve):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserVol):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.CMOModification):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserScenarioInput):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.DataTable):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.YBPortUserBond):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_upload_json_job_data_async_request(
            job=job,
            store_type=store_type,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def upload_csv_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: str,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload csv job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: str
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/csv"))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _content = data

        _request = build_yield_book_rest_upload_csv_job_data_sync_request(
            job=job,
            store_type=store_type,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def upload_text_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: str,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload text job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: str
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/plain"))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _content = data

        _request = build_yield_book_rest_upload_text_job_data_sync_request(
            job=job,
            store_type=store_type,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def upload_json_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.PrepayDialsInput,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.PrepayDialsInput
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "dials": {
                        "agencyEligibility": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "annualMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "armSpikeHeight": 0.0,
                        "armSpikeLength": 0.0,
                        "brokerCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveSlope": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashouts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "creditScoreBase": 0.0,
                        "creditScoreSlope": 0.0,
                        "curtailmentMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "defaultMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ioSpikeElbow": 0.0,
                        "ioSpikeHeight": 0.0,
                        "ioSpikeLength": 0.0,
                        "loanSizeBase": 0.0,
                        "loanSizeSlope": 0.0,
                        "loanToValueBase": 0.0,
                        "loanToValueSlope": 0.0,
                        "onlineRefiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepayVectorShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepaymentDecay": 0.0,
                        "propertyInspectionWaiverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadFloor": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadRate": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiBurnout": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCapacityConstraint": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCurveSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiFHAToConventional": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMediaEffect": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftAgeDecayMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverLockin": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "upfrontMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        }
                    },
                    "settings": {
                        "cmoGeographicInfoFlag": bool,
                        "commingledSuperAsFNFlag": bool,
                        "cprAdjustment": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "currentCouponSpreadAdjustment": 0.0,
                        "delinquencyResolutionPeriod": 0,
                        "fnmaModelForALTALoansFlag": bool,
                        "fnmaModelForGNMALoansFlag": bool,
                        "fnmaModelForWholeLoansFlag": bool,
                        "harpCutoffDate": "str",
                        "homePriceAppreciation": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ignoreCurrentDelinquencyFlag": bool,
                        "ignoreDTIDispersionFlag": bool,
                        "ignoreDisclosureInfo": bool,
                        "ignoreFICODispersionFlag": bool,
                        "ignoreHousingInflationFlag": bool,
                        "ignoreLTVDispersionFlag": bool,
                        "ignoreModelHPAScenarioFlag": bool,
                        "ignoreSSHPAFlag": bool,
                        "ignoreSSUserHPAFlag": bool,
                        "ignoreServicerFlag": bool,
                        "ignoreWACDispersionFlag": bool,
                        "ignoreWALADispersionFlag": bool,
                        "psSpreadLookback": 0,
                        "psSpreadModelFlag": bool,
                        "shortTermPrepayAdjustmentFlag": bool,
                        "stateHomePriceAppreciation": [
                            {
                                "homePriceAppreciation": {
                                    "interpolationType": "LINEAR",
                                    "vector": [
                                        {
                                            "term": 0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "hpaState": "AL"
                            }
                        ],
                        "termUnit": "MONTH",
                        "unemploymentProjection": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "useLPHPAFlag": bool
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.UserCurve,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.UserCurve
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "asof": "str",
                    "compoundingFreq": 0,
                    "currency": "str",
                    "curveType": "GVT",
                    "points": [
                        {
                            "rate": 0.0,
                            "term": 0.0
                        }
                    ],
                    "rateType": "Spot",
                    "relative": bool,
                    "source": "str",
                    "swapFixedDayType": "str",
                    "swapFloatDayType": "str",
                    "swapIndex": "str",
                    "swapResetConvention": "str",
                    "validate": bool
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.UserVol,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.UserVol
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "asof": "str",
                    "capVolatility": [
                        {
                            "expiration": 0.0,
                            "term": 0.0,
                            "value": 0.0
                        }
                    ],
                    "currency": "str",
                    "shiftType": "str",
                    "swaptionVolatility": [
                        {
                            "expiration": 0.0,
                            "term": 0.0,
                            "value": 0.0
                        }
                    ],
                    "termUnit": "MONTH",
                    "volatilityType": "str"
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.CMOModification,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.CMOModification
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "class": {
                        "classAmount": 0.0,
                        "currentCoupon": 0.0,
                        "ignoreAmount": 0.0,
                        "index": "str",
                        "leverage": 0.0,
                        "lifeCap": 0.0,
                        "lifeFloor": 0.0,
                        "modifyClassCalcType": "str",
                        "modifyInterestFlag": bool,
                        "notionalFlag": bool,
                        "paymentDayOfMonth": 0,
                        "paymentDelay": 0,
                        "resetMargin": 0.0
                    },
                    "collateral": {
                        "str": {
                            "adjustedCurrentLoanSize": 0.0,
                            "adjustedLTV": 0.0,
                            "adjustedOriginalLoanSize": 0.0,
                            "adjustedSpreadAtOrigination": 0.0,
                            "cleanPayMonths": 0,
                            "collateralNetCoupon": 0.0,
                            "combinedLTV": 0.0,
                            "creditScore": 0,
                            "current3RdPartyOrigination": 0.0,
                            "currentLTV": 0.0,
                            "forbearanceAmount": 0.0,
                            "forbearanceModification": 0.0,
                            "grossWAC": 0.0,
                            "loanAge": 0,
                            "loanPurposeCashout": 0.0,
                            "ltv": 0.0,
                            "modifyCollateralType": "str",
                            "newCurrentLoanSize": 0.0,
                            "newOriginalLoanSize": 0.0,
                            "occupancySecondHome": 0.0,
                            "originalWeightedAvgLoanSize": 0.0,
                            "originationChannel": {
                                "broker": 0.0,
                                "correspondence": 0.0,
                                "retail": 0.0,
                                "unspecified": 0.0
                            },
                            "percent2To4Unit": 0.0,
                            "percentDTI": 0.0,
                            "percentFHA": 0.0,
                            "percentFirstTimeHomeBuyer": 0.0,
                            "percentHAMPMods": 0.0,
                            "percentHARP": 0.0,
                            "percentHARP2": 0.0,
                            "percentHomeReadyHomePossible": 0.0,
                            "percentInv": 0.0,
                            "percentPIH": 0.0,
                            "percentPIWAppraisal": 0.0,
                            "percentPIWGSERefinance": 0.0,
                            "percentPIWOnsiteAVM": 0.0,
                            "percentPIWWaiver": 0.0,
                            "percentPaymentReduction": 0.0,
                            "percentPrevLossMitigation": 0.0,
                            "percentRH": 0.0,
                            "percentRefi": 0.0,
                            "percentRegularMods": 0.0,
                            "percentReperformer": 0.0,
                            "percentRetail": 0.0,
                            "percentStateHFA": 0.0,
                            "percentUnspecified": 0.0,
                            "percentVA": 0.0,
                            "permanentJumboFrac": 0.0,
                            "postModificationCreditScore": 0.0,
                            "postModificationLTV": 0.0,
                            "prepayModelSeller": [
                                {
                                    "percent": 0.0,
                                    "seller": "str"
                                }
                            ],
                            "prepayModelServicer": [
                                {
                                    "percent": 0.0,
                                    "servicer": "str"
                                }
                            ],
                            "reperformerMonths": 0,
                            "secondLienFrac": 0.0,
                            "spreadAtOrigination": 0.0,
                            "unitsMulti": 0.0,
                            "weightedAvgLoanSize": 0.0
                        }
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.UserScenarioInput,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.UserScenarioInput
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "curve": {
                        "currentCouponSpreadChange": 0.0,
                        "definition": {
                            "userScenario": {
                                "curveMultiShifts": [
                                    {
                                        "curveShifts": [
                                            {
                                                "value": 0.0,
                                                "year": 0.0
                                            }
                                        ],
                                        "period": 0.0
                                    }
                                ],
                                "curvePoints": [
                                    {
                                        "discountFactor": 0.0,
                                        "forwardRate": 0.0,
                                        "rate": 0.0,
                                        "spotRate": 0.0,
                                        "term": 0.0
                                    }
                                ],
                                "curveShifts": [
                                    {
                                        "value": 0.0,
                                        "year": 0.0
                                    }
                                ],
                                "interpolationType": "Years",
                                "shiftType": "Forward",
                                "swapSpreadConst": bool
                            }
                        },
                        "reinvestmentRate": "str",
                        "timing": "Immediate"
                    },
                    "volatility": {
                        "capVolatility": {
                            "valueType": "ABS",
                            "values": [
                                {
                                    "expiration": 0.0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "parallelShift": 0.0,
                        "swaptionVolatility": {
                            "valueType": "ABS",
                            "values": [
                                {
                                    "expiration": 0.0,
                                    "term": 0.0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "termUnit": "MONTH",
                        "valueType": "ABS"
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.DataTable,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.DataTable
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "columnDetails": [
                        {
                            "field": "str",
                            "format": "str",
                            "header": "str"
                        }
                    ],
                    "data": [
                        {
                            "str": {}
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def upload_json_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: _models.YBPortUserBond,
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Required.
        :type data: ~analyticsapi.models.YBPortUserBond
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "distribution": {
                        "servicer": {
                            "str": 0.0
                        },
                        "state": {
                            "str": 0.0
                        }
                    },
                    "extends": {
                        "identifier": "str"
                    },
                    "id": "str",
                    "indic": {
                        "str": {}
                    },
                    "schedule": {
                        "str": [
                            {
                                "date": "2020-02-20",
                                "value": 0.0
                            }
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def upload_json_job_data_sync(
        self,
        job: str,
        store_type: Union[str, _models.StoreType],
        data: "_types.JobStoreInputData",
        *,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Sync upload json job data.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param data: Is one of the following types: PrepayDialsInput, UserCurve, UserVol,
         CMOModification, UserScenarioInput, DataTable, YBPortUserBond Required.
        :type data: ~analyticsapi.models.PrepayDialsInput or ~analyticsapi.models.UserCurve or
         ~analyticsapi.models.UserVol or ~analyticsapi.models.CMOModification or
         ~analyticsapi.models.UserScenarioInput or ~analyticsapi.models.DataTable or
         ~analyticsapi.models.YBPortUserBond
        :keyword name: Default value is None.
        :paramtype name: str
        :keyword pri: Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                data = {
                    "dials": {
                        "agencyEligibility": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "annualMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "armSpikeHeight": 0.0,
                        "armSpikeLength": 0.0,
                        "brokerCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "brokerResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashWindowSCurveSlope": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "cashouts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "correspondentResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "creditScoreBase": 0.0,
                        "creditScoreSlope": 0.0,
                        "curtailmentMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "defaultMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ioSpikeElbow": 0.0,
                        "ioSpikeHeight": 0.0,
                        "ioSpikeLength": 0.0,
                        "loanSizeBase": 0.0,
                        "loanSizeSlope": 0.0,
                        "loanToValueBase": 0.0,
                        "loanToValueSlope": 0.0,
                        "onlineRefiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepayVectorShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "prepaymentDecay": 0.0,
                        "propertyInspectionWaiverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadFloor": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadRate": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "psSpreadSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiBurnout": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCapacityConstraint": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiCurveSteepness": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiElbowShift": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiFHAToConventional": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMediaEffect": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "refiSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailCosts": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailIntensity": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailRefiRamp": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "retailResponse": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftAgeDecayMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "satoElbowShiftMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverLockin": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverMultiplier": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "turnoverSeasoning": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "upfrontMortgageInsurancePremium": {
                            "value": 0.0,
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        }
                    },
                    "settings": {
                        "cmoGeographicInfoFlag": bool,
                        "commingledSuperAsFNFlag": bool,
                        "cprAdjustment": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "currentCouponSpreadAdjustment": 0.0,
                        "delinquencyResolutionPeriod": 0,
                        "fnmaModelForALTALoansFlag": bool,
                        "fnmaModelForGNMALoansFlag": bool,
                        "fnmaModelForWholeLoansFlag": bool,
                        "harpCutoffDate": "str",
                        "homePriceAppreciation": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "ignoreCurrentDelinquencyFlag": bool,
                        "ignoreDTIDispersionFlag": bool,
                        "ignoreDisclosureInfo": bool,
                        "ignoreFICODispersionFlag": bool,
                        "ignoreHousingInflationFlag": bool,
                        "ignoreLTVDispersionFlag": bool,
                        "ignoreModelHPAScenarioFlag": bool,
                        "ignoreSSHPAFlag": bool,
                        "ignoreSSUserHPAFlag": bool,
                        "ignoreServicerFlag": bool,
                        "ignoreWACDispersionFlag": bool,
                        "ignoreWALADispersionFlag": bool,
                        "psSpreadLookback": 0,
                        "psSpreadModelFlag": bool,
                        "shortTermPrepayAdjustmentFlag": bool,
                        "stateHomePriceAppreciation": [
                            {
                                "homePriceAppreciation": {
                                    "interpolationType": "LINEAR",
                                    "vector": [
                                        {
                                            "term": 0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "hpaState": "AL"
                            }
                        ],
                        "termUnit": "MONTH",
                        "unemploymentProjection": {
                            "interpolationType": "LINEAR",
                            "vector": [
                                {
                                    "term": 0,
                                    "value": 0.0
                                }
                            ]
                        },
                        "useLPHPAFlag": bool
                    }
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(data, _models.PrepayDialsInput):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserCurve):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserVol):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.CMOModification):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.UserScenarioInput):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.DataTable):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore
        elif isinstance(data, _models.YBPortUserBond):
            _content = json.dumps(data, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_upload_json_job_data_sync_request(
            job=job,
            store_type=store_type,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_job_data(
        self, job: str, store_type: Union[str, _models.StoreType], request_name: str, **kwargs: Any
    ) -> Union[Any, _models.ServiceErrorResponse]:
        """Retrieve job data body using request id or request name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_name: Unique request id. This can be of the format R-number or request name. If
         request name is used, corresponding job information should be passed in the query parameter.
         Required.
        :type request_name: str
        :return: any or ServiceErrorResponse. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: any or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Any, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_job_data_request(
            job=job,
            store_type=store_type,
            request_name=request_name,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["content-type"] = self._deserialize("str", response.headers.get("content-type"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Any, response.text())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_job_object_meta(
        self, job: str, store_type: Union[str, _models.StoreType], request_id_parameter: str, **kwargs: Any
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Retrieve job object metadata using request id or request name.

        :param job: Job reference. This can be of the form J-number or job name. Required.
        :type job: str
        :param store_type: Job store object type. Should be one of the enumerated types. Known values
         are: "table", "curve", "prepay-dials", "output-format", "vol-surface", "ybport-udi",
         "cmo-modification", "scenario-v1", and "currentCouponSpread". Required.
        :type store_type: str or ~analyticsapi.models.StoreType
        :param request_id_parameter: Unique request id. This can be of the format R-number or request
         name. If request name is used, corresponding job information should be passed in the query
         parameter. Required.
        :type request_id_parameter: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_job_object_meta_request(
            job=job,
            store_type=store_type,
            request_id_parameter=request_id_parameter,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def post_cash_flow_sync(
        self,
        body: _models.CashFlowRequestData,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Post cash flow sync.

        :param body: Required.
        :type body: ~analyticsapi.models.CashFlowRequestData
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "coreLogicCollateral": "DEFAULT",
                        "pricingDate": "2020-02-20",
                        "retrievePPMProjection": bool,
                        "useLiveData": bool,
                        "useNonQMCollateral": bool,
                        "usePreviousClose": bool,
                        "volatility": {
                            "rate": 0.0,
                            "type": "Single"
                        }
                    },
                    "input": [
                        {
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "customSettlement": "str",
                            "floaterSettings": {
                                "calculateToMaturity": bool,
                                "forwardIndexRate": 0.0,
                                "forwardIndexVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useForwardIndex": bool
                            },
                            "idType": "str",
                            "identifier": "str",
                            "lossSettings": {
                                "defaultRate": 0.0,
                                "defaultType": "SDA",
                                "defaultVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "delinquencyRate": 0.0,
                                "delinquencyType": "PERCENT",
                                "delinquencyVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "ignoreInsurance": bool,
                                "recoveryLag": 0,
                                "severityRate": 0.0,
                                "severityType": "PERCENT",
                                "severityVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useModelLoanModifications": bool
                            },
                            "mbsSettings": {
                                "assumeCall": bool,
                                "showCollateralCashFlow": bool,
                                "stepDownFail": bool,
                                "useRollInfo": bool
                            },
                            "modification": {
                                "$ref": "str"
                            },
                            "muniSettings": {
                                "ignoreCallInfo": bool,
                                "paydownOptional": bool,
                                "useStubRate": bool
                            },
                            "parAmount": "str",
                            "prepay": {
                                "rate": 0.0,
                                "type": "Model",
                                "values": [
                                    {
                                        "month": 0,
                                        "rate": 0.0
                                    }
                                ]
                            },
                            "settlementDate": "2020-02-20",
                            "settlementType": "MARKET",
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str"
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def post_cash_flow_sync(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Post cash flow sync.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def post_cash_flow_sync(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Post cash flow sync.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def post_cash_flow_sync(
        self,
        body: Union[_models.CashFlowRequestData, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Post cash flow sync.

        :param body: Is one of the following types: CashFlowRequestData, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.CashFlowRequestData or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "coreLogicCollateral": "DEFAULT",
                        "pricingDate": "2020-02-20",
                        "retrievePPMProjection": bool,
                        "useLiveData": bool,
                        "useNonQMCollateral": bool,
                        "usePreviousClose": bool,
                        "volatility": {
                            "rate": 0.0,
                            "type": "Single"
                        }
                    },
                    "input": [
                        {
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "customSettlement": "str",
                            "floaterSettings": {
                                "calculateToMaturity": bool,
                                "forwardIndexRate": 0.0,
                                "forwardIndexVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useForwardIndex": bool
                            },
                            "idType": "str",
                            "identifier": "str",
                            "lossSettings": {
                                "defaultRate": 0.0,
                                "defaultType": "SDA",
                                "defaultVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "delinquencyRate": 0.0,
                                "delinquencyType": "PERCENT",
                                "delinquencyVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "ignoreInsurance": bool,
                                "recoveryLag": 0,
                                "severityRate": 0.0,
                                "severityType": "PERCENT",
                                "severityVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useModelLoanModifications": bool
                            },
                            "mbsSettings": {
                                "assumeCall": bool,
                                "showCollateralCashFlow": bool,
                                "stepDownFail": bool,
                                "useRollInfo": bool
                            },
                            "modification": {
                                "$ref": "str"
                            },
                            "muniSettings": {
                                "ignoreCallInfo": bool,
                                "paydownOptional": bool,
                                "useStubRate": bool
                            },
                            "parAmount": "str",
                            "prepay": {
                                "rate": 0.0,
                                "type": "Model",
                                "values": [
                                    {
                                        "month": 0,
                                        "rate": 0.0
                                    }
                                ]
                            },
                            "settlementDate": "2020-02-20",
                            "settlementType": "MARKET",
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str"
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_post_cash_flow_sync_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def post_cash_flow_async(
        self,
        body: _models.CashFlowRequestData,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Post cash flow request async.

        :param body: Required.
        :type body: ~analyticsapi.models.CashFlowRequestData
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "coreLogicCollateral": "DEFAULT",
                        "pricingDate": "2020-02-20",
                        "retrievePPMProjection": bool,
                        "useLiveData": bool,
                        "useNonQMCollateral": bool,
                        "usePreviousClose": bool,
                        "volatility": {
                            "rate": 0.0,
                            "type": "Single"
                        }
                    },
                    "input": [
                        {
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "customSettlement": "str",
                            "floaterSettings": {
                                "calculateToMaturity": bool,
                                "forwardIndexRate": 0.0,
                                "forwardIndexVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useForwardIndex": bool
                            },
                            "idType": "str",
                            "identifier": "str",
                            "lossSettings": {
                                "defaultRate": 0.0,
                                "defaultType": "SDA",
                                "defaultVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "delinquencyRate": 0.0,
                                "delinquencyType": "PERCENT",
                                "delinquencyVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "ignoreInsurance": bool,
                                "recoveryLag": 0,
                                "severityRate": 0.0,
                                "severityType": "PERCENT",
                                "severityVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useModelLoanModifications": bool
                            },
                            "mbsSettings": {
                                "assumeCall": bool,
                                "showCollateralCashFlow": bool,
                                "stepDownFail": bool,
                                "useRollInfo": bool
                            },
                            "modification": {
                                "$ref": "str"
                            },
                            "muniSettings": {
                                "ignoreCallInfo": bool,
                                "paydownOptional": bool,
                                "useStubRate": bool
                            },
                            "parAmount": "str",
                            "prepay": {
                                "rate": 0.0,
                                "type": "Model",
                                "values": [
                                    {
                                        "month": 0,
                                        "rate": 0.0
                                    }
                                ]
                            },
                            "settlementDate": "2020-02-20",
                            "settlementType": "MARKET",
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str"
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def post_cash_flow_async(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Post cash flow request async.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def post_cash_flow_async(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Post cash flow request async.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def post_cash_flow_async(
        self,
        body: Union[_models.CashFlowRequestData, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Post cash flow request async.

        :param body: Is one of the following types: CashFlowRequestData, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.CashFlowRequestData or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "coreLogicCollateral": "DEFAULT",
                        "pricingDate": "2020-02-20",
                        "retrievePPMProjection": bool,
                        "useLiveData": bool,
                        "useNonQMCollateral": bool,
                        "usePreviousClose": bool,
                        "volatility": {
                            "rate": 0.0,
                            "type": "Single"
                        }
                    },
                    "input": [
                        {
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "customSettlement": "str",
                            "floaterSettings": {
                                "calculateToMaturity": bool,
                                "forwardIndexRate": 0.0,
                                "forwardIndexVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useForwardIndex": bool
                            },
                            "idType": "str",
                            "identifier": "str",
                            "lossSettings": {
                                "defaultRate": 0.0,
                                "defaultType": "SDA",
                                "defaultVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "delinquencyRate": 0.0,
                                "delinquencyType": "PERCENT",
                                "delinquencyVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "ignoreInsurance": bool,
                                "recoveryLag": 0,
                                "severityRate": 0.0,
                                "severityType": "PERCENT",
                                "severityVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useModelLoanModifications": bool
                            },
                            "mbsSettings": {
                                "assumeCall": bool,
                                "showCollateralCashFlow": bool,
                                "stepDownFail": bool,
                                "useRollInfo": bool
                            },
                            "modification": {
                                "$ref": "str"
                            },
                            "muniSettings": {
                                "ignoreCallInfo": bool,
                                "paydownOptional": bool,
                                "useStubRate": bool
                            },
                            "parAmount": "str",
                            "prepay": {
                                "rate": 0.0,
                                "type": "Model",
                                "values": [
                                    {
                                        "month": 0,
                                        "rate": 0.0
                                    }
                                ]
                            },
                            "settlementDate": "2020-02-20",
                            "settlementType": "MARKET",
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str"
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_post_cash_flow_async_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_cash_flow_sync(
        self,
        id: str,
        *,
        id_type: Optional[str] = None,
        pricing_date: Optional[str] = None,
        par_amount: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Get cash flow sync.

        :param id: Security reference ID. Required.
        :type id: str
        :keyword id_type: Default value is None.
        :paramtype id_type: str
        :keyword pricing_date: Default value is None.
        :paramtype pricing_date: str
        :keyword par_amount: Default value is None.
        :paramtype par_amount: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_cash_flow_sync_request(
            id=id,
            id_type=id_type,
            pricing_date=pricing_date,
            par_amount=par_amount,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_cash_flow_async(
        self,
        id: str,
        *,
        id_type: Optional[str] = None,
        pricing_date: Optional[str] = None,
        par_amount: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Get cash flow request async.

        :param id: Security reference ID. Required.
        :type id: str
        :keyword id_type: Default value is None.
        :paramtype id_type: str
        :keyword pricing_date: Default value is None.
        :paramtype pricing_date: str
        :keyword par_amount: Default value is None.
        :paramtype par_amount: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_cash_flow_async_request(
            id=id,
            id_type=id_type,
            pricing_date=pricing_date,
            par_amount=par_amount,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_scenario_calculation_sync(
        self,
        body: _models.ScenarioCalcRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request scenario calculation sync.

        :param body: Required.
        :type body: ~analyticsapi.models.ScenarioCalcRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "calcHorizonEffectiveMeasures": bool,
                        "calcHorizonOptionMeasures": bool,
                        "calcPrepaySensitivity": bool,
                        "calcScenarioCashFlow": bool,
                        "coreLogicCollateral": "DEFAULT",
                        "currentCouponRates": "MOATS",
                        "horizonDays": 0,
                        "horizonMonths": 0,
                        "pricingDate": "2020-02-20",
                        "useCoreLogicGroupModel": bool,
                        "useFivePointConvexity": bool,
                        "useLiveData": bool,
                        "useMuniNonCallCurve": bool,
                        "useMuniTaxSettings": bool,
                        "useNonQMCollateral": bool,
                        "useOIS": bool,
                        "usePreviousClose": bool,
                        "useStochasticHPA": bool
                    },
                    "input": [
                        {
                            "assumeCall": bool,
                            "currentCouponSpread": {
                                "$ref": "str"
                            },
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "extraSettings": {
                                "includePartials": bool,
                                "partials": {
                                    "curveShift": 0.0,
                                    "curveType": "PAR",
                                    "partialDurationYears": [
                                        0.0
                                    ],
                                    "shockType": "SQUARE",
                                    "useCumulativeWaveMethod": bool
                                }
                            },
                            "floaterSettings": {
                                "useForwardIndex": bool,
                                "useImmediateForwardShift": bool
                            },
                            "hecmSettings": {
                                "drawRate": 0.0,
                                "drawType": "CONSTANT",
                                "drawVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "horizonInfo": [
                                {
                                    "cmbsScenario": {
                                        "customScenario": {
                                            "assumeCall": bool,
                                            "balloonDefault": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "balloonExtend": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defaults": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defeasance": "AUTO",
                                            "delay": bool,
                                            "delayBalloonMaturity": bool,
                                            "prepayment": {
                                                "rateAfterYieldToMaturity": 0.0,
                                                "rateDuringPremium": 0.0,
                                                "rateDuringYieldToMaturity": 0.0
                                            }
                                        },
                                        "primary": bool,
                                        "rate": 0.0,
                                        "systemScenarioName": "str",
                                        "type": "CPY"
                                    },
                                    "level": "str",
                                    "lossSettings": {
                                        "defaultRate": 0.0,
                                        "defaultType": "SDA",
                                        "defaultVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "delinquencyRate": 0.0,
                                        "delinquencyType": "PERCENT",
                                        "delinquencyVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "ignoreInsurance": bool,
                                        "recoveryLag": 0,
                                        "severityRate": 0.0,
                                        "severityType": "PERCENT",
                                        "severityVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "useModelLoanModifications": bool
                                    },
                                    "prepay": {
                                        "modelToBalloon": bool,
                                        "rate": 0.0,
                                        "type": "Model",
                                        "vector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        }
                                    },
                                    "scenarioID": "str",
                                    "scenarioRef": {
                                        "$ref": "str"
                                    }
                                }
                            ],
                            "horizonPYMethod": "OAS Change",
                            "idType": "str",
                            "identifier": "str",
                            "modification": {
                                "$ref": "str"
                            },
                            "props": {
                                "str": {}
                            },
                            "settlementInfo": {
                                "cmbsScenario": {
                                    "customScenario": {
                                        "assumeCall": bool,
                                        "balloonDefault": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "balloonExtend": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "defaults": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "defeasance": "AUTO",
                                        "delay": bool,
                                        "delayBalloonMaturity": bool,
                                        "prepayment": {
                                            "rateAfterYieldToMaturity": 0.0,
                                            "rateDuringPremium": 0.0,
                                            "rateDuringYieldToMaturity": 0.0
                                        }
                                    },
                                    "primary": bool,
                                    "rate": 0.0,
                                    "systemScenarioName": "str",
                                    "type": "CPY"
                                },
                                "customSettlement": "str",
                                "level": "str",
                                "lossSettings": {
                                    "defaultRate": 0.0,
                                    "defaultType": "SDA",
                                    "defaultVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "delinquencyRate": 0.0,
                                    "delinquencyType": "PERCENT",
                                    "delinquencyVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "ignoreInsurance": bool,
                                    "recoveryLag": 0,
                                    "severityRate": 0.0,
                                    "severityType": "PERCENT",
                                    "severityVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "useModelLoanModifications": bool
                                },
                                "prepay": {
                                    "modelToBalloon": bool,
                                    "rate": 0.0,
                                    "type": "Model",
                                    "vector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    }
                                },
                                "settlementDate": "2020-02-20",
                                "settlementType": "MARKET"
                            },
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str",
                            "volatility": {
                                "rate": 0.0,
                                "structureNote": {
                                    "callableZeroPricing": "NETPROCEED",
                                    "pricing": "DISCOUNTING"
                                },
                                "type": "Single",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ],
                    "scenarios": [
                        {
                            "currentCouponSpreadChange": 0.0,
                            "definition": {
                                "systemScenario": {
                                    "name": "BEARSTEEP50"
                                },
                                "userScenario": {
                                    "curveMultiShifts": [
                                        {
                                            "curveShifts": [
                                                {
                                                    "value": 0.0,
                                                    "year": 0.0
                                                }
                                            ],
                                            "period": 0.0
                                        }
                                    ],
                                    "curvePoints": [
                                        {
                                            "discountFactor": 0.0,
                                            "forwardRate": 0.0,
                                            "rate": 0.0,
                                            "spotRate": 0.0,
                                            "term": 0.0
                                        }
                                    ],
                                    "curveShifts": [
                                        {
                                            "value": 0.0,
                                            "year": 0.0
                                        }
                                    ],
                                    "interpolationType": "Years",
                                    "shiftType": "Forward",
                                    "swapSpreadConst": bool
                                }
                            },
                            "reinvestmentRate": "str",
                            "scenarioID": "str",
                            "scenarioTitle": "str",
                            "timing": "Immediate",
                            "volatility": {
                                "capVolatility": {
                                    "valueType": "ABS",
                                    "values": [
                                        {
                                            "expiration": 0.0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "parallelShift": 0.0,
                                "swaptionVolatility": {
                                    "valueType": "ABS",
                                    "values": [
                                        {
                                            "expiration": 0.0,
                                            "term": 0.0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "termUnit": "MONTH",
                                "valueType": "ABS"
                            }
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_scenario_calculation_sync(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request scenario calculation sync.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_scenario_calculation_sync(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request scenario calculation sync.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_scenario_calculation_sync(
        self,
        body: Union[_models.ScenarioCalcRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request scenario calculation sync.

        :param body: Is one of the following types: ScenarioCalcRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.ScenarioCalcRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "calcHorizonEffectiveMeasures": bool,
                        "calcHorizonOptionMeasures": bool,
                        "calcPrepaySensitivity": bool,
                        "calcScenarioCashFlow": bool,
                        "coreLogicCollateral": "DEFAULT",
                        "currentCouponRates": "MOATS",
                        "horizonDays": 0,
                        "horizonMonths": 0,
                        "pricingDate": "2020-02-20",
                        "useCoreLogicGroupModel": bool,
                        "useFivePointConvexity": bool,
                        "useLiveData": bool,
                        "useMuniNonCallCurve": bool,
                        "useMuniTaxSettings": bool,
                        "useNonQMCollateral": bool,
                        "useOIS": bool,
                        "usePreviousClose": bool,
                        "useStochasticHPA": bool
                    },
                    "input": [
                        {
                            "assumeCall": bool,
                            "currentCouponSpread": {
                                "$ref": "str"
                            },
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "extraSettings": {
                                "includePartials": bool,
                                "partials": {
                                    "curveShift": 0.0,
                                    "curveType": "PAR",
                                    "partialDurationYears": [
                                        0.0
                                    ],
                                    "shockType": "SQUARE",
                                    "useCumulativeWaveMethod": bool
                                }
                            },
                            "floaterSettings": {
                                "useForwardIndex": bool,
                                "useImmediateForwardShift": bool
                            },
                            "hecmSettings": {
                                "drawRate": 0.0,
                                "drawType": "CONSTANT",
                                "drawVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "horizonInfo": [
                                {
                                    "cmbsScenario": {
                                        "customScenario": {
                                            "assumeCall": bool,
                                            "balloonDefault": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "balloonExtend": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defaults": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defeasance": "AUTO",
                                            "delay": bool,
                                            "delayBalloonMaturity": bool,
                                            "prepayment": {
                                                "rateAfterYieldToMaturity": 0.0,
                                                "rateDuringPremium": 0.0,
                                                "rateDuringYieldToMaturity": 0.0
                                            }
                                        },
                                        "primary": bool,
                                        "rate": 0.0,
                                        "systemScenarioName": "str",
                                        "type": "CPY"
                                    },
                                    "level": "str",
                                    "lossSettings": {
                                        "defaultRate": 0.0,
                                        "defaultType": "SDA",
                                        "defaultVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "delinquencyRate": 0.0,
                                        "delinquencyType": "PERCENT",
                                        "delinquencyVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "ignoreInsurance": bool,
                                        "recoveryLag": 0,
                                        "severityRate": 0.0,
                                        "severityType": "PERCENT",
                                        "severityVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "useModelLoanModifications": bool
                                    },
                                    "prepay": {
                                        "modelToBalloon": bool,
                                        "rate": 0.0,
                                        "type": "Model",
                                        "vector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        }
                                    },
                                    "scenarioID": "str",
                                    "scenarioRef": {
                                        "$ref": "str"
                                    }
                                }
                            ],
                            "horizonPYMethod": "OAS Change",
                            "idType": "str",
                            "identifier": "str",
                            "modification": {
                                "$ref": "str"
                            },
                            "props": {
                                "str": {}
                            },
                            "settlementInfo": {
                                "cmbsScenario": {
                                    "customScenario": {
                                        "assumeCall": bool,
                                        "balloonDefault": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "balloonExtend": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "defaults": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "defeasance": "AUTO",
                                        "delay": bool,
                                        "delayBalloonMaturity": bool,
                                        "prepayment": {
                                            "rateAfterYieldToMaturity": 0.0,
                                            "rateDuringPremium": 0.0,
                                            "rateDuringYieldToMaturity": 0.0
                                        }
                                    },
                                    "primary": bool,
                                    "rate": 0.0,
                                    "systemScenarioName": "str",
                                    "type": "CPY"
                                },
                                "customSettlement": "str",
                                "level": "str",
                                "lossSettings": {
                                    "defaultRate": 0.0,
                                    "defaultType": "SDA",
                                    "defaultVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "delinquencyRate": 0.0,
                                    "delinquencyType": "PERCENT",
                                    "delinquencyVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "ignoreInsurance": bool,
                                    "recoveryLag": 0,
                                    "severityRate": 0.0,
                                    "severityType": "PERCENT",
                                    "severityVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "useModelLoanModifications": bool
                                },
                                "prepay": {
                                    "modelToBalloon": bool,
                                    "rate": 0.0,
                                    "type": "Model",
                                    "vector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    }
                                },
                                "settlementDate": "2020-02-20",
                                "settlementType": "MARKET"
                            },
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str",
                            "volatility": {
                                "rate": 0.0,
                                "structureNote": {
                                    "callableZeroPricing": "NETPROCEED",
                                    "pricing": "DISCOUNTING"
                                },
                                "type": "Single",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ],
                    "scenarios": [
                        {
                            "currentCouponSpreadChange": 0.0,
                            "definition": {
                                "systemScenario": {
                                    "name": "BEARSTEEP50"
                                },
                                "userScenario": {
                                    "curveMultiShifts": [
                                        {
                                            "curveShifts": [
                                                {
                                                    "value": 0.0,
                                                    "year": 0.0
                                                }
                                            ],
                                            "period": 0.0
                                        }
                                    ],
                                    "curvePoints": [
                                        {
                                            "discountFactor": 0.0,
                                            "forwardRate": 0.0,
                                            "rate": 0.0,
                                            "spotRate": 0.0,
                                            "term": 0.0
                                        }
                                    ],
                                    "curveShifts": [
                                        {
                                            "value": 0.0,
                                            "year": 0.0
                                        }
                                    ],
                                    "interpolationType": "Years",
                                    "shiftType": "Forward",
                                    "swapSpreadConst": bool
                                }
                            },
                            "reinvestmentRate": "str",
                            "scenarioID": "str",
                            "scenarioTitle": "str",
                            "timing": "Immediate",
                            "volatility": {
                                "capVolatility": {
                                    "valueType": "ABS",
                                    "values": [
                                        {
                                            "expiration": 0.0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "parallelShift": 0.0,
                                "swaptionVolatility": {
                                    "valueType": "ABS",
                                    "values": [
                                        {
                                            "expiration": 0.0,
                                            "term": 0.0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "termUnit": "MONTH",
                                "valueType": "ABS"
                            }
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_scenario_calculation_sync_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_scenario_calculation_async(
        self,
        body: _models.ScenarioCalcRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request scenario calculation async.

        :param body: Required.
        :type body: ~analyticsapi.models.ScenarioCalcRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "calcHorizonEffectiveMeasures": bool,
                        "calcHorizonOptionMeasures": bool,
                        "calcPrepaySensitivity": bool,
                        "calcScenarioCashFlow": bool,
                        "coreLogicCollateral": "DEFAULT",
                        "currentCouponRates": "MOATS",
                        "horizonDays": 0,
                        "horizonMonths": 0,
                        "pricingDate": "2020-02-20",
                        "useCoreLogicGroupModel": bool,
                        "useFivePointConvexity": bool,
                        "useLiveData": bool,
                        "useMuniNonCallCurve": bool,
                        "useMuniTaxSettings": bool,
                        "useNonQMCollateral": bool,
                        "useOIS": bool,
                        "usePreviousClose": bool,
                        "useStochasticHPA": bool
                    },
                    "input": [
                        {
                            "assumeCall": bool,
                            "currentCouponSpread": {
                                "$ref": "str"
                            },
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "extraSettings": {
                                "includePartials": bool,
                                "partials": {
                                    "curveShift": 0.0,
                                    "curveType": "PAR",
                                    "partialDurationYears": [
                                        0.0
                                    ],
                                    "shockType": "SQUARE",
                                    "useCumulativeWaveMethod": bool
                                }
                            },
                            "floaterSettings": {
                                "useForwardIndex": bool,
                                "useImmediateForwardShift": bool
                            },
                            "hecmSettings": {
                                "drawRate": 0.0,
                                "drawType": "CONSTANT",
                                "drawVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "horizonInfo": [
                                {
                                    "cmbsScenario": {
                                        "customScenario": {
                                            "assumeCall": bool,
                                            "balloonDefault": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "balloonExtend": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defaults": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defeasance": "AUTO",
                                            "delay": bool,
                                            "delayBalloonMaturity": bool,
                                            "prepayment": {
                                                "rateAfterYieldToMaturity": 0.0,
                                                "rateDuringPremium": 0.0,
                                                "rateDuringYieldToMaturity": 0.0
                                            }
                                        },
                                        "primary": bool,
                                        "rate": 0.0,
                                        "systemScenarioName": "str",
                                        "type": "CPY"
                                    },
                                    "level": "str",
                                    "lossSettings": {
                                        "defaultRate": 0.0,
                                        "defaultType": "SDA",
                                        "defaultVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "delinquencyRate": 0.0,
                                        "delinquencyType": "PERCENT",
                                        "delinquencyVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "ignoreInsurance": bool,
                                        "recoveryLag": 0,
                                        "severityRate": 0.0,
                                        "severityType": "PERCENT",
                                        "severityVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "useModelLoanModifications": bool
                                    },
                                    "prepay": {
                                        "modelToBalloon": bool,
                                        "rate": 0.0,
                                        "type": "Model",
                                        "vector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        }
                                    },
                                    "scenarioID": "str",
                                    "scenarioRef": {
                                        "$ref": "str"
                                    }
                                }
                            ],
                            "horizonPYMethod": "OAS Change",
                            "idType": "str",
                            "identifier": "str",
                            "modification": {
                                "$ref": "str"
                            },
                            "props": {
                                "str": {}
                            },
                            "settlementInfo": {
                                "cmbsScenario": {
                                    "customScenario": {
                                        "assumeCall": bool,
                                        "balloonDefault": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "balloonExtend": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "defaults": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "defeasance": "AUTO",
                                        "delay": bool,
                                        "delayBalloonMaturity": bool,
                                        "prepayment": {
                                            "rateAfterYieldToMaturity": 0.0,
                                            "rateDuringPremium": 0.0,
                                            "rateDuringYieldToMaturity": 0.0
                                        }
                                    },
                                    "primary": bool,
                                    "rate": 0.0,
                                    "systemScenarioName": "str",
                                    "type": "CPY"
                                },
                                "customSettlement": "str",
                                "level": "str",
                                "lossSettings": {
                                    "defaultRate": 0.0,
                                    "defaultType": "SDA",
                                    "defaultVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "delinquencyRate": 0.0,
                                    "delinquencyType": "PERCENT",
                                    "delinquencyVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "ignoreInsurance": bool,
                                    "recoveryLag": 0,
                                    "severityRate": 0.0,
                                    "severityType": "PERCENT",
                                    "severityVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "useModelLoanModifications": bool
                                },
                                "prepay": {
                                    "modelToBalloon": bool,
                                    "rate": 0.0,
                                    "type": "Model",
                                    "vector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    }
                                },
                                "settlementDate": "2020-02-20",
                                "settlementType": "MARKET"
                            },
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str",
                            "volatility": {
                                "rate": 0.0,
                                "structureNote": {
                                    "callableZeroPricing": "NETPROCEED",
                                    "pricing": "DISCOUNTING"
                                },
                                "type": "Single",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ],
                    "scenarios": [
                        {
                            "currentCouponSpreadChange": 0.0,
                            "definition": {
                                "systemScenario": {
                                    "name": "BEARSTEEP50"
                                },
                                "userScenario": {
                                    "curveMultiShifts": [
                                        {
                                            "curveShifts": [
                                                {
                                                    "value": 0.0,
                                                    "year": 0.0
                                                }
                                            ],
                                            "period": 0.0
                                        }
                                    ],
                                    "curvePoints": [
                                        {
                                            "discountFactor": 0.0,
                                            "forwardRate": 0.0,
                                            "rate": 0.0,
                                            "spotRate": 0.0,
                                            "term": 0.0
                                        }
                                    ],
                                    "curveShifts": [
                                        {
                                            "value": 0.0,
                                            "year": 0.0
                                        }
                                    ],
                                    "interpolationType": "Years",
                                    "shiftType": "Forward",
                                    "swapSpreadConst": bool
                                }
                            },
                            "reinvestmentRate": "str",
                            "scenarioID": "str",
                            "scenarioTitle": "str",
                            "timing": "Immediate",
                            "volatility": {
                                "capVolatility": {
                                    "valueType": "ABS",
                                    "values": [
                                        {
                                            "expiration": 0.0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "parallelShift": 0.0,
                                "swaptionVolatility": {
                                    "valueType": "ABS",
                                    "values": [
                                        {
                                            "expiration": 0.0,
                                            "term": 0.0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "termUnit": "MONTH",
                                "valueType": "ABS"
                            }
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_scenario_calculation_async(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request scenario calculation async.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_scenario_calculation_async(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request scenario calculation async.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_scenario_calculation_async(
        self,
        body: Union[_models.ScenarioCalcRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request scenario calculation async.

        :param body: Is one of the following types: ScenarioCalcRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.ScenarioCalcRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "calcHorizonEffectiveMeasures": bool,
                        "calcHorizonOptionMeasures": bool,
                        "calcPrepaySensitivity": bool,
                        "calcScenarioCashFlow": bool,
                        "coreLogicCollateral": "DEFAULT",
                        "currentCouponRates": "MOATS",
                        "horizonDays": 0,
                        "horizonMonths": 0,
                        "pricingDate": "2020-02-20",
                        "useCoreLogicGroupModel": bool,
                        "useFivePointConvexity": bool,
                        "useLiveData": bool,
                        "useMuniNonCallCurve": bool,
                        "useMuniTaxSettings": bool,
                        "useNonQMCollateral": bool,
                        "useOIS": bool,
                        "usePreviousClose": bool,
                        "useStochasticHPA": bool
                    },
                    "input": [
                        {
                            "assumeCall": bool,
                            "currentCouponSpread": {
                                "$ref": "str"
                            },
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "extraSettings": {
                                "includePartials": bool,
                                "partials": {
                                    "curveShift": 0.0,
                                    "curveType": "PAR",
                                    "partialDurationYears": [
                                        0.0
                                    ],
                                    "shockType": "SQUARE",
                                    "useCumulativeWaveMethod": bool
                                }
                            },
                            "floaterSettings": {
                                "useForwardIndex": bool,
                                "useImmediateForwardShift": bool
                            },
                            "hecmSettings": {
                                "drawRate": 0.0,
                                "drawType": "CONSTANT",
                                "drawVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "horizonInfo": [
                                {
                                    "cmbsScenario": {
                                        "customScenario": {
                                            "assumeCall": bool,
                                            "balloonDefault": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "balloonExtend": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defaults": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defeasance": "AUTO",
                                            "delay": bool,
                                            "delayBalloonMaturity": bool,
                                            "prepayment": {
                                                "rateAfterYieldToMaturity": 0.0,
                                                "rateDuringPremium": 0.0,
                                                "rateDuringYieldToMaturity": 0.0
                                            }
                                        },
                                        "primary": bool,
                                        "rate": 0.0,
                                        "systemScenarioName": "str",
                                        "type": "CPY"
                                    },
                                    "level": "str",
                                    "lossSettings": {
                                        "defaultRate": 0.0,
                                        "defaultType": "SDA",
                                        "defaultVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "delinquencyRate": 0.0,
                                        "delinquencyType": "PERCENT",
                                        "delinquencyVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "ignoreInsurance": bool,
                                        "recoveryLag": 0,
                                        "severityRate": 0.0,
                                        "severityType": "PERCENT",
                                        "severityVector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        },
                                        "useModelLoanModifications": bool
                                    },
                                    "prepay": {
                                        "modelToBalloon": bool,
                                        "rate": 0.0,
                                        "type": "Model",
                                        "vector": {
                                            "index": "str",
                                            "interpolationType": "INTERPOLATED",
                                            "values": [
                                                {
                                                    "month": 0,
                                                    "rate": 0.0
                                                }
                                            ]
                                        }
                                    },
                                    "scenarioID": "str",
                                    "scenarioRef": {
                                        "$ref": "str"
                                    }
                                }
                            ],
                            "horizonPYMethod": "OAS Change",
                            "idType": "str",
                            "identifier": "str",
                            "modification": {
                                "$ref": "str"
                            },
                            "props": {
                                "str": {}
                            },
                            "settlementInfo": {
                                "cmbsScenario": {
                                    "customScenario": {
                                        "assumeCall": bool,
                                        "balloonDefault": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "balloonExtend": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "defaults": {
                                            "lossRate": 0.0,
                                            "lossSeverity": 0.0,
                                            "lossType": "PLD",
                                            "lossVector": {
                                                "index": "str",
                                                "interpolationType": "INTERPOLATED",
                                                "values": [
                                                    {
                                                        "month": 0,
                                                        "rate": 0.0
                                                    }
                                                ]
                                            },
                                            "monthToExtend": 0,
                                            "percent": 0.0,
                                            "recoveryPeriod": 0
                                        },
                                        "defeasance": "AUTO",
                                        "delay": bool,
                                        "delayBalloonMaturity": bool,
                                        "prepayment": {
                                            "rateAfterYieldToMaturity": 0.0,
                                            "rateDuringPremium": 0.0,
                                            "rateDuringYieldToMaturity": 0.0
                                        }
                                    },
                                    "primary": bool,
                                    "rate": 0.0,
                                    "systemScenarioName": "str",
                                    "type": "CPY"
                                },
                                "customSettlement": "str",
                                "level": "str",
                                "lossSettings": {
                                    "defaultRate": 0.0,
                                    "defaultType": "SDA",
                                    "defaultVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "delinquencyRate": 0.0,
                                    "delinquencyType": "PERCENT",
                                    "delinquencyVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "ignoreInsurance": bool,
                                    "recoveryLag": 0,
                                    "severityRate": 0.0,
                                    "severityType": "PERCENT",
                                    "severityVector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    },
                                    "useModelLoanModifications": bool
                                },
                                "prepay": {
                                    "modelToBalloon": bool,
                                    "rate": 0.0,
                                    "type": "Model",
                                    "vector": {
                                        "index": "str",
                                        "interpolationType": "INTERPOLATED",
                                        "values": [
                                            {
                                                "month": 0,
                                                "rate": 0.0
                                            }
                                        ]
                                    }
                                },
                                "settlementDate": "2020-02-20",
                                "settlementType": "MARKET"
                            },
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str",
                            "volatility": {
                                "rate": 0.0,
                                "structureNote": {
                                    "callableZeroPricing": "NETPROCEED",
                                    "pricing": "DISCOUNTING"
                                },
                                "type": "Single",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ],
                    "scenarios": [
                        {
                            "currentCouponSpreadChange": 0.0,
                            "definition": {
                                "systemScenario": {
                                    "name": "BEARSTEEP50"
                                },
                                "userScenario": {
                                    "curveMultiShifts": [
                                        {
                                            "curveShifts": [
                                                {
                                                    "value": 0.0,
                                                    "year": 0.0
                                                }
                                            ],
                                            "period": 0.0
                                        }
                                    ],
                                    "curvePoints": [
                                        {
                                            "discountFactor": 0.0,
                                            "forwardRate": 0.0,
                                            "rate": 0.0,
                                            "spotRate": 0.0,
                                            "term": 0.0
                                        }
                                    ],
                                    "curveShifts": [
                                        {
                                            "value": 0.0,
                                            "year": 0.0
                                        }
                                    ],
                                    "interpolationType": "Years",
                                    "shiftType": "Forward",
                                    "swapSpreadConst": bool
                                }
                            },
                            "reinvestmentRate": "str",
                            "scenarioID": "str",
                            "scenarioTitle": "str",
                            "timing": "Immediate",
                            "volatility": {
                                "capVolatility": {
                                    "valueType": "ABS",
                                    "values": [
                                        {
                                            "expiration": 0.0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "parallelShift": 0.0,
                                "swaptionVolatility": {
                                    "valueType": "ABS",
                                    "values": [
                                        {
                                            "expiration": 0.0,
                                            "term": 0.0,
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "termUnit": "MONTH",
                                "valueType": "ABS"
                            }
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_scenario_calculation_async_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_get_scen_calc_sys_scen_sync(
        self,
        id: str,
        *,
        scenario: str,
        id_type: Optional[str] = None,
        level: Optional[str] = None,
        pricing_date: Optional[str] = None,
        h_days: Optional[int] = None,
        h_months: Optional[int] = None,
        curve_type: Optional[Union[str, _models.YbRestCurveType]] = None,
        currency: Optional[str] = None,
        volatility: Optional[str] = None,
        prepay_type: Optional[str] = None,
        prepay_rate: Optional[float] = None,
        h_level: Optional[str] = None,
        h_py_method: Optional[str] = None,
        h_prepay_rate: Optional[float] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request get scenario calculation system scenario sync.

        :param id: Security reference ID. Required.
        :type id: str
        :keyword scenario: Required.
        :paramtype scenario: str
        :keyword id_type: Default value is None.
        :paramtype id_type: str
        :keyword level: Default value is None.
        :paramtype level: str
        :keyword pricing_date: Default value is None.
        :paramtype pricing_date: str
        :keyword h_days: Default value is None.
        :paramtype h_days: int
        :keyword h_months: Default value is None.
        :paramtype h_months: int
        :keyword curve_type: Known values are: "GVT", "GVT_TSYM", "GVT_TSYM_MUNI", "GVT_AGN",
         "GVT_MUNI", "GVT_BUND", "SWAP", "SWAP_RFR", "SWAP_MUNI", and "SWAP_LIB6M". Default value is
         None.
        :paramtype curve_type: str or ~analyticsapi.models.YbRestCurveType
        :keyword currency: Default value is None.
        :paramtype currency: str
        :keyword volatility: Default value is None.
        :paramtype volatility: str
        :keyword prepay_type: Default value is None.
        :paramtype prepay_type: str
        :keyword prepay_rate: Default value is None.
        :paramtype prepay_rate: float
        :keyword h_level: Default value is None.
        :paramtype h_level: str
        :keyword h_py_method: Default value is None.
        :paramtype h_py_method: str
        :keyword h_prepay_rate: Default value is None.
        :paramtype h_prepay_rate: float
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_get_scen_calc_sys_scen_sync_request(
            id=id,
            scenario=scenario,
            id_type=id_type,
            level=level,
            pricing_date=pricing_date,
            h_days=h_days,
            h_months=h_months,
            curve_type=curve_type,
            currency=currency,
            volatility=volatility,
            prepay_type=prepay_type,
            prepay_rate=prepay_rate,
            h_level=h_level,
            h_py_method=h_py_method,
            h_prepay_rate=h_prepay_rate,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_get_scen_calc_sys_scen_async(
        self,
        id: str,
        *,
        scenario: str,
        id_type: Optional[str] = None,
        level: Optional[str] = None,
        pricing_date: Optional[str] = None,
        h_days: Optional[int] = None,
        h_months: Optional[int] = None,
        curve_type: Optional[Union[str, _models.YbRestCurveType]] = None,
        currency: Optional[str] = None,
        volatility: Optional[str] = None,
        prepay_type: Optional[str] = None,
        prepay_rate: Optional[float] = None,
        h_level: Optional[str] = None,
        h_py_method: Optional[str] = None,
        h_prepay_rate: Optional[float] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request get scenario calculation system scenario async.

        :param id: Security reference ID. Required.
        :type id: str
        :keyword scenario: Required.
        :paramtype scenario: str
        :keyword id_type: Default value is None.
        :paramtype id_type: str
        :keyword level: Default value is None.
        :paramtype level: str
        :keyword pricing_date: Default value is None.
        :paramtype pricing_date: str
        :keyword h_days: Default value is None.
        :paramtype h_days: int
        :keyword h_months: Default value is None.
        :paramtype h_months: int
        :keyword curve_type: Known values are: "GVT", "GVT_TSYM", "GVT_TSYM_MUNI", "GVT_AGN",
         "GVT_MUNI", "GVT_BUND", "SWAP", "SWAP_RFR", "SWAP_MUNI", and "SWAP_LIB6M". Default value is
         None.
        :paramtype curve_type: str or ~analyticsapi.models.YbRestCurveType
        :keyword currency: Default value is None.
        :paramtype currency: str
        :keyword volatility: Default value is None.
        :paramtype volatility: str
        :keyword prepay_type: Default value is None.
        :paramtype prepay_type: str
        :keyword prepay_rate: Default value is None.
        :paramtype prepay_rate: float
        :keyword h_level: Default value is None.
        :paramtype h_level: str
        :keyword h_py_method: Default value is None.
        :paramtype h_py_method: str
        :keyword h_prepay_rate: Default value is None.
        :paramtype h_prepay_rate: float
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_get_scen_calc_sys_scen_async_request(
            id=id,
            scenario=scenario,
            id_type=id_type,
            level=level,
            pricing_date=pricing_date,
            h_days=h_days,
            h_months=h_months,
            curve_type=curve_type,
            currency=currency,
            volatility=volatility,
            prepay_type=prepay_type,
            prepay_rate=prepay_rate,
            h_level=h_level,
            h_py_method=h_py_method,
            h_prepay_rate=h_prepay_rate,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_return_attribution_sync(
        self,
        body: _models.ReturnAttributionRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request return attribution sync.

        :param body: Required.
        :type body: ~analyticsapi.models.ReturnAttributionRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "begin": {
                            "holdingDate": "2020-02-20",
                            "settlementDate": "2020-02-20",
                            "settlementType": "str"
                        },
                        "curve": {
                            "currency": "str",
                            "curveType": "str"
                        },
                        "end": {
                            "holdingDate": "2020-02-20",
                            "settlementDate": "2020-02-20",
                            "settlementType": "str"
                        },
                        "volatility": {
                            "rate": 0.0,
                            "structureNote": {
                                "callableZeroPricing": "NETPROCEED",
                                "pricing": "DISCOUNTING"
                            },
                            "type": "Single",
                            "userDefined": {
                                "$ref": "str"
                            }
                        }
                    },
                    "input": [
                        {
                            "beginLevel": "str",
                            "endLevel": "str",
                            "idType": "str",
                            "identifier": "str",
                            "prepaySettings": {
                                "modelToBalloon": bool,
                                "rate": 0.0,
                                "type": "Model",
                                "vector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "tag": "str"
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_return_attribution_sync(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request return attribution sync.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_return_attribution_sync(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request return attribution sync.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_return_attribution_sync(
        self,
        body: Union[_models.ReturnAttributionRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request return attribution sync.

        :param body: Is one of the following types: ReturnAttributionRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.ReturnAttributionRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "begin": {
                            "holdingDate": "2020-02-20",
                            "settlementDate": "2020-02-20",
                            "settlementType": "str"
                        },
                        "curve": {
                            "currency": "str",
                            "curveType": "str"
                        },
                        "end": {
                            "holdingDate": "2020-02-20",
                            "settlementDate": "2020-02-20",
                            "settlementType": "str"
                        },
                        "volatility": {
                            "rate": 0.0,
                            "structureNote": {
                                "callableZeroPricing": "NETPROCEED",
                                "pricing": "DISCOUNTING"
                            },
                            "type": "Single",
                            "userDefined": {
                                "$ref": "str"
                            }
                        }
                    },
                    "input": [
                        {
                            "beginLevel": "str",
                            "endLevel": "str",
                            "idType": "str",
                            "identifier": "str",
                            "prepaySettings": {
                                "modelToBalloon": bool,
                                "rate": 0.0,
                                "type": "Model",
                                "vector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "tag": "str"
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_return_attribution_sync_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_return_attribution_async(
        self,
        body: _models.ReturnAttributionRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request return attribution async.

        :param body: Required.
        :type body: ~analyticsapi.models.ReturnAttributionRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "begin": {
                            "holdingDate": "2020-02-20",
                            "settlementDate": "2020-02-20",
                            "settlementType": "str"
                        },
                        "curve": {
                            "currency": "str",
                            "curveType": "str"
                        },
                        "end": {
                            "holdingDate": "2020-02-20",
                            "settlementDate": "2020-02-20",
                            "settlementType": "str"
                        },
                        "volatility": {
                            "rate": 0.0,
                            "structureNote": {
                                "callableZeroPricing": "NETPROCEED",
                                "pricing": "DISCOUNTING"
                            },
                            "type": "Single",
                            "userDefined": {
                                "$ref": "str"
                            }
                        }
                    },
                    "input": [
                        {
                            "beginLevel": "str",
                            "endLevel": "str",
                            "idType": "str",
                            "identifier": "str",
                            "prepaySettings": {
                                "modelToBalloon": bool,
                                "rate": 0.0,
                                "type": "Model",
                                "vector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "tag": "str"
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_return_attribution_async(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request return attribution async.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_return_attribution_async(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request return attribution async.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_return_attribution_async(
        self,
        body: Union[_models.ReturnAttributionRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request return attribution async.

        :param body: Is one of the following types: ReturnAttributionRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.ReturnAttributionRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "begin": {
                            "holdingDate": "2020-02-20",
                            "settlementDate": "2020-02-20",
                            "settlementType": "str"
                        },
                        "curve": {
                            "currency": "str",
                            "curveType": "str"
                        },
                        "end": {
                            "holdingDate": "2020-02-20",
                            "settlementDate": "2020-02-20",
                            "settlementType": "str"
                        },
                        "volatility": {
                            "rate": 0.0,
                            "structureNote": {
                                "callableZeroPricing": "NETPROCEED",
                                "pricing": "DISCOUNTING"
                            },
                            "type": "Single",
                            "userDefined": {
                                "$ref": "str"
                            }
                        }
                    },
                    "input": [
                        {
                            "beginLevel": "str",
                            "endLevel": "str",
                            "idType": "str",
                            "identifier": "str",
                            "prepaySettings": {
                                "modelToBalloon": bool,
                                "rate": 0.0,
                                "type": "Model",
                                "vector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "tag": "str"
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_return_attribution_async_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def bulk_zip_request(
        self,
        data: bytes,
        *,
        default_target: Optional[str] = None,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk zip request.

        :param data: Required.
        :type data: bytes
        :keyword default_target: Default value is None.
        :paramtype default_target: str
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/zip"))
        cls: ClsType[Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        _content = data

        _request = build_yield_book_rest_bulk_zip_request_request(
            default_target=default_target,
            create_job=create_job,
            chain_job=chain_job,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ResultResponseBulkResultItem, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def bulk_compact_request(
        self,
        body: _models.BulkCompact,
        *,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk compact request.

        :param body: Required.
        :type body: ~analyticsapi.models.BulkCompact
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "body": "str",
                    "dataSource": {
                        "filter": "str",
                        "namePrefix": "str",
                        "nameSuffix": "str",
                        "requestId": "str"
                    },
                    "nameExpr": "str",
                    "params": {
                        "str": {}
                    },
                    "path": "str",
                    "requests": [
                        {
                            "str": {}
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def bulk_compact_request(
        self,
        body: JSON,
        *,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk compact request.

        :param body: Required.
        :type body: JSON
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def bulk_compact_request(
        self,
        body: IO[bytes],
        *,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk compact request.

        :param body: Required.
        :type body: IO[bytes]
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def bulk_compact_request(
        self,
        body: Union[_models.BulkCompact, JSON, IO[bytes]],
        *,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk compact request.

        :param body: Is one of the following types: BulkCompact, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.BulkCompact or JSON or IO[bytes]
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "body": "str",
                    "dataSource": {
                        "filter": "str",
                        "namePrefix": "str",
                        "nameSuffix": "str",
                        "requestId": "str"
                    },
                    "nameExpr": "str",
                    "params": {
                        "str": {}
                    },
                    "path": "str",
                    "requests": [
                        {
                            "str": {}
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_bulk_compact_request_request(
            create_job=create_job,
            chain_job=chain_job,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ResultResponseBulkResultItem, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def bulk_composite_request(
        self,
        body: _models.BulkComposite,
        *,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        partial: Optional[bool] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk composite request.

        :param body: Required.
        :type body: ~analyticsapi.models.BulkComposite
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword partial: Default value is None.
        :paramtype partial: bool
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "requests": [
                        {
                            "body": "str",
                            "dep": "str",
                            "name": "str",
                            "parentReq": "str",
                            "path": "str",
                            "priority": 0,
                            "tags": "str",
                            "visible": "str"
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def bulk_composite_request(
        self,
        body: JSON,
        *,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        partial: Optional[bool] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk composite request.

        :param body: Required.
        :type body: JSON
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword partial: Default value is None.
        :paramtype partial: bool
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def bulk_composite_request(
        self,
        body: IO[bytes],
        *,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        partial: Optional[bool] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk composite request.

        :param body: Required.
        :type body: IO[bytes]
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword partial: Default value is None.
        :paramtype partial: bool
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def bulk_composite_request(
        self,
        body: Union[_models.BulkComposite, JSON, IO[bytes]],
        *,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        partial: Optional[bool] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk composite request.

        :param body: Is one of the following types: BulkComposite, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.BulkComposite or JSON or IO[bytes]
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword partial: Default value is None.
        :paramtype partial: bool
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "requests": [
                        {
                            "body": "str",
                            "dep": "str",
                            "name": "str",
                            "parentReq": "str",
                            "path": "str",
                            "priority": 0,
                            "tags": "str",
                            "visible": "str"
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_bulk_composite_request_request(
            create_job=create_job,
            chain_job=chain_job,
            partial=partial,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ResultResponseBulkResultItem, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def bulk_yb_port_udi_request(
        self,
        data: str,
        *,
        prefix: Optional[str] = None,
        suffix: Optional[str] = None,
        create_job: Optional[bool] = None,
        chain_job: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]:
        """Bulk YB Port UDI request.

        :param data: Required.
        :type data: str
        :keyword prefix: Default value is None.
        :paramtype prefix: str
        :keyword suffix: Default value is None.
        :paramtype suffix: str
        :keyword create_job: Default value is None.
        :paramtype create_job: bool
        :keyword chain_job: Default value is None.
        :paramtype chain_job: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: ResultResponseBulkResultItem or ServiceErrorResponse. The ResultResponseBulkResultItem
         is compatible with MutableMapping
        :rtype: ~analyticsapi.models.ResultResponseBulkResultItem or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "description": "str",
                        "id": "str",
                        "priority": 0,
                        "source": "str",
                        "status": 0,
                        "target": "str"
                    },
                    "errors": [
                        {
                            "code": "str",
                            "description": "str",
                            "error": "str",
                            "location": "str",
                            "path": "str",
                            "resolution": "str"
                        }
                    ],
                    "meta": {
                        "correlationId": "str",
                        "jobId": "str",
                        "requestId": "str",
                        "responseType": "BOND_INDIC",
                        "status": "NEW",
                        "timeStamp": "2020-02-20 00:00:00"
                    },
                    "results": [
                        {
                            "description": "str",
                            "id": "str",
                            "priority": 0,
                            "source": "str",
                            "status": 0,
                            "target": "str"
                        }
                    ],
                    "summary": {
                        "accepted": 0,
                        "excluded": 0,
                        "rejected": 0,
                        "total": 0
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "text/plain"))
        cls: ClsType[Union[_models.ResultResponseBulkResultItem, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        _content = data

        _request = build_yield_book_rest_bulk_yb_port_udi_request_request(
            prefix=prefix,
            suffix=suffix,
            create_job=create_job,
            chain_job=chain_job,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ResultResponseBulkResultItem, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_py_calculation_sync(
        self,
        body: _models.PyCalcRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request PY calculation sync.

        :param body: Required.
        :type body: ~analyticsapi.models.PyCalcRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "coreLogicCollateral": "DEFAULT",
                        "currentCouponRates": "MOATS",
                        "custom": {
                            "str": "str"
                        },
                        "lookbackSettings": {
                            "basisLookbackDays": 0,
                            "ccoasLookbackDays": 0,
                            "curveDateRollLookback": bool,
                            "curveDateShiftLookbackDays": 0,
                            "curveLookbackDays": 0,
                            "mortgageDateLookbackDays": 0,
                            "volatilityLookbackDays": 0
                        },
                        "muniCapitalGainsRate": 0.0,
                        "muniDeMinimisAnnualDiscount": 0.0,
                        "muniOrdinaryIncomeRate": 0.0,
                        "prepayDials": {
                            "$ref": "str"
                        },
                        "pricingDate": "2020-02-20",
                        "retrieveOASPath": bool,
                        "retrievePPMProjection": bool,
                        "retrieveRollRateMatrix": bool,
                        "sbaIgnorePrepayPenalty": bool,
                        "sensitivityShocks": {
                            "currentCouponSpreads": 0.0,
                            "effectiveDuration": 0.0,
                            "hpa": 0.0,
                            "prepay": 0.0,
                            "prepayModelElbow": 0.0,
                            "prepayModelRefi": 0.0,
                            "spread": 0.0
                        },
                        "shockRepoRatesFutures": bool,
                        "use1000Path": bool,
                        "useCoreLogicGroupModel": bool,
                        "useFivePointConvexity": bool,
                        "useIBOR6M": bool,
                        "useLiveData": bool,
                        "useModelColHaircut": bool,
                        "useMuniNonCallCurve": bool,
                        "useMuniTaxSettings": bool,
                        "useNonQMCollateral": bool,
                        "useOIS": bool,
                        "usePreviousClose": bool,
                        "useStochasticHPA": bool
                    },
                    "input": [
                        {
                            "cloSettings": {
                                "callDate": "2020-02-20"
                            },
                            "cmbsSettings": {
                                "pricingScenarios": [
                                    {
                                        "customScenario": {
                                            "assumeCall": bool,
                                            "balloonDefault": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "balloonExtend": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defaults": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defeasance": "AUTO",
                                            "delay": bool,
                                            "delayBalloonMaturity": bool,
                                            "prepayment": {
                                                "rateAfterYieldToMaturity": 0.0,
                                                "rateDuringPremium": 0.0,
                                                "rateDuringYieldToMaturity": 0.0
                                            }
                                        },
                                        "primary": bool,
                                        "rate": 0.0,
                                        "systemScenarioName": "str",
                                        "type": "CPY"
                                    }
                                ]
                            },
                            "convertiblePricing": {
                                "creditSpread": 0.0,
                                "marketPrice": 0.0,
                                "method": "AT_MARKET",
                                "stockBorrowRate": 0.0,
                                "stockDividendYield": 0.0,
                                "stockPrice": 0.0,
                                "stockVolatility": 0.0
                            },
                            "currentCouponSpread": {
                                "$ref": "str"
                            },
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "customSettlement": "str",
                            "extraSettings": {
                                "currentCouponSpreadSensitivity": bool,
                                "includePartials": bool,
                                "indexSpreadDuration": bool,
                                "optionModel": "str",
                                "otherDurations": bool,
                                "partialVega": bool,
                                "partials": {
                                    "curveShift": 0.0,
                                    "curveType": "PAR",
                                    "partialDurationYears": [
                                        0.0
                                    ],
                                    "shockType": "SQUARE",
                                    "useCumulativeWaveMethod": bool
                                },
                                "prepayDuration": bool,
                                "primarySecondarySpreadDuration": bool,
                                "refiElbowDuration": bool,
                                "refiPrepayDuration": bool,
                                "turnoverPrepayDuration": bool,
                                "useOASToCall": bool,
                                "volatilityDuration": bool
                            },
                            "floaterSettings": {
                                "calculateToMaturity": bool,
                                "financeRate": 0.0,
                                "forwardIndexRate": 0.0,
                                "indexProjections": [
                                    {
                                        "index": "str",
                                        "termUnit": "MONTH",
                                        "values": [
                                            {
                                                "rate": 0.0,
                                                "term": 0
                                            }
                                        ]
                                    }
                                ],
                                "useForwardIndex": bool
                            },
                            "hecmSettings": {
                                "drawRate": 0.0,
                                "drawType": "CONSTANT",
                                "drawVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "idType": "str",
                            "identifier": "str",
                            "indexLinkerSettings": {
                                "realYieldBeta": 0.0
                            },
                            "level": "str",
                            "levelType": "str",
                            "levelValue": 0.0,
                            "lossSettings": {
                                "defaultRate": 0.0,
                                "defaultType": "SDA",
                                "defaultVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "delinquencyRate": 0.0,
                                "delinquencyType": "PERCENT",
                                "delinquencyVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "ignoreInsurance": bool,
                                "recoveryLag": 0,
                                "severityRate": 0.0,
                                "severityType": "PERCENT",
                                "severityVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useModelLoanModifications": bool
                            },
                            "mbsSettings": {
                                "callUnderlyingRemics": bool,
                                "useRollInfo": bool
                            },
                            "modification": {
                                "$ref": "str"
                            },
                            "muniSettings": {
                                "ignoreCallInfo": bool,
                                "paydownOptional": bool,
                                "useStubRate": bool
                            },
                            "prepaySettings": {
                                "modelToBalloon": bool,
                                "rate": 0.0,
                                "type": "Model",
                                "vector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "props": {
                                "str": {}
                            },
                            "settlementDate": "2020-02-20",
                            "settlementType": "MARKET",
                            "underlyingPrice": 0.0,
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str",
                            "volatility": {
                                "rate": 0.0,
                                "structureNote": {
                                    "callableZeroPricing": "NETPROCEED",
                                    "pricing": "DISCOUNTING"
                                },
                                "type": "Single",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_py_calculation_sync(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request PY calculation sync.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_py_calculation_sync(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request PY calculation sync.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_py_calculation_sync(
        self,
        body: Union[_models.PyCalcRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request PY calculation sync.

        :param body: Is one of the following types: PyCalcRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.PyCalcRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "coreLogicCollateral": "DEFAULT",
                        "currentCouponRates": "MOATS",
                        "custom": {
                            "str": "str"
                        },
                        "lookbackSettings": {
                            "basisLookbackDays": 0,
                            "ccoasLookbackDays": 0,
                            "curveDateRollLookback": bool,
                            "curveDateShiftLookbackDays": 0,
                            "curveLookbackDays": 0,
                            "mortgageDateLookbackDays": 0,
                            "volatilityLookbackDays": 0
                        },
                        "muniCapitalGainsRate": 0.0,
                        "muniDeMinimisAnnualDiscount": 0.0,
                        "muniOrdinaryIncomeRate": 0.0,
                        "prepayDials": {
                            "$ref": "str"
                        },
                        "pricingDate": "2020-02-20",
                        "retrieveOASPath": bool,
                        "retrievePPMProjection": bool,
                        "retrieveRollRateMatrix": bool,
                        "sbaIgnorePrepayPenalty": bool,
                        "sensitivityShocks": {
                            "currentCouponSpreads": 0.0,
                            "effectiveDuration": 0.0,
                            "hpa": 0.0,
                            "prepay": 0.0,
                            "prepayModelElbow": 0.0,
                            "prepayModelRefi": 0.0,
                            "spread": 0.0
                        },
                        "shockRepoRatesFutures": bool,
                        "use1000Path": bool,
                        "useCoreLogicGroupModel": bool,
                        "useFivePointConvexity": bool,
                        "useIBOR6M": bool,
                        "useLiveData": bool,
                        "useModelColHaircut": bool,
                        "useMuniNonCallCurve": bool,
                        "useMuniTaxSettings": bool,
                        "useNonQMCollateral": bool,
                        "useOIS": bool,
                        "usePreviousClose": bool,
                        "useStochasticHPA": bool
                    },
                    "input": [
                        {
                            "cloSettings": {
                                "callDate": "2020-02-20"
                            },
                            "cmbsSettings": {
                                "pricingScenarios": [
                                    {
                                        "customScenario": {
                                            "assumeCall": bool,
                                            "balloonDefault": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "balloonExtend": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defaults": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defeasance": "AUTO",
                                            "delay": bool,
                                            "delayBalloonMaturity": bool,
                                            "prepayment": {
                                                "rateAfterYieldToMaturity": 0.0,
                                                "rateDuringPremium": 0.0,
                                                "rateDuringYieldToMaturity": 0.0
                                            }
                                        },
                                        "primary": bool,
                                        "rate": 0.0,
                                        "systemScenarioName": "str",
                                        "type": "CPY"
                                    }
                                ]
                            },
                            "convertiblePricing": {
                                "creditSpread": 0.0,
                                "marketPrice": 0.0,
                                "method": "AT_MARKET",
                                "stockBorrowRate": 0.0,
                                "stockDividendYield": 0.0,
                                "stockPrice": 0.0,
                                "stockVolatility": 0.0
                            },
                            "currentCouponSpread": {
                                "$ref": "str"
                            },
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "customSettlement": "str",
                            "extraSettings": {
                                "currentCouponSpreadSensitivity": bool,
                                "includePartials": bool,
                                "indexSpreadDuration": bool,
                                "optionModel": "str",
                                "otherDurations": bool,
                                "partialVega": bool,
                                "partials": {
                                    "curveShift": 0.0,
                                    "curveType": "PAR",
                                    "partialDurationYears": [
                                        0.0
                                    ],
                                    "shockType": "SQUARE",
                                    "useCumulativeWaveMethod": bool
                                },
                                "prepayDuration": bool,
                                "primarySecondarySpreadDuration": bool,
                                "refiElbowDuration": bool,
                                "refiPrepayDuration": bool,
                                "turnoverPrepayDuration": bool,
                                "useOASToCall": bool,
                                "volatilityDuration": bool
                            },
                            "floaterSettings": {
                                "calculateToMaturity": bool,
                                "financeRate": 0.0,
                                "forwardIndexRate": 0.0,
                                "indexProjections": [
                                    {
                                        "index": "str",
                                        "termUnit": "MONTH",
                                        "values": [
                                            {
                                                "rate": 0.0,
                                                "term": 0
                                            }
                                        ]
                                    }
                                ],
                                "useForwardIndex": bool
                            },
                            "hecmSettings": {
                                "drawRate": 0.0,
                                "drawType": "CONSTANT",
                                "drawVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "idType": "str",
                            "identifier": "str",
                            "indexLinkerSettings": {
                                "realYieldBeta": 0.0
                            },
                            "level": "str",
                            "levelType": "str",
                            "levelValue": 0.0,
                            "lossSettings": {
                                "defaultRate": 0.0,
                                "defaultType": "SDA",
                                "defaultVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "delinquencyRate": 0.0,
                                "delinquencyType": "PERCENT",
                                "delinquencyVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "ignoreInsurance": bool,
                                "recoveryLag": 0,
                                "severityRate": 0.0,
                                "severityType": "PERCENT",
                                "severityVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useModelLoanModifications": bool
                            },
                            "mbsSettings": {
                                "callUnderlyingRemics": bool,
                                "useRollInfo": bool
                            },
                            "modification": {
                                "$ref": "str"
                            },
                            "muniSettings": {
                                "ignoreCallInfo": bool,
                                "paydownOptional": bool,
                                "useStubRate": bool
                            },
                            "prepaySettings": {
                                "modelToBalloon": bool,
                                "rate": 0.0,
                                "type": "Model",
                                "vector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "props": {
                                "str": {}
                            },
                            "settlementDate": "2020-02-20",
                            "settlementType": "MARKET",
                            "underlyingPrice": 0.0,
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str",
                            "volatility": {
                                "rate": 0.0,
                                "structureNote": {
                                    "callableZeroPricing": "NETPROCEED",
                                    "pricing": "DISCOUNTING"
                                },
                                "type": "Single",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_py_calculation_sync_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_py_calculation_async(
        self,
        body: _models.PyCalcRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request PY calculation async.

        :param body: Required.
        :type body: ~analyticsapi.models.PyCalcRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "coreLogicCollateral": "DEFAULT",
                        "currentCouponRates": "MOATS",
                        "custom": {
                            "str": "str"
                        },
                        "lookbackSettings": {
                            "basisLookbackDays": 0,
                            "ccoasLookbackDays": 0,
                            "curveDateRollLookback": bool,
                            "curveDateShiftLookbackDays": 0,
                            "curveLookbackDays": 0,
                            "mortgageDateLookbackDays": 0,
                            "volatilityLookbackDays": 0
                        },
                        "muniCapitalGainsRate": 0.0,
                        "muniDeMinimisAnnualDiscount": 0.0,
                        "muniOrdinaryIncomeRate": 0.0,
                        "prepayDials": {
                            "$ref": "str"
                        },
                        "pricingDate": "2020-02-20",
                        "retrieveOASPath": bool,
                        "retrievePPMProjection": bool,
                        "retrieveRollRateMatrix": bool,
                        "sbaIgnorePrepayPenalty": bool,
                        "sensitivityShocks": {
                            "currentCouponSpreads": 0.0,
                            "effectiveDuration": 0.0,
                            "hpa": 0.0,
                            "prepay": 0.0,
                            "prepayModelElbow": 0.0,
                            "prepayModelRefi": 0.0,
                            "spread": 0.0
                        },
                        "shockRepoRatesFutures": bool,
                        "use1000Path": bool,
                        "useCoreLogicGroupModel": bool,
                        "useFivePointConvexity": bool,
                        "useIBOR6M": bool,
                        "useLiveData": bool,
                        "useModelColHaircut": bool,
                        "useMuniNonCallCurve": bool,
                        "useMuniTaxSettings": bool,
                        "useNonQMCollateral": bool,
                        "useOIS": bool,
                        "usePreviousClose": bool,
                        "useStochasticHPA": bool
                    },
                    "input": [
                        {
                            "cloSettings": {
                                "callDate": "2020-02-20"
                            },
                            "cmbsSettings": {
                                "pricingScenarios": [
                                    {
                                        "customScenario": {
                                            "assumeCall": bool,
                                            "balloonDefault": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "balloonExtend": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defaults": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defeasance": "AUTO",
                                            "delay": bool,
                                            "delayBalloonMaturity": bool,
                                            "prepayment": {
                                                "rateAfterYieldToMaturity": 0.0,
                                                "rateDuringPremium": 0.0,
                                                "rateDuringYieldToMaturity": 0.0
                                            }
                                        },
                                        "primary": bool,
                                        "rate": 0.0,
                                        "systemScenarioName": "str",
                                        "type": "CPY"
                                    }
                                ]
                            },
                            "convertiblePricing": {
                                "creditSpread": 0.0,
                                "marketPrice": 0.0,
                                "method": "AT_MARKET",
                                "stockBorrowRate": 0.0,
                                "stockDividendYield": 0.0,
                                "stockPrice": 0.0,
                                "stockVolatility": 0.0
                            },
                            "currentCouponSpread": {
                                "$ref": "str"
                            },
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "customSettlement": "str",
                            "extraSettings": {
                                "currentCouponSpreadSensitivity": bool,
                                "includePartials": bool,
                                "indexSpreadDuration": bool,
                                "optionModel": "str",
                                "otherDurations": bool,
                                "partialVega": bool,
                                "partials": {
                                    "curveShift": 0.0,
                                    "curveType": "PAR",
                                    "partialDurationYears": [
                                        0.0
                                    ],
                                    "shockType": "SQUARE",
                                    "useCumulativeWaveMethod": bool
                                },
                                "prepayDuration": bool,
                                "primarySecondarySpreadDuration": bool,
                                "refiElbowDuration": bool,
                                "refiPrepayDuration": bool,
                                "turnoverPrepayDuration": bool,
                                "useOASToCall": bool,
                                "volatilityDuration": bool
                            },
                            "floaterSettings": {
                                "calculateToMaturity": bool,
                                "financeRate": 0.0,
                                "forwardIndexRate": 0.0,
                                "indexProjections": [
                                    {
                                        "index": "str",
                                        "termUnit": "MONTH",
                                        "values": [
                                            {
                                                "rate": 0.0,
                                                "term": 0
                                            }
                                        ]
                                    }
                                ],
                                "useForwardIndex": bool
                            },
                            "hecmSettings": {
                                "drawRate": 0.0,
                                "drawType": "CONSTANT",
                                "drawVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "idType": "str",
                            "identifier": "str",
                            "indexLinkerSettings": {
                                "realYieldBeta": 0.0
                            },
                            "level": "str",
                            "levelType": "str",
                            "levelValue": 0.0,
                            "lossSettings": {
                                "defaultRate": 0.0,
                                "defaultType": "SDA",
                                "defaultVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "delinquencyRate": 0.0,
                                "delinquencyType": "PERCENT",
                                "delinquencyVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "ignoreInsurance": bool,
                                "recoveryLag": 0,
                                "severityRate": 0.0,
                                "severityType": "PERCENT",
                                "severityVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useModelLoanModifications": bool
                            },
                            "mbsSettings": {
                                "callUnderlyingRemics": bool,
                                "useRollInfo": bool
                            },
                            "modification": {
                                "$ref": "str"
                            },
                            "muniSettings": {
                                "ignoreCallInfo": bool,
                                "paydownOptional": bool,
                                "useStubRate": bool
                            },
                            "prepaySettings": {
                                "modelToBalloon": bool,
                                "rate": 0.0,
                                "type": "Model",
                                "vector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "props": {
                                "str": {}
                            },
                            "settlementDate": "2020-02-20",
                            "settlementType": "MARKET",
                            "underlyingPrice": 0.0,
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str",
                            "volatility": {
                                "rate": 0.0,
                                "structureNote": {
                                    "callableZeroPricing": "NETPROCEED",
                                    "pricing": "DISCOUNTING"
                                },
                                "type": "Single",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_py_calculation_async(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request PY calculation async.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_py_calculation_async(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request PY calculation async.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_py_calculation_async(
        self,
        body: Union[_models.PyCalcRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request PY calculation async.

        :param body: Is one of the following types: PyCalcRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.PyCalcRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "globalSettings": {
                        "coreLogicCollateral": "DEFAULT",
                        "currentCouponRates": "MOATS",
                        "custom": {
                            "str": "str"
                        },
                        "lookbackSettings": {
                            "basisLookbackDays": 0,
                            "ccoasLookbackDays": 0,
                            "curveDateRollLookback": bool,
                            "curveDateShiftLookbackDays": 0,
                            "curveLookbackDays": 0,
                            "mortgageDateLookbackDays": 0,
                            "volatilityLookbackDays": 0
                        },
                        "muniCapitalGainsRate": 0.0,
                        "muniDeMinimisAnnualDiscount": 0.0,
                        "muniOrdinaryIncomeRate": 0.0,
                        "prepayDials": {
                            "$ref": "str"
                        },
                        "pricingDate": "2020-02-20",
                        "retrieveOASPath": bool,
                        "retrievePPMProjection": bool,
                        "retrieveRollRateMatrix": bool,
                        "sbaIgnorePrepayPenalty": bool,
                        "sensitivityShocks": {
                            "currentCouponSpreads": 0.0,
                            "effectiveDuration": 0.0,
                            "hpa": 0.0,
                            "prepay": 0.0,
                            "prepayModelElbow": 0.0,
                            "prepayModelRefi": 0.0,
                            "spread": 0.0
                        },
                        "shockRepoRatesFutures": bool,
                        "use1000Path": bool,
                        "useCoreLogicGroupModel": bool,
                        "useFivePointConvexity": bool,
                        "useIBOR6M": bool,
                        "useLiveData": bool,
                        "useModelColHaircut": bool,
                        "useMuniNonCallCurve": bool,
                        "useMuniTaxSettings": bool,
                        "useNonQMCollateral": bool,
                        "useOIS": bool,
                        "usePreviousClose": bool,
                        "useStochasticHPA": bool
                    },
                    "input": [
                        {
                            "cloSettings": {
                                "callDate": "2020-02-20"
                            },
                            "cmbsSettings": {
                                "pricingScenarios": [
                                    {
                                        "customScenario": {
                                            "assumeCall": bool,
                                            "balloonDefault": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "balloonExtend": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defaults": {
                                                "lossRate": 0.0,
                                                "lossSeverity": 0.0,
                                                "lossType": "PLD",
                                                "lossVector": {
                                                    "index": "str",
                                                    "interpolationType": "INTERPOLATED",
                                                    "values": [
                                                        {
                                                            "month": 0,
                                                            "rate": 0.0
                                                        }
                                                    ]
                                                },
                                                "monthToExtend": 0,
                                                "percent": 0.0,
                                                "recoveryPeriod": 0
                                            },
                                            "defeasance": "AUTO",
                                            "delay": bool,
                                            "delayBalloonMaturity": bool,
                                            "prepayment": {
                                                "rateAfterYieldToMaturity": 0.0,
                                                "rateDuringPremium": 0.0,
                                                "rateDuringYieldToMaturity": 0.0
                                            }
                                        },
                                        "primary": bool,
                                        "rate": 0.0,
                                        "systemScenarioName": "str",
                                        "type": "CPY"
                                    }
                                ]
                            },
                            "convertiblePricing": {
                                "creditSpread": 0.0,
                                "marketPrice": 0.0,
                                "method": "AT_MARKET",
                                "stockBorrowRate": 0.0,
                                "stockDividendYield": 0.0,
                                "stockPrice": 0.0,
                                "stockVolatility": 0.0
                            },
                            "currentCouponSpread": {
                                "$ref": "str"
                            },
                            "curve": {
                                "currency": "str",
                                "curveType": "GVT",
                                "retrieveCurve": bool,
                                "snapshot": "FOUR_PM",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            },
                            "customSettlement": "str",
                            "extraSettings": {
                                "currentCouponSpreadSensitivity": bool,
                                "includePartials": bool,
                                "indexSpreadDuration": bool,
                                "optionModel": "str",
                                "otherDurations": bool,
                                "partialVega": bool,
                                "partials": {
                                    "curveShift": 0.0,
                                    "curveType": "PAR",
                                    "partialDurationYears": [
                                        0.0
                                    ],
                                    "shockType": "SQUARE",
                                    "useCumulativeWaveMethod": bool
                                },
                                "prepayDuration": bool,
                                "primarySecondarySpreadDuration": bool,
                                "refiElbowDuration": bool,
                                "refiPrepayDuration": bool,
                                "turnoverPrepayDuration": bool,
                                "useOASToCall": bool,
                                "volatilityDuration": bool
                            },
                            "floaterSettings": {
                                "calculateToMaturity": bool,
                                "financeRate": 0.0,
                                "forwardIndexRate": 0.0,
                                "indexProjections": [
                                    {
                                        "index": "str",
                                        "termUnit": "MONTH",
                                        "values": [
                                            {
                                                "rate": 0.0,
                                                "term": 0
                                            }
                                        ]
                                    }
                                ],
                                "useForwardIndex": bool
                            },
                            "hecmSettings": {
                                "drawRate": 0.0,
                                "drawType": "CONSTANT",
                                "drawVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "idType": "str",
                            "identifier": "str",
                            "indexLinkerSettings": {
                                "realYieldBeta": 0.0
                            },
                            "level": "str",
                            "levelType": "str",
                            "levelValue": 0.0,
                            "lossSettings": {
                                "defaultRate": 0.0,
                                "defaultType": "SDA",
                                "defaultVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "delinquencyRate": 0.0,
                                "delinquencyType": "PERCENT",
                                "delinquencyVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "ignoreInsurance": bool,
                                "recoveryLag": 0,
                                "severityRate": 0.0,
                                "severityType": "PERCENT",
                                "severityVector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                },
                                "useModelLoanModifications": bool
                            },
                            "mbsSettings": {
                                "callUnderlyingRemics": bool,
                                "useRollInfo": bool
                            },
                            "modification": {
                                "$ref": "str"
                            },
                            "muniSettings": {
                                "ignoreCallInfo": bool,
                                "paydownOptional": bool,
                                "useStubRate": bool
                            },
                            "prepaySettings": {
                                "modelToBalloon": bool,
                                "rate": 0.0,
                                "type": "Model",
                                "vector": {
                                    "index": "str",
                                    "interpolationType": "INTERPOLATED",
                                    "values": [
                                        {
                                            "month": 0,
                                            "rate": 0.0
                                        }
                                    ]
                                }
                            },
                            "props": {
                                "str": {}
                            },
                            "settlementDate": "2020-02-20",
                            "settlementType": "MARKET",
                            "underlyingPrice": 0.0,
                            "userInstrument": {
                                "$ref": "str"
                            },
                            "userTag": "str",
                            "volatility": {
                                "rate": 0.0,
                                "structureNote": {
                                    "callableZeroPricing": "NETPROCEED",
                                    "pricing": "DISCOUNTING"
                                },
                                "type": "Single",
                                "userDefined": {
                                    "$ref": "str"
                                }
                            }
                        }
                    ],
                    "keywords": [
                        "str"
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_py_calculation_async_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_py_calculation_sync_by_id(
        self,
        id: str,
        *,
        level: str,
        curve_type: Union[str, _models.YbRestCurveType],
        id_type: Optional[str] = None,
        pricing_date: Optional[datetime.date] = None,
        currency: Optional[str] = None,
        prepay_type: Optional[str] = None,
        prepay_rate: Optional[float] = None,
        option_model: Optional[Union[str, _models.OptionModel]] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request PY calculation sync by ID.

        :param id: Required.
        :type id: str
        :keyword level: Required.
        :paramtype level: str
        :keyword curve_type: Known values are: "GVT", "GVT_TSYM", "GVT_TSYM_MUNI", "GVT_AGN",
         "GVT_MUNI", "GVT_BUND", "SWAP", "SWAP_RFR", "SWAP_MUNI", and "SWAP_LIB6M". Required.
        :paramtype curve_type: str or ~analyticsapi.models.YbRestCurveType
        :keyword id_type: Default value is None.
        :paramtype id_type: str
        :keyword pricing_date: Default value is None.
        :paramtype pricing_date: ~datetime.date
        :keyword currency: Default value is None.
        :paramtype currency: str
        :keyword prepay_type: Default value is None.
        :paramtype prepay_type: str
        :keyword prepay_rate: Default value is None.
        :paramtype prepay_rate: float
        :keyword option_model: Known values are: "OAS", "OASEDUR", and "YCMARGIN". Default value is
         None.
        :paramtype option_model: str or ~analyticsapi.models.OptionModel
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_py_calculation_sync_by_id_request(
            id=id,
            level=level,
            curve_type=curve_type,
            id_type=id_type,
            pricing_date=pricing_date,
            currency=currency,
            prepay_type=prepay_type,
            prepay_rate=prepay_rate,
            option_model=option_model,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_py_calculation_async_by_id(
        self,
        id: str,
        *,
        level: str,
        curve_type: Union[str, _models.YbRestCurveType],
        id_type: Optional[str] = None,
        pricing_date: Optional[datetime.date] = None,
        currency: Optional[str] = None,
        prepay_type: Optional[str] = None,
        prepay_rate: Optional[float] = None,
        option_model: Optional[Union[str, _models.OptionModel]] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request PY calculation async by ID.

        :param id: Required.
        :type id: str
        :keyword level: Required.
        :paramtype level: str
        :keyword curve_type: Known values are: "GVT", "GVT_TSYM", "GVT_TSYM_MUNI", "GVT_AGN",
         "GVT_MUNI", "GVT_BUND", "SWAP", "SWAP_RFR", "SWAP_MUNI", and "SWAP_LIB6M". Required.
        :paramtype curve_type: str or ~analyticsapi.models.YbRestCurveType
        :keyword id_type: Default value is None.
        :paramtype id_type: str
        :keyword pricing_date: Default value is None.
        :paramtype pricing_date: ~datetime.date
        :keyword currency: Default value is None.
        :paramtype currency: str
        :keyword prepay_type: Default value is None.
        :paramtype prepay_type: str
        :keyword prepay_rate: Default value is None.
        :paramtype prepay_rate: float
        :keyword option_model: Known values are: "OAS", "OASEDUR", and "YCMARGIN". Default value is
         None.
        :paramtype option_model: str or ~analyticsapi.models.OptionModel
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_py_calculation_async_by_id_request(
            id=id,
            level=level,
            curve_type=curve_type,
            id_type=id_type,
            pricing_date=pricing_date,
            currency=currency,
            prepay_type=prepay_type,
            prepay_rate=prepay_rate,
            option_model=option_model,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_volatility_sync(
        self,
        currency: str,
        date: str,
        *,
        quote_type: str,
        vol_model: Optional[str] = None,
        vol_type: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request volatility sync.

        :param currency: Currency should be a 3 letter upper case string. Required.
        :type currency: str
        :param date: Required.
        :type date: str
        :keyword quote_type: Should be one of the following - Market, Calibrated, SOFRMarket,
         LIBORMarket. Required.
        :paramtype quote_type: str
        :keyword vol_model: Default value is None.
        :paramtype vol_model: str
        :keyword vol_type: Should be one of the following - NORM, BLACK. Default value is None.
        :paramtype vol_type: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_volatility_sync_request(
            currency=currency,
            date=date,
            quote_type=quote_type,
            vol_model=vol_model,
            vol_type=vol_type,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_volatility_async(
        self,
        currency: str,
        date: str,
        *,
        quote_type: str,
        vol_model: Optional[str] = None,
        vol_type: Optional[str] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request volatility async.

        :param currency: Currency should be a 3 letter upper case string. Required.
        :type currency: str
        :param date: Required.
        :type date: str
        :keyword quote_type: Should be one of the following - Market, Calibrated, SOFRMarket,
         LIBORMarket. Required.
        :paramtype quote_type: str
        :keyword vol_model: Default value is None.
        :paramtype vol_model: str
        :keyword vol_type: Should be one of the following - NORM, BLACK. Default value is None.
        :paramtype vol_type: str
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_volatility_async_request(
            currency=currency,
            date=date,
            quote_type=quote_type,
            vol_model=vol_model,
            vol_type=vol_type,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_curves_sync(
        self,
        body: _models.CurveDetailsRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request curves sync.

        :param body: Required.
        :type body: ~analyticsapi.models.CurveDetailsRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "curves": [
                        {
                            "cdsTicker": "str",
                            "currency": "str",
                            "curveId": "str",
                            "curveType": "GVT",
                            "expandCurve": bool,
                            "forwardPeriod": 0.0,
                            "impliedForwardDelay": 0.0,
                            "index": "str",
                            "pricingDate": "2020-02-20",
                            "showDiscountFactor": bool,
                            "showForwardRate": bool,
                            "showSpotRate": bool,
                            "useLiveCurve": bool
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_curves_sync(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request curves sync.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_curves_sync(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request curves sync.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_curves_sync(
        self,
        body: Union[_models.CurveDetailsRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request curves sync.

        :param body: Is one of the following types: CurveDetailsRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.CurveDetailsRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "curves": [
                        {
                            "cdsTicker": "str",
                            "currency": "str",
                            "curveId": "str",
                            "curveType": "GVT",
                            "expandCurve": bool,
                            "forwardPeriod": 0.0,
                            "impliedForwardDelay": 0.0,
                            "index": "str",
                            "pricingDate": "2020-02-20",
                            "showDiscountFactor": bool,
                            "showForwardRate": bool,
                            "showSpotRate": bool,
                            "useLiveCurve": bool
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_curves_sync_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def request_curves_async(
        self,
        body: _models.CurveDetailsRequest,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request curves async.

        :param body: Required.
        :type body: ~analyticsapi.models.CurveDetailsRequest
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "curves": [
                        {
                            "cdsTicker": "str",
                            "currency": "str",
                            "curveId": "str",
                            "curveType": "GVT",
                            "expandCurve": bool,
                            "forwardPeriod": 0.0,
                            "impliedForwardDelay": 0.0,
                            "index": "str",
                            "pricingDate": "2020-02-20",
                            "showDiscountFactor": bool,
                            "showForwardRate": bool,
                            "showSpotRate": bool,
                            "useLiveCurve": bool
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_curves_async(
        self,
        body: JSON,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request curves async.

        :param body: Required.
        :type body: JSON
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def request_curves_async(
        self,
        body: IO[bytes],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request curves async.

        :param body: Required.
        :type body: IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def request_curves_async(
        self,
        body: Union[_models.CurveDetailsRequest, JSON, IO[bytes]],
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request curves async.

        :param body: Is one of the following types: CurveDetailsRequest, JSON, IO[bytes] Required.
        :type body: ~analyticsapi.models.CurveDetailsRequest or JSON or IO[bytes]
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "curves": [
                        {
                            "cdsTicker": "str",
                            "currency": "str",
                            "curveId": "str",
                            "curveType": "GVT",
                            "expandCurve": bool,
                            "forwardPeriod": 0.0,
                            "impliedForwardDelay": 0.0,
                            "index": "str",
                            "pricingDate": "2020-02-20",
                            "showDiscountFactor": bool,
                            "showForwardRate": bool,
                            "showSpotRate": bool,
                            "useLiveCurve": bool
                        }
                    ]
                }

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("content-type", None))
        cls: ClsType[Union[_models.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_yield_book_rest_request_curves_async_request(
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_curve_sync(
        self,
        date: datetime.date,
        *,
        currency: str,
        curve_type: Union[str, _models.YbRestCurveType],
        cds_ticker: Optional[str] = None,
        expand_curve: Optional[bool] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Request curve sync.

        :param date: Required.
        :type date: ~datetime.date
        :keyword currency: Required.
        :paramtype currency: str
        :keyword curve_type: Known values are: "GVT", "GVT_TSYM", "GVT_TSYM_MUNI", "GVT_AGN",
         "GVT_MUNI", "GVT_BUND", "SWAP", "SWAP_RFR", "SWAP_MUNI", and "SWAP_LIB6M". Required.
        :paramtype curve_type: str or ~analyticsapi.models.YbRestCurveType
        :keyword cds_ticker: Default value is None.
        :paramtype cds_ticker: str
        :keyword expand_curve: Default value is None.
        :paramtype expand_curve: bool
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_curve_sync_request(
            date=date,
            currency=currency,
            curve_type=curve_type,
            cds_ticker=cds_ticker,
            expand_curve=expand_curve,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def request_curve_async(
        self,
        date: datetime.date,
        *,
        currency: str,
        curve_type: Union[str, _models.YbRestCurveType],
        cds_ticker: Optional[str] = None,
        expand_curve: Optional[bool] = None,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[_models.RequestId, _models.ServiceErrorResponse]:
        """Request curve async.

        :param date: Required.
        :type date: ~datetime.date
        :keyword currency: Required.
        :paramtype currency: str
        :keyword curve_type: Known values are: "GVT", "GVT_TSYM", "GVT_TSYM_MUNI", "GVT_AGN",
         "GVT_MUNI", "GVT_BUND", "SWAP", "SWAP_RFR", "SWAP_MUNI", and "SWAP_LIB6M". Required.
        :paramtype curve_type: str or ~analyticsapi.models.YbRestCurveType
        :keyword cds_ticker: Default value is None.
        :paramtype cds_ticker: str
        :keyword expand_curve: Default value is None.
        :paramtype expand_curve: bool
        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: RequestId or ServiceErrorResponse. The RequestId is compatible with MutableMapping
        :rtype: ~analyticsapi.models.RequestId or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "requestId": "str"
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.RequestId, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_request_curve_async_request(
            date=date,
            currency=currency,
            curve_type=curve_type,
            cds_ticker=cds_ticker,
            expand_curve=expand_curve,
            job=job,
            name=name,
            pri=pri,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.RequestId, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def get_tba_pricing_sync(
        self,
        *,
        job: Optional[str] = None,
        name: Optional[str] = None,
        pri: Optional[int] = None,
        naf: Optional[datetime.datetime] = None,
        dep: Optional[str] = None,
        visible: Optional[Union[str, _models.Visible]] = None,
        parent_req: Optional[str] = None,
        tags: Optional[List[str]] = None,
        **kwargs: Any,
    ) -> Union[Dict[str, Any], _models.ServiceErrorResponse]:
        """Get tba-pricing sync.

        :keyword job: Job reference. This can be of the form J-number or job name. Default value is
         None.
        :paramtype job: str
        :keyword name: User provided name. Default value is None.
        :paramtype name: str
        :keyword pri: Priority for this request in the queue. Default value is None.
        :paramtype pri: int
        :keyword naf: YYYY-MM-DDTHH:MM:SS. Default value is None.
        :paramtype naf: ~datetime.datetime
        :keyword dep: Default value is None.
        :paramtype dep: str
        :keyword visible: Known values are: "Y", "U", and "N". Default value is None.
        :paramtype visible: str or ~analyticsapi.models.Visible
        :keyword parent_req: Example: R-1. Default value is None.
        :paramtype parent_req: str
        :keyword tags: Default value is None.
        :paramtype tags: list[str]
        :return: dict mapping str to any or ServiceErrorResponse. The ServiceErrorResponse is
         compatible with MutableMapping
        :rtype: dict[str, any] or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "str": {}
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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[Dict[str, Any], _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_yield_book_rest_get_tba_pricing_sync_request(
            job=job,
            name=name,
            pri=pri,
            naf=naf,
            dep=dep,
            visible=visible,
            parent_req=parent_req,
            tags=tags,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(Dict[str, Any], response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class instrumentTemplatesResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`instrument_templates_resource` attribute.
    """

    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")

    async def list(
        self,
        *,
        item_per_page: Optional[int] = None,
        page: Optional[int] = None,
        spaces: Optional[List[str]] = None,
        names: Optional[List[str]] = None,
        space_name_sort_order: Optional[Union[str, _models.SortingOrderEnum]] = None,
        tags: Optional[List[str]] = None,
        fields: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[_models.InstrumentTemplateCollectionResponse, _models.ServiceErrorResponse]:
        """List the InstrumentTemplates existing in the platform (depending on permissions).

        :keyword item_per_page: A parameter used to select the number of items allowed per page. The
         valid range is 1-500. If not provided, 50 will be used. Default value is None.
        :paramtype item_per_page: int
        :keyword page: A parameter used to define the page number to display. Default value is None.
        :paramtype page: int
        :keyword spaces: A parameter used to search for platform resources stored in a given space.
         Space is like a namespace where resources are stored. By default there are two spaces:
         LSEG is reserved for LSEG maintained resources, HOME is reserved for user's default space.
         If space is not specified, it will search within all spaces. Default value is None.
        :paramtype spaces: list[str]
        :keyword names: A parameter used to search for platform resources with given names. Default
         value is None.
        :paramtype names: list[str]
        :keyword space_name_sort_order: A parameter used to sort platform resources by name based on a
         defined order. Known values are: "Asc" and "Desc". Default value is None.
        :paramtype space_name_sort_order: str or ~analyticsapi.models.SortingOrderEnum
        :keyword tags: A parameter used to search for platform resources with given tags. Default value
         is None.
        :paramtype tags: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: InstrumentTemplateCollectionResponse or ServiceErrorResponse. The
         InstrumentTemplateCollectionResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateCollectionResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.InstrumentTemplateCollectionResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        _request = build_instrument_templates_resource_list_request(
            item_per_page=item_per_page,
            page=page,
            spaces=spaces,
            names=names,
            space_name_sort_order=space_name_sort_order,
            tags=tags,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.InstrumentTemplateCollectionResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create(
        self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Save a new InstrumentTemplate in the platform.

        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": instrument_template_definition,
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self,
        *,
        location: _models.Location,
        definition: _models.InstrumentTemplateDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Save a new InstrumentTemplate in the platform.

        :keyword location: Object defining the location of the InstrumentTemplate in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the InstrumentTemplate. Required.
        :paramtype definition: ~analyticsapi.models.InstrumentTemplateDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the InstrumentTemplate. Default value is
         None.
        :paramtype description: ~analyticsapi.models.Description
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Save a new InstrumentTemplate in the platform.

        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.InstrumentTemplateDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Save a new InstrumentTemplate in the platform.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the InstrumentTemplate in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the InstrumentTemplate. Required.
        :paramtype definition: ~analyticsapi.models.InstrumentTemplateDefinition
        :keyword description: Object defining metadata for the InstrumentTemplate. Default value is
         None.
        :paramtype description: ~analyticsapi.models.Description
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": instrument_template_definition,
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_instrument_templates_resource_create_request(
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            201,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 201:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.InstrumentTemplateResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class instrumentTemplateResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`instrument_template_resource` attribute.
    """

    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")

    async def read(
        self, template_id: str, *, fields: Optional[str] = None, **kwargs: Any
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Access a InstrumentTemplate existing in the platform (read).

        :param template_id: Required.
        :type template_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.InstrumentTemplateResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_instrument_template_resource_read_request(
            template_id=template_id,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.InstrumentTemplateResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def delete(self, template_id: str, **kwargs: Any) -> Optional[_models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Delete a InstrumentTemplate that exists in the platform.

        :param template_id: Required.
        :type template_id: str
        :return: ServiceErrorResponse or None. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.ServiceErrorResponse or None
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_instrument_template_resource_delete_request(
            template_id=template_id,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            204,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        deserialized = None
        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def overwrite(
        self, template_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a InstrumentTemplate that exists in the platform.

        :param template_id: Required.
        :type template_id: str
        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": instrument_template_definition,
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self,
        template_id: str,
        *,
        location: _models.Location,
        definition: _models.InstrumentTemplateDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a InstrumentTemplate that exists in the platform.

        :param template_id: Required.
        :type template_id: str
        :keyword location: Object defining the location of the InstrumentTemplate in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the InstrumentTemplate. Required.
        :paramtype definition: ~analyticsapi.models.InstrumentTemplateDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the InstrumentTemplate. Default value is
         None.
        :paramtype description: ~analyticsapi.models.Description
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self, template_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a InstrumentTemplate that exists in the platform.

        :param template_id: Required.
        :type template_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def overwrite(
        self,
        template_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.InstrumentTemplateDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a InstrumentTemplate that exists in the platform.

        :param template_id: Required.
        :type template_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the InstrumentTemplate in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the InstrumentTemplate. Required.
        :paramtype definition: ~analyticsapi.models.InstrumentTemplateDefinition
        :keyword description: Object defining metadata for the InstrumentTemplate. Default value is
         None.
        :paramtype description: ~analyticsapi.models.Description
        :return: InstrumentTemplateResponse or ServiceErrorResponse. The InstrumentTemplateResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.InstrumentTemplateResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": instrument_template_definition,
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "instrumentType":

                # JSON input template for discriminator value "AsianOtcOption":
                instrument_template_definition = {
                    "instrumentType": "AsianOtcOption",
                    "template": {
                        "exercise": {
                            "strike": 0.0,
                            "exerciseStyle": "str",
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "underlying": underlying_definition,
                        "asian": {
                            "asianType": "str",
                            "averageType": "str",
                            "fixingSchedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierDown": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "barrierUp": {
                            "barrierMode": "str",
                            "inOrOut": "str",
                            "level": 0.0,
                            "rebateAmount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "schedule": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            }
                        },
                        "binaryDown": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "binaryUp": {
                            "binaryType": "str",
                            "level": 0.0,
                            "paymentType": "str",
                            "payoutAmount": {
                                "currency": "str",
                                "value": 0.0
                            }
                        },
                        "notionalAmount": {
                            "currency": "str",
                            "value": 0.0
                        },
                        "optionType": "str",
                        "settlement": {
                            "currency": "str",
                            "deliveryDate": date,
                            "type": "str"
                        }
                    }
                }

                # JSON input template for discriminator value "Bond":
                underlying_definition = {
                    "underlyingType": "Bond",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "BondFuture":
                underlying_definition = {
                    "underlyingType": "BondFuture",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Commodity":
                underlying_definition = {
                    "underlyingType": "Commodity",
                    "code": "str",
                    "definition": "str"
                }

                # JSON input template for discriminator value "Equity":
                underlying_definition = {
                    "underlyingType": "Equity",
                    "code": "str",
                    "definition": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": instrument_template_definition,
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.InstrumentTemplateResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_instrument_template_resource_overwrite_request(
            template_id=template_id,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.InstrumentTemplateResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class irSwapsResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`ir_swaps_resource` attribute.
    """

    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")

    async def list(
        self,
        *,
        item_per_page: Optional[int] = None,
        page: Optional[int] = None,
        spaces: Optional[List[str]] = None,
        names: Optional[List[str]] = None,
        space_name_sort_order: Optional[Union[str, _models.SortingOrderEnum]] = None,
        tags: Optional[List[str]] = None,
        fields: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapCollectionResponse, _models.ServiceErrorResponse]:
        """List the IrSwaps existing in the platform (depending on permissions).

        :keyword item_per_page: A parameter used to select the number of items allowed per page. The
         valid range is 1-500. If not provided, 50 will be used. Default value is None.
        :paramtype item_per_page: int
        :keyword page: A parameter used to define the page number to display. Default value is None.
        :paramtype page: int
        :keyword spaces: A parameter used to search for platform resources stored in a given space.
         Space is like a namespace where resources are stored. By default there are two spaces:
         LSEG is reserved for LSEG maintained resources, HOME is reserved for user's default space.
         If space is not specified, it will search within all spaces. Default value is None.
        :paramtype spaces: list[str]
        :keyword names: A parameter used to search for platform resources with given names. Default
         value is None.
        :paramtype names: list[str]
        :keyword space_name_sort_order: A parameter used to sort platform resources by name based on a
         defined order. Known values are: "Asc" and "Desc". Default value is None.
        :paramtype space_name_sort_order: str or ~analyticsapi.models.SortingOrderEnum
        :keyword tags: A parameter used to search for platform resources with given tags. Default value
         is None.
        :paramtype tags: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: IrSwapCollectionResponse or ServiceErrorResponse. The IrSwapCollectionResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapCollectionResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.IrSwapCollectionResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_ir_swaps_resource_list_request(
            item_per_page=item_per_page,
            page=page,
            spaces=spaces,
            names=names,
            space_name_sort_order=space_name_sort_order,
            tags=tags,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrSwapCollectionResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create(
        self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Save a new IrSwap in the platform.

        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self,
        *,
        location: _models.Location,
        definition: _models.IrSwapDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Save a new IrSwap in the platform.

        :keyword location: Object defining the location of the IrSwap in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the IrSwap. Required.
        :paramtype definition: ~analyticsapi.models.IrSwapDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the IrSwap. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Save a new IrSwap in the platform.

        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.IrSwapDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Save a new IrSwap in the platform.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the IrSwap in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the IrSwap. Required.
        :paramtype definition: ~analyticsapi.models.IrSwapDefinition
        :keyword description: Object defining metadata for the IrSwap. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrSwapResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swaps_resource_create_request(
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            201,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 201:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrSwapResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def solve(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrSwapInstrumentArraySolveResponse, _models.ServiceErrorResponse]:
        """Solve an IrSwap by requesting a custom definition.

        Calculate the price of a swap (e.g., fixed rate) provided in the request so that a chosen
        property (e.g., market value, duration) equals a target value.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapInstrumentArraySolveResponse or ServiceErrorResponse. The
         IrSwapInstrumentArraySolveResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentArraySolveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "indexConvexity": {
                            "integrationMethod": "str",
                            "method": "str",
                            "meanReversionPercent": 0.0,
                            "volatilityPercent": 0.0
                        },
                        "reportCurrency": "str",
                        "solvingParameters": {
                            "target": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "fixedRate": {
                                    "unit": "str",
                                    "value": 0.0
                                },
                                "leg": "str",
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "spread": {
                                    "unit": "str",
                                    "value": 0.0
                                }
                            },
                            "variable": {
                                "leg": "str",
                                "name": "str"
                            }
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": "2020-02-20",
                                    "instrumentDescription": "str",
                                    "startDate": "2020-02-20",
                                    "tenor": "str",
                                    "instrumentTag": "str"
                                },
                                "solving": {
                                    "method": {
                                        "lowerBound": 0.0,
                                        "name": "str",
                                        "upperBound": 0.0,
                                        "guess": 0.0
                                    },
                                    "result": 0.0
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "firstLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "secondLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "firstLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "secondLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "upfrontPayment": {
                                        "amount": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "payer": "str",
                                        "receiver": "str",
                                        "date": date
                                    }
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def solve(
        self,
        *,
        definitions: List[_models.IrSwapDefinitionInstrument],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.IrPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentArraySolveResponse, _models.ServiceErrorResponse]:
        """Solve an IrSwap by requesting a custom definition.

        Calculate the price of a swap (e.g., fixed rate) provided in the request so that a chosen
        property (e.g., market value, duration) equals a target value.

        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.IrSwapDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.IrPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: IrSwapInstrumentArraySolveResponse or ServiceErrorResponse. The
         IrSwapInstrumentArraySolveResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentArraySolveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": "2020-02-20",
                                    "instrumentDescription": "str",
                                    "startDate": "2020-02-20",
                                    "tenor": "str",
                                    "instrumentTag": "str"
                                },
                                "solving": {
                                    "method": {
                                        "lowerBound": 0.0,
                                        "name": "str",
                                        "upperBound": 0.0,
                                        "guess": 0.0
                                    },
                                    "result": 0.0
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "firstLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "secondLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "firstLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "secondLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "upfrontPayment": {
                                        "amount": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "payer": "str",
                                        "receiver": "str",
                                        "date": date
                                    }
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def solve(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrSwapInstrumentArraySolveResponse, _models.ServiceErrorResponse]:
        """Solve an IrSwap by requesting a custom definition.

        Calculate the price of a swap (e.g., fixed rate) provided in the request so that a chosen
        property (e.g., market value, duration) equals a target value.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapInstrumentArraySolveResponse or ServiceErrorResponse. The
         IrSwapInstrumentArraySolveResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentArraySolveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": "2020-02-20",
                                    "instrumentDescription": "str",
                                    "startDate": "2020-02-20",
                                    "tenor": "str",
                                    "instrumentTag": "str"
                                },
                                "solving": {
                                    "method": {
                                        "lowerBound": 0.0,
                                        "name": "str",
                                        "upperBound": 0.0,
                                        "guess": 0.0
                                    },
                                    "result": 0.0
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "firstLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "secondLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "firstLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "secondLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "upfrontPayment": {
                                        "amount": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "payer": "str",
                                        "receiver": "str",
                                        "date": date
                                    }
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def solve(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        definitions: List[_models.IrSwapDefinitionInstrument] = _Unset,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.IrPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentArraySolveResponse, _models.ServiceErrorResponse]:
        """Solve an IrSwap by requesting a custom definition.

        Calculate the price of a swap (e.g., fixed rate) provided in the request so that a chosen
        property (e.g., market value, duration) equals a target value.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.IrSwapDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.IrPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: IrSwapInstrumentArraySolveResponse or ServiceErrorResponse. The
         IrSwapInstrumentArraySolveResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentArraySolveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "indexConvexity": {
                            "integrationMethod": "str",
                            "method": "str",
                            "meanReversionPercent": 0.0,
                            "volatilityPercent": 0.0
                        },
                        "reportCurrency": "str",
                        "solvingParameters": {
                            "target": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "fixedRate": {
                                    "unit": "str",
                                    "value": 0.0
                                },
                                "leg": "str",
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "spread": {
                                    "unit": "str",
                                    "value": 0.0
                                }
                            },
                            "variable": {
                                "leg": "str",
                                "name": "str"
                            }
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": "2020-02-20",
                                    "instrumentDescription": "str",
                                    "startDate": "2020-02-20",
                                    "tenor": "str",
                                    "instrumentTag": "str"
                                },
                                "solving": {
                                    "method": {
                                        "lowerBound": 0.0,
                                        "name": "str",
                                        "upperBound": 0.0,
                                        "guess": 0.0
                                    },
                                    "result": 0.0
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "firstLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "secondLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "firstLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "secondLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "upfrontPayment": {
                                        "amount": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "payer": "str",
                                        "receiver": "str",
                                        "date": date
                                    }
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrSwapInstrumentArraySolveResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            if definitions is _Unset:
                raise TypeError("missing required argument: definitions")
            body = {
                "definitions": definitions,
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swaps_resource_solve_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrSwapInstrumentArraySolveResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def value(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrSwapInstrumentArrayValuationResponse, _models.ServiceErrorResponse]:
        """Calculate analytics for an IrSwap by requesting a custom definition.

        Calculate the market value of the swaps provided in the request.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapInstrumentArrayValuationResponse or ServiceErrorResponse. The
         IrSwapInstrumentArrayValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "indexConvexity": {
                            "integrationMethod": "str",
                            "method": "str",
                            "meanReversionPercent": 0.0,
                            "volatilityPercent": 0.0
                        },
                        "reportCurrency": "str",
                        "solvingParameters": {
                            "target": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "fixedRate": {
                                    "unit": "str",
                                    "value": 0.0
                                },
                                "leg": "str",
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "spread": {
                                    "unit": "str",
                                    "value": 0.0
                                }
                            },
                            "variable": {
                                "leg": "str",
                                "name": "str"
                            }
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": "2020-02-20",
                                    "instrumentDescription": "str",
                                    "startDate": "2020-02-20",
                                    "tenor": "str",
                                    "instrumentTag": "str"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "firstLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "secondLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "firstLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "secondLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "upfrontPayment": {
                                        "amount": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "payer": "str",
                                        "receiver": "str",
                                        "date": date
                                    }
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        *,
        definitions: List[_models.IrSwapDefinitionInstrument],
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.IrPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentArrayValuationResponse, _models.ServiceErrorResponse]:
        """Calculate analytics for an IrSwap by requesting a custom definition.

        Calculate the market value of the swaps provided in the request.

        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.IrSwapDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.IrPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: IrSwapInstrumentArrayValuationResponse or ServiceErrorResponse. The
         IrSwapInstrumentArrayValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": "2020-02-20",
                                    "instrumentDescription": "str",
                                    "startDate": "2020-02-20",
                                    "tenor": "str",
                                    "instrumentTag": "str"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "firstLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "secondLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "firstLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "secondLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "upfrontPayment": {
                                        "amount": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "payer": "str",
                                        "receiver": "str",
                                        "date": date
                                    }
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrSwapInstrumentArrayValuationResponse, _models.ServiceErrorResponse]:
        """Calculate analytics for an IrSwap by requesting a custom definition.

        Calculate the market value of the swaps provided in the request.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapInstrumentArrayValuationResponse or ServiceErrorResponse. The
         IrSwapInstrumentArrayValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": "2020-02-20",
                                    "instrumentDescription": "str",
                                    "startDate": "2020-02-20",
                                    "tenor": "str",
                                    "instrumentTag": "str"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "firstLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "secondLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "firstLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "secondLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "upfrontPayment": {
                                        "amount": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "payer": "str",
                                        "receiver": "str",
                                        "date": date
                                    }
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def value(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        definitions: List[_models.IrSwapDefinitionInstrument] = _Unset,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.IrPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentArrayValuationResponse, _models.ServiceErrorResponse]:
        """Calculate analytics for an IrSwap by requesting a custom definition.

        Calculate the market value of the swaps provided in the request.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword definitions: Required.
        :paramtype definitions: list[~analyticsapi.models.IrSwapDefinitionInstrument]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.IrPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: IrSwapInstrumentArrayValuationResponse or ServiceErrorResponse. The
         IrSwapInstrumentArrayValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentArrayValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definitions": [
                        {
                            "code": "str",
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "reference": "str"
                        }
                    ],
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "indexConvexity": {
                            "integrationMethod": "str",
                            "method": "str",
                            "meanReversionPercent": 0.0,
                            "volatilityPercent": 0.0
                        },
                        "reportCurrency": "str",
                        "solvingParameters": {
                            "target": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "fixedRate": {
                                    "unit": "str",
                                    "value": 0.0
                                },
                                "leg": "str",
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "spread": {
                                    "unit": "str",
                                    "value": 0.0
                                }
                            },
                            "variable": {
                                "leg": "str",
                                "name": "str"
                            }
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": [
                            {
                                "description": {
                                    "endDate": "2020-02-20",
                                    "instrumentDescription": "str",
                                    "startDate": "2020-02-20",
                                    "tenor": "str",
                                    "instrumentTag": "str"
                                },
                                "error": {
                                    "code": "str",
                                    "id": "str",
                                    "message": "str",
                                    "errors": [
                                        {
                                            "key": "str",
                                            "reason": "str",
                                            "invalidName": "str",
                                            "name": "str"
                                        }
                                    ],
                                    "status": "str"
                                },
                                "firstLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "secondLeg": {
                                    "description": {
                                        "currency": "str",
                                        "endDate": "2020-02-20",
                                        "interestType": "str",
                                        "legDescription": "str",
                                        "legTag": "str",
                                        "startDate": "2020-02-20",
                                        "index": "str"
                                    },
                                    "risk": {
                                        "annuity": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "benchmarkHedgeNotional": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "br01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "duration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "dv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "modifiedDuration": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "pv01": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    },
                                    "valuation": {
                                        "accrued": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "cleanMarketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        },
                                        "marketValue": {
                                            "value": 0.0,
                                            "bp": 0.0,
                                            "dealCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "domesticCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "foreignCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "legCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            },
                                            "percent": 0.0,
                                            "reportCurrency": {
                                                "currency": "str",
                                                "value": 0.0
                                            }
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            }
                        ],
                        "definitions": [
                            {
                                "code": "str",
                                "definition": {
                                    "firstLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "secondLeg": {
                                        "interestPeriods": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "payer": "str",
                                        "principal": {
                                            "currency": "str",
                                            "amortization": {
                                                "scheduleDefinition": {
                                                    "endDate": date,
                                                    "businessDayAdjustment": {
                                                        "calendars": [
                                                            "str"
                                                        ],
                                                        "convention": "str"
                                                    },
                                                    "firstRegularDate": date,
                                                    "frequency": "str",
                                                    "lastRegularDate": date,
                                                    "rollConvention": "str",
                                                    "startDate": date,
                                                    "stubRule": "str"
                                                },
                                                "type": "str",
                                                "referenceAmount": 0.0,
                                                "residualAmount": 0.0
                                            },
                                            "amount": 0.0,
                                            "finalPrincipalExchange": bool,
                                            "initialPrincipalExchange": bool,
                                            "interimPrincipalExchange": bool,
                                            "payments": [
                                                {
                                                    "date": "2020-02-20",
                                                    "value": 0.0
                                                }
                                            ],
                                            "repaymentCurrency": "str"
                                        },
                                        "rate": interest_rate_definition,
                                        "receiver": "str",
                                        "accrualDayCount": "str",
                                        "couponDayCount": "str",
                                        "paymentOffset": {
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "direction": "str",
                                            "referenceDate": "str",
                                            "tenor": "str"
                                        }
                                    },
                                    "upfrontPayment": {
                                        "amount": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "payer": "str",
                                        "receiver": "str",
                                        "date": date
                                    }
                                },
                                "reference": "str"
                            }
                        ],
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrSwapInstrumentArrayValuationResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            if definitions is _Unset:
                raise TypeError("missing required argument: definitions")
            body = {
                "definitions": definitions,
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swaps_resource_value_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrSwapInstrumentArrayValuationResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create_irs_from_leg_template(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from leg templates.

        Create an interest rate swap from two interest rate leg templates.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "firstLegReference": "str",
                    "secondLegReference": "str"
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_leg_template(
        self,
        *,
        first_leg_reference: str,
        second_leg_reference: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from leg templates.

        Create an interest rate swap from two interest rate leg templates.

        :keyword first_leg_reference: The identifier of the template for the instrument's first leg
         (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype first_leg_reference: str
        :keyword second_leg_reference: The identifier of the template for the instrument's second leg
         (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype second_leg_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_leg_template(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from leg templates.

        Create an interest rate swap from two interest rate leg templates.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create_irs_from_leg_template(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        first_leg_reference: str = _Unset,
        second_leg_reference: str = _Unset,
        fields: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from leg templates.

        Create an interest rate swap from two interest rate leg templates.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword first_leg_reference: The identifier of the template for the instrument's first leg
         (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype first_leg_reference: str
        :keyword second_leg_reference: The identifier of the template for the instrument's second leg
         (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype second_leg_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "firstLegReference": "str",
                    "secondLegReference": "str"
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if first_leg_reference is _Unset:
                raise TypeError("missing required argument: first_leg_reference")
            if second_leg_reference is _Unset:
                raise TypeError("missing required argument: second_leg_reference")
            body = {"firstLegReference": first_leg_reference, "secondLegReference": second_leg_reference}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swaps_resource_create_irs_from_leg_template_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrsInstrumentResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create_irs_from_vanilla_irs_template(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a vanilla IRS template.

        Create an interest rate swap from a vanilla irs template.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "templateReference": "str",
                    "overrides": {
                        "amount": 0.0,
                        "endDate": date,
                        "fixedRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "payerReceiver": "str",
                        "spread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_vanilla_irs_template(
        self,
        *,
        template_reference: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        overrides: Optional[_models.VanillaIrsOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a vanilla IRS template.

        Create an interest rate swap from a vanilla irs template.

        :keyword template_reference: "The identifier of the vanilla interest rate swap template (GUID
         or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype template_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword overrides: An object that contains interest rate swap properties that can be
         overridden. Default value is None.
        :paramtype overrides: ~analyticsapi.models.VanillaIrsOverride
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_vanilla_irs_template(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a vanilla IRS template.

        Create an interest rate swap from a vanilla irs template.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create_irs_from_vanilla_irs_template(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        template_reference: str = _Unset,
        fields: Optional[str] = None,
        overrides: Optional[_models.VanillaIrsOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a vanilla IRS template.

        Create an interest rate swap from a vanilla irs template.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword template_reference: "The identifier of the vanilla interest rate swap template (GUID
         or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype template_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword overrides: An object that contains interest rate swap properties that can be
         overridden. Default value is None.
        :paramtype overrides: ~analyticsapi.models.VanillaIrsOverride
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "templateReference": "str",
                    "overrides": {
                        "amount": 0.0,
                        "endDate": date,
                        "fixedRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "payerReceiver": "str",
                        "spread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if template_reference is _Unset:
                raise TypeError("missing required argument: template_reference")
            body = {"overrides": overrides, "templateReference": template_reference}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swaps_resource_create_irs_from_vanilla_irs_template_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrsInstrumentResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create_irs_from_tbs_template(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a TBS template.

        Create an interest rate swap from a tenor basis swap template.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "templateReference": "str",
                    "overrides": {
                        "amount": 0.0,
                        "endDate": date,
                        "firstSpread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "paidLeg": "str",
                        "secondSpread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_tbs_template(
        self,
        *,
        template_reference: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        overrides: Optional[_models.TenorBasisSwapOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a TBS template.

        Create an interest rate swap from a tenor basis swap template.

        :keyword template_reference: "The identifier of the tenor basis swap template (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype template_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword overrides: An object that contains the tenor basis swap properties that can be
         overridden. Default value is None.
        :paramtype overrides: ~analyticsapi.models.TenorBasisSwapOverride
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_tbs_template(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a TBS template.

        Create an interest rate swap from a tenor basis swap template.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create_irs_from_tbs_template(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        template_reference: str = _Unset,
        fields: Optional[str] = None,
        overrides: Optional[_models.TenorBasisSwapOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a TBS template.

        Create an interest rate swap from a tenor basis swap template.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword template_reference: "The identifier of the tenor basis swap template (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype template_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword overrides: An object that contains the tenor basis swap properties that can be
         overridden. Default value is None.
        :paramtype overrides: ~analyticsapi.models.TenorBasisSwapOverride
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "templateReference": "str",
                    "overrides": {
                        "amount": 0.0,
                        "endDate": date,
                        "firstSpread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "paidLeg": "str",
                        "secondSpread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if template_reference is _Unset:
                raise TypeError("missing required argument: template_reference")
            body = {"overrides": overrides, "templateReference": template_reference}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swaps_resource_create_irs_from_tbs_template_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrsInstrumentResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create_irs_from_ccs_template(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a CCS template.

        Create an interest rate swap from a cross currency swap template.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "templateReference": "str",
                    "overrides": {
                        "amount": 0.0,
                        "contraAmount": 0.0,
                        "endDate": date,
                        "fixedRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "paidLeg": "str",
                        "spread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_ccs_template(
        self,
        *,
        template_reference: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        overrides: Optional[_models.CrossCurencySwapOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a CCS template.

        Create an interest rate swap from a cross currency swap template.

        :keyword template_reference: "The identifier of the cross currency swap template (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype template_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword overrides: An object that contains the cross currency swap properties that can be
         overridden. Default value is None.
        :paramtype overrides: ~analyticsapi.models.CrossCurencySwapOverride
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_ccs_template(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a CCS template.

        Create an interest rate swap from a cross currency swap template.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create_irs_from_ccs_template(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        template_reference: str = _Unset,
        fields: Optional[str] = None,
        overrides: Optional[_models.CrossCurencySwapOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a CCS template.

        Create an interest rate swap from a cross currency swap template.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword template_reference: "The identifier of the cross currency swap template (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype template_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword overrides: An object that contains the cross currency swap properties that can be
         overridden. Default value is None.
        :paramtype overrides: ~analyticsapi.models.CrossCurencySwapOverride
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "templateReference": "str",
                    "overrides": {
                        "amount": 0.0,
                        "contraAmount": 0.0,
                        "endDate": date,
                        "fixedRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "paidLeg": "str",
                        "spread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if template_reference is _Unset:
                raise TypeError("missing required argument: template_reference")
            body = {"overrides": overrides, "templateReference": template_reference}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swaps_resource_create_irs_from_ccs_template_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrsInstrumentResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create_irs_from_cbs_template(
        self, body: JSON, *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a CBS template.

        Create an interest rate swap from a currency basis swap template.

        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "templateReference": "str",
                    "overrides": {
                        "amount": 0.0,
                        "contraAmount": 0.0,
                        "endDate": date,
                        "firstSpread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "paidLeg": "str",
                        "secondSpread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_cbs_template(
        self,
        *,
        template_reference: str,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        overrides: Optional[_models.CurencyBasisSwapOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a CBS template.

        Create an interest rate swap from a currency basis swap template.

        :keyword template_reference: "The identifier of the currency basis swap template (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype template_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword overrides: An object that contains the currency basis swap properties that can be
         overridden. Default value is None.
        :paramtype overrides: ~analyticsapi.models.CurencyBasisSwapOverride
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create_irs_from_cbs_template(
        self, body: IO[bytes], *, fields: Optional[str] = None, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a CBS template.

        Create an interest rate swap from a currency basis swap template.

        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create_irs_from_cbs_template(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        template_reference: str = _Unset,
        fields: Optional[str] = None,
        overrides: Optional[_models.CurencyBasisSwapOverride] = None,
        **kwargs: Any,
    ) -> Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Create an IrSwap from a CBS template.

        Create an interest rate swap from a currency basis swap template.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword template_reference: "The identifier of the currency basis swap template (GUID or URI).
         Note that a URI must be at least 2 and at most 102 characters long, start with an alphanumeric
         character, and contain only alphanumeric characters, slashes and underscores. Required.
        :paramtype template_reference: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword overrides: An object that contains the currency basis swap properties that can be
         overridden. Default value is None.
        :paramtype overrides: ~analyticsapi.models.CurencyBasisSwapOverride
        :return: IrsInstrumentResponse or ServiceErrorResponse. The IrsInstrumentResponse is compatible
         with MutableMapping
        :rtype: ~analyticsapi.models.IrsInstrumentResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator "dateType":

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "templateReference": "str",
                    "overrides": {
                        "amount": 0.0,
                        "contraAmount": 0.0,
                        "endDate": date,
                        "firstSpread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "paidLeg": "str",
                        "secondSpread": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "startDate": date
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrsInstrumentResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if template_reference is _Unset:
                raise TypeError("missing required argument: template_reference")
            body = {"overrides": overrides, "templateReference": template_reference}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swaps_resource_create_irs_from_cbs_template_request(
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrsInstrumentResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class irSwapResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`ir_swap_resource` attribute.
    """

    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")

    async def read(
        self, instrument_id: str, *, fields: Optional[str] = None, **kwargs: Any
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Access a IrSwap existing in the platform (read).

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.IrSwapResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_ir_swap_resource_read_request(
            instrument_id=instrument_id,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrSwapResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def delete(self, instrument_id: str, **kwargs: Any) -> Optional[_models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Delete a IrSwap that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :return: ServiceErrorResponse or None. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.ServiceErrorResponse or None
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_ir_swap_resource_delete_request(
            instrument_id=instrument_id,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            204,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        deserialized = None
        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def overwrite(
        self, instrument_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a IrSwap that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self,
        instrument_id: str,
        *,
        location: _models.Location,
        definition: _models.IrSwapDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a IrSwap that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword location: Object defining the location of the IrSwap in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the IrSwap. Required.
        :paramtype definition: ~analyticsapi.models.IrSwapDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the IrSwap. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self, instrument_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a IrSwap that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def overwrite(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.IrSwapDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a IrSwap that exists in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the IrSwap in the platform. Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the IrSwap. Required.
        :paramtype definition: ~analyticsapi.models.IrSwapDefinition
        :keyword description: Object defining metadata for the IrSwap. Default value is None.
        :paramtype description: ~analyticsapi.models.Description
        :return: IrSwapResponse or ServiceErrorResponse. The IrSwapResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.IrSwapResponse or ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The input is polymorphic. The following are possible polymorphic inputs based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "firstLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "secondLeg": {
                            "interestPeriods": {
                                "endDate": date,
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "firstRegularDate": date,
                                "frequency": "str",
                                "lastRegularDate": date,
                                "rollConvention": "str",
                                "startDate": date,
                                "stubRule": "str"
                            },
                            "payer": "str",
                            "principal": {
                                "currency": "str",
                                "amortization": {
                                    "scheduleDefinition": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "type": "str",
                                    "referenceAmount": 0.0,
                                    "residualAmount": 0.0
                                },
                                "amount": 0.0,
                                "finalPrincipalExchange": bool,
                                "initialPrincipalExchange": bool,
                                "interimPrincipalExchange": bool,
                                "payments": [
                                    {
                                        "date": "2020-02-20",
                                        "value": 0.0
                                    }
                                ],
                                "repaymentCurrency": "str"
                            },
                            "rate": interest_rate_definition,
                            "receiver": "str",
                            "accrualDayCount": "str",
                            "couponDayCount": "str",
                            "paymentOffset": {
                                "businessDayAdjustment": {
                                    "calendars": [
                                        "str"
                                    ],
                                    "convention": "str"
                                },
                                "direction": "str",
                                "referenceDate": "str",
                                "tenor": "str"
                            }
                        },
                        "upfrontPayment": {
                            "amount": {
                                "currency": "str",
                                "value": 0.0
                            },
                            "payer": "str",
                            "receiver": "str",
                            "date": date
                        }
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "firstLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "secondLeg": {
                                "interestPeriods": {
                                    "endDate": date,
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "firstRegularDate": date,
                                    "frequency": "str",
                                    "lastRegularDate": date,
                                    "rollConvention": "str",
                                    "startDate": date,
                                    "stubRule": "str"
                                },
                                "payer": "str",
                                "principal": {
                                    "currency": "str",
                                    "amortization": {
                                        "scheduleDefinition": {
                                            "endDate": date,
                                            "businessDayAdjustment": {
                                                "calendars": [
                                                    "str"
                                                ],
                                                "convention": "str"
                                            },
                                            "firstRegularDate": date,
                                            "frequency": "str",
                                            "lastRegularDate": date,
                                            "rollConvention": "str",
                                            "startDate": date,
                                            "stubRule": "str"
                                        },
                                        "type": "str",
                                        "referenceAmount": 0.0,
                                        "residualAmount": 0.0
                                    },
                                    "amount": 0.0,
                                    "finalPrincipalExchange": bool,
                                    "initialPrincipalExchange": bool,
                                    "interimPrincipalExchange": bool,
                                    "payments": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "repaymentCurrency": "str"
                                },
                                "rate": interest_rate_definition,
                                "receiver": "str",
                                "accrualDayCount": "str",
                                "couponDayCount": "str",
                                "paymentOffset": {
                                    "businessDayAdjustment": {
                                        "calendars": [
                                            "str"
                                        ],
                                        "convention": "str"
                                    },
                                    "direction": "str",
                                    "referenceDate": "str",
                                    "tenor": "str"
                                }
                            },
                            "upfrontPayment": {
                                "amount": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "payer": "str",
                                "receiver": "str",
                                "date": date
                            }
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrSwapResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swap_resource_overwrite_request(
            instrument_id=instrument_id,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrSwapResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def solve(
        self,
        instrument_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentSolveResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Solve an IrSwap that exists in the platform.

        Calculate the price of a swap (e.g., fixed rate) stored in the platform so that a chosen
        property (e.g., market value, duration) equals a target value.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapInstrumentSolveResponse or ServiceErrorResponse. The
         IrSwapInstrumentSolveResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentSolveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "indexConvexity": {
                            "integrationMethod": "str",
                            "method": "str",
                            "meanReversionPercent": 0.0,
                            "volatilityPercent": 0.0
                        },
                        "reportCurrency": "str",
                        "solvingParameters": {
                            "target": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "fixedRate": {
                                    "unit": "str",
                                    "value": 0.0
                                },
                                "leg": "str",
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "spread": {
                                    "unit": "str",
                                    "value": 0.0
                                }
                            },
                            "variable": {
                                "leg": "str",
                                "name": "str"
                            }
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": "2020-02-20",
                                "instrumentDescription": "str",
                                "startDate": "2020-02-20",
                                "tenor": "str",
                                "instrumentTag": "str"
                            },
                            "solving": {
                                "method": {
                                    "lowerBound": 0.0,
                                    "name": "str",
                                    "upperBound": 0.0,
                                    "guess": 0.0
                                },
                                "result": 0.0
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "firstLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "risk": {
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "benchmarkHedgeNotional": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            },
                            "secondLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "valuation": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def solve(
        self,
        instrument_id: str,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.IrPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentSolveResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Solve an IrSwap that exists in the platform.

        Calculate the price of a swap (e.g., fixed rate) stored in the platform so that a chosen
        property (e.g., market value, duration) equals a target value.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.IrPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: IrSwapInstrumentSolveResponse or ServiceErrorResponse. The
         IrSwapInstrumentSolveResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentSolveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": "2020-02-20",
                                "instrumentDescription": "str",
                                "startDate": "2020-02-20",
                                "tenor": "str",
                                "instrumentTag": "str"
                            },
                            "solving": {
                                "method": {
                                    "lowerBound": 0.0,
                                    "name": "str",
                                    "upperBound": 0.0,
                                    "guess": 0.0
                                },
                                "result": 0.0
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "firstLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "risk": {
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "benchmarkHedgeNotional": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            },
                            "secondLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "valuation": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def solve(
        self,
        instrument_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentSolveResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Solve an IrSwap that exists in the platform.

        Calculate the price of a swap (e.g., fixed rate) stored in the platform so that a chosen
        property (e.g., market value, duration) equals a target value.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapInstrumentSolveResponse or ServiceErrorResponse. The
         IrSwapInstrumentSolveResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentSolveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": "2020-02-20",
                                "instrumentDescription": "str",
                                "startDate": "2020-02-20",
                                "tenor": "str",
                                "instrumentTag": "str"
                            },
                            "solving": {
                                "method": {
                                    "lowerBound": 0.0,
                                    "name": "str",
                                    "upperBound": 0.0,
                                    "guess": 0.0
                                },
                                "result": 0.0
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "firstLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "risk": {
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "benchmarkHedgeNotional": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            },
                            "secondLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "valuation": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def solve(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.IrPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentSolveResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Solve an IrSwap that exists in the platform.

        Calculate the price of a swap (e.g., fixed rate) stored in the platform so that a chosen
        property (e.g., market value, duration) equals a target value.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.IrPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: IrSwapInstrumentSolveResponse or ServiceErrorResponse. The
         IrSwapInstrumentSolveResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentSolveResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "indexConvexity": {
                            "integrationMethod": "str",
                            "method": "str",
                            "meanReversionPercent": 0.0,
                            "volatilityPercent": 0.0
                        },
                        "reportCurrency": "str",
                        "solvingParameters": {
                            "target": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "fixedRate": {
                                    "unit": "str",
                                    "value": 0.0
                                },
                                "leg": "str",
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "spread": {
                                    "unit": "str",
                                    "value": 0.0
                                }
                            },
                            "variable": {
                                "leg": "str",
                                "name": "str"
                            }
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": "2020-02-20",
                                "instrumentDescription": "str",
                                "startDate": "2020-02-20",
                                "tenor": "str",
                                "instrumentTag": "str"
                            },
                            "solving": {
                                "method": {
                                    "lowerBound": 0.0,
                                    "name": "str",
                                    "upperBound": 0.0,
                                    "guess": 0.0
                                },
                                "result": 0.0
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "firstLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "risk": {
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "benchmarkHedgeNotional": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            },
                            "secondLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "valuation": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrSwapInstrumentSolveResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            body = {
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swap_resource_solve_request(
            instrument_id=instrument_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrSwapInstrumentSolveResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def value(
        self,
        instrument_id: str,
        body: JSON,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentValuationResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Calculate analytics for an IrSwap that exists in the platform.

        Calculate the market value of a swap stored in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: JSON
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapInstrumentValuationResponse or ServiceErrorResponse. The
         IrSwapInstrumentValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "indexConvexity": {
                            "integrationMethod": "str",
                            "method": "str",
                            "meanReversionPercent": 0.0,
                            "volatilityPercent": 0.0
                        },
                        "reportCurrency": "str",
                        "solvingParameters": {
                            "target": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "fixedRate": {
                                    "unit": "str",
                                    "value": 0.0
                                },
                                "leg": "str",
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "spread": {
                                    "unit": "str",
                                    "value": 0.0
                                }
                            },
                            "variable": {
                                "leg": "str",
                                "name": "str"
                            }
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": "2020-02-20",
                                "instrumentDescription": "str",
                                "startDate": "2020-02-20",
                                "tenor": "str",
                                "instrumentTag": "str"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "firstLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "risk": {
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "benchmarkHedgeNotional": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            },
                            "secondLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "valuation": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        instrument_id: str,
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        pricing_preferences: Optional[_models.IrPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentValuationResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Calculate analytics for an IrSwap that exists in the platform.

        Calculate the market value of a swap stored in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.IrPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: IrSwapInstrumentValuationResponse or ServiceErrorResponse. The
         IrSwapInstrumentValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": "2020-02-20",
                                "instrumentDescription": "str",
                                "startDate": "2020-02-20",
                                "tenor": "str",
                                "instrumentTag": "str"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "firstLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "risk": {
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "benchmarkHedgeNotional": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            },
                            "secondLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "valuation": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def value(
        self,
        instrument_id: str,
        body: IO[bytes],
        *,
        fields: Optional[str] = None,
        content_type: str = "application/json",
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentValuationResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Calculate analytics for an IrSwap that exists in the platform.

        Calculate the market value of a swap stored in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: IrSwapInstrumentValuationResponse or ServiceErrorResponse. The
         IrSwapInstrumentValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": "2020-02-20",
                                "instrumentDescription": "str",
                                "startDate": "2020-02-20",
                                "tenor": "str",
                                "instrumentTag": "str"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "firstLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "risk": {
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "benchmarkHedgeNotional": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            },
                            "secondLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "valuation": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def value(
        self,
        instrument_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        fields: Optional[str] = None,
        pricing_preferences: Optional[_models.IrPricingParameters] = None,
        market_data: Optional[_models.MarketData] = None,
        return_market_data: Optional[bool] = None,
        **kwargs: Any,
    ) -> Union[_models.IrSwapInstrumentValuationResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Calculate analytics for an IrSwap that exists in the platform.

        Calculate the market value of a swap stored in the platform.

        :param instrument_id: The instrument identifier. Required.
        :type instrument_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :keyword pricing_preferences: The parameters that control the computation of the analytics.
         Default value is None.
        :paramtype pricing_preferences: ~analyticsapi.models.IrPricingParameters
        :keyword market_data: The market data used to compute the analytics. Default value is None.
        :paramtype market_data: ~analyticsapi.models.MarketData
        :keyword return_market_data: Boolean property to determine if undelying market data used for
         calculation should be returned in the response. Default value is None.
        :paramtype return_market_data: bool
        :return: IrSwapInstrumentValuationResponse or ServiceErrorResponse. The
         IrSwapInstrumentValuationResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.IrSwapInstrumentValuationResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "marketData": {
                        "cmdtyOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "contractCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "creditCurves": [
                            {
                                "curve": {
                                    "entityCode": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "discountCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "eqOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "entityCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "fxForwardCurves": [
                            {
                                "curve": {
                                    "fxCrossCode": "str",
                                    "fxType": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ]
                                },
                                "reference": "str"
                            }
                        ],
                        "fxOptionVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "fxCrossCode": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCapVolSurface": [
                            {
                                "reference": "str",
                                "surface": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryDate": "2020-02-20",
                                            "strike": 0.0,
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                }
                            }
                        ],
                        "irCurves": [
                            {
                                "curve": {
                                    "indexReference": "str",
                                    "points": [
                                        {
                                            "date": "2020-02-20",
                                            "value": 0.0
                                        }
                                    ],
                                    "zcType": "str",
                                    "zcUnit": "str"
                                },
                                "reference": "str"
                            }
                        ],
                        "irSwaptionVolCube": [
                            {
                                "cube": {
                                    "indexReference": "str",
                                    "modelType": "str",
                                    "points": [
                                        {
                                            "expiryTenor": "str",
                                            "strike": 0.0,
                                            "underlyingExpiryTenor": "str",
                                            "volatility": 0.0
                                        }
                                    ],
                                    "strikeType": "str"
                                },
                                "reference": "str"
                            }
                        ]
                    },
                    "pricingPreferences": {
                        "indexConvexity": {
                            "integrationMethod": "str",
                            "method": "str",
                            "meanReversionPercent": 0.0,
                            "volatilityPercent": 0.0
                        },
                        "reportCurrency": "str",
                        "solvingParameters": {
                            "target": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "fixedRate": {
                                    "unit": "str",
                                    "value": 0.0
                                },
                                "leg": "str",
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "spread": {
                                    "unit": "str",
                                    "value": 0.0
                                }
                            },
                            "variable": {
                                "leg": "str",
                                "name": "str"
                            }
                        },
                        "valuationDate": "2020-02-20"
                    },
                    "returnMarketData": bool
                }

                # The response is polymorphic. The following are possible polymorphic responses based off discriminator
                  "interestRateType":

                # JSON input template for discriminator value "FixedRate":
                interest_rate_definition = {
                    "interestRateType": "FixedRate",
                    "rate": {
                        "unit": "str",
                        "value": 0.0
                    },
                    "firstAccrualDate": "2020-02-20"
                }

                # JSON input template for discriminator value "FloatingRate":
                interest_rate_definition = {
                    "index": "str",
                    "interestRateType": "FloatingRate",
                    "backStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "cap": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "compounding": {
                        "compoundingMode": "str",
                        "lockoutPeriod": 0,
                        "observationMethod": "str",
                        "spreadCompoundingMode": "str"
                    },
                    "floor": {
                        "effectiveDate": "2020-02-20",
                        "rate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "type": "str"
                    },
                    "frontStubIndex": {
                        "first": "str",
                        "referenceRate": {
                            "unit": "str",
                            "value": 0.0
                        },
                        "second": "str"
                    },
                    "leverage": 0.0,
                    "resetDates": {
                        "offset": {
                            "businessDayAdjustment": {
                                "calendars": [
                                    "str"
                                ],
                                "convention": "str"
                            },
                            "direction": "str",
                            "referenceDate": "str",
                            "tenor": "str"
                        },
                        "frequency": "str"
                    },
                    "spreadSchedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "StepRate":
                interest_rate_definition = {
                    "interestRateType": "StepRate",
                    "schedule": [
                        {
                            "rate": {
                                "unit": "str",
                                "value": 0.0
                            },
                            "date": "2020-02-20"
                        }
                    ]
                }

                # JSON input template for discriminator value "AdjustableDate":
                date = {
                    "date": "2020-02-20",
                    "dateType": "AdjustableDate",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str"
                }

                # JSON input template for discriminator value "RelativeAdjustableDate":
                date = {
                    "dateType": "RelativeAdjustableDate",
                    "tenor": "str",
                    "calendars": [
                        "str"
                    ],
                    "dateMovingConvention": "str",
                    "referenceDate": "str"
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "analytics": {
                            "description": {
                                "endDate": "2020-02-20",
                                "instrumentDescription": "str",
                                "startDate": "2020-02-20",
                                "tenor": "str",
                                "instrumentTag": "str"
                            },
                            "error": {
                                "code": "str",
                                "id": "str",
                                "message": "str",
                                "errors": [
                                    {
                                        "key": "str",
                                        "reason": "str",
                                        "invalidName": "str",
                                        "name": "str"
                                    }
                                ],
                                "status": "str"
                            },
                            "firstLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "risk": {
                                "annuity": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "benchmarkHedgeNotional": {
                                    "currency": "str",
                                    "value": 0.0
                                },
                                "br01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "duration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "dv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "modifiedDuration": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "pv01": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            },
                            "secondLeg": {
                                "description": {
                                    "currency": "str",
                                    "endDate": "2020-02-20",
                                    "interestType": "str",
                                    "legDescription": "str",
                                    "legTag": "str",
                                    "startDate": "2020-02-20",
                                    "index": "str"
                                },
                                "risk": {
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "benchmarkHedgeNotional": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                },
                                "valuation": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    }
                                }
                            },
                            "valuation": {
                                "accrued": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "cleanMarketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                },
                                "marketValue": {
                                    "value": 0.0,
                                    "bp": 0.0,
                                    "dealCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "domesticCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "foreignCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "legCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "percent": 0.0,
                                    "reportCurrency": {
                                        "currency": "str",
                                        "value": 0.0
                                    }
                                }
                            }
                        },
                        "marketData": {
                            "cmdtyOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "contractCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "creditCurves": [
                                {
                                    "curve": {
                                        "entityCode": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "discountCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "eqOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "entityCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "fxForwardCurves": [
                                {
                                    "curve": {
                                        "fxCrossCode": "str",
                                        "fxType": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ]
                                    },
                                    "reference": "str"
                                }
                            ],
                            "fxOptionVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "fxCrossCode": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCapVolSurface": [
                                {
                                    "reference": "str",
                                    "surface": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryDate": "2020-02-20",
                                                "strike": 0.0,
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    }
                                }
                            ],
                            "irCurves": [
                                {
                                    "curve": {
                                        "indexReference": "str",
                                        "points": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "zcType": "str",
                                        "zcUnit": "str"
                                    },
                                    "reference": "str"
                                }
                            ],
                            "irSwaptionVolCube": [
                                {
                                    "cube": {
                                        "indexReference": "str",
                                        "modelType": "str",
                                        "points": [
                                            {
                                                "expiryTenor": "str",
                                                "strike": 0.0,
                                                "underlyingExpiryTenor": "str",
                                                "volatility": 0.0
                                            }
                                        ],
                                        "strikeType": "str"
                                    },
                                    "reference": "str"
                                }
                            ]
                        },
                        "pricingPreferences": {
                            "indexConvexity": {
                                "integrationMethod": "str",
                                "method": "str",
                                "meanReversionPercent": 0.0,
                                "volatilityPercent": 0.0
                            },
                            "reportCurrency": "str",
                            "solvingParameters": {
                                "target": {
                                    "accrued": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "annuity": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "br01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "cleanMarketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "duration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "dv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "fixedRate": {
                                        "unit": "str",
                                        "value": 0.0
                                    },
                                    "leg": "str",
                                    "marketValue": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "modifiedDuration": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "pv01": {
                                        "value": 0.0,
                                        "bp": 0.0,
                                        "dealCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "domesticCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "foreignCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "legCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        },
                                        "percent": 0.0,
                                        "reportCurrency": {
                                            "currency": "str",
                                            "value": 0.0
                                        }
                                    },
                                    "spread": {
                                        "unit": "str",
                                        "value": 0.0
                                    }
                                },
                                "variable": {
                                    "leg": "str",
                                    "name": "str"
                                }
                            },
                            "valuationDate": "2020-02-20"
                        },
                        "resource": {
                            "definition": {
                                "firstLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "secondLeg": {
                                    "interestPeriods": {
                                        "endDate": date,
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "firstRegularDate": date,
                                        "frequency": "str",
                                        "lastRegularDate": date,
                                        "rollConvention": "str",
                                        "startDate": date,
                                        "stubRule": "str"
                                    },
                                    "payer": "str",
                                    "principal": {
                                        "currency": "str",
                                        "amortization": {
                                            "scheduleDefinition": {
                                                "endDate": date,
                                                "businessDayAdjustment": {
                                                    "calendars": [
                                                        "str"
                                                    ],
                                                    "convention": "str"
                                                },
                                                "firstRegularDate": date,
                                                "frequency": "str",
                                                "lastRegularDate": date,
                                                "rollConvention": "str",
                                                "startDate": date,
                                                "stubRule": "str"
                                            },
                                            "type": "str",
                                            "referenceAmount": 0.0,
                                            "residualAmount": 0.0
                                        },
                                        "amount": 0.0,
                                        "finalPrincipalExchange": bool,
                                        "initialPrincipalExchange": bool,
                                        "interimPrincipalExchange": bool,
                                        "payments": [
                                            {
                                                "date": "2020-02-20",
                                                "value": 0.0
                                            }
                                        ],
                                        "repaymentCurrency": "str"
                                    },
                                    "rate": interest_rate_definition,
                                    "receiver": "str",
                                    "accrualDayCount": "str",
                                    "couponDayCount": "str",
                                    "paymentOffset": {
                                        "businessDayAdjustment": {
                                            "calendars": [
                                                "str"
                                            ],
                                            "convention": "str"
                                        },
                                        "direction": "str",
                                        "referenceDate": "str",
                                        "tenor": "str"
                                    }
                                },
                                "upfrontPayment": {
                                    "amount": {
                                        "currency": "str",
                                        "value": 0.0
                                    },
                                    "payer": "str",
                                    "receiver": "str",
                                    "date": date
                                }
                            },
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.IrSwapInstrumentValuationResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        if body is _Unset:
            body = {
                "marketData": market_data,
                "pricingPreferences": pricing_preferences,
                "returnMarketData": return_market_data,
            }
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_ir_swap_resource_value_request(
            instrument_id=instrument_id,
            fields=fields,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.IrSwapInstrumentValuationResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class floatingRateIndicesResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`floating_rate_indices_resource` attribute.
    """

    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")

    async def list(
        self,
        *,
        item_per_page: Optional[int] = None,
        page: Optional[int] = None,
        spaces: Optional[List[str]] = None,
        names: Optional[List[str]] = None,
        space_name_sort_order: Optional[Union[str, _models.SortingOrderEnum]] = None,
        tags: Optional[List[str]] = None,
        fields: Optional[str] = None,
        **kwargs: Any,
    ) -> Union[_models.FloatingRateIndexCollectionResponse, _models.ServiceErrorResponse]:
        """List the FloatingRateIndexs existing in the platform (depending on permissions).

        :keyword item_per_page: A parameter used to select the number of items allowed per page. The
         valid range is 1-500. If not provided, 50 will be used. Default value is None.
        :paramtype item_per_page: int
        :keyword page: A parameter used to define the page number to display. Default value is None.
        :paramtype page: int
        :keyword spaces: A parameter used to search for platform resources stored in a given space.
         Space is like a namespace where resources are stored. By default there are two spaces:
         LSEG is reserved for LSEG maintained resources, HOME is reserved for user's default space.
         If space is not specified, it will search within all spaces. Default value is None.
        :paramtype spaces: list[str]
        :keyword names: A parameter used to search for platform resources with given names. Default
         value is None.
        :paramtype names: list[str]
        :keyword space_name_sort_order: A parameter used to sort platform resources by name based on a
         defined order. Known values are: "Asc" and "Desc". Default value is None.
        :paramtype space_name_sort_order: str or ~analyticsapi.models.SortingOrderEnum
        :keyword tags: A parameter used to search for platform resources with given tags. Default value
         is None.
        :paramtype tags: list[str]
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: FloatingRateIndexCollectionResponse or ServiceErrorResponse. The
         FloatingRateIndexCollectionResponse is compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexCollectionResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": [
                        {
                            "location": {
                                "name": "str",
                                "space": "str"
                            },
                            "description": {
                                "summary": "str",
                                "tags": [
                                    "str"
                                ]
                            },
                            "id": "str",
                            "type": "str"
                        }
                    ],
                    "itemPerPage": 0,
                    "page": 0,
                    "totalItems": 0,
                    "totalPages": 0,
                    "links": {
                        "self": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "first": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "last": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "next": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        },
                        "prev": {
                            "href": "str",
                            "hrefSchema": "str",
                            "httpMethod": "str"
                        }
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.FloatingRateIndexCollectionResponse, _models.ServiceErrorResponse]] = kwargs.pop(
            "cls", None
        )

        _request = build_floating_rate_indices_resource_list_request(
            item_per_page=item_per_page,
            page=page,
            spaces=spaces,
            names=names,
            space_name_sort_order=space_name_sort_order,
            tags=tags,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FloatingRateIndexCollectionResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def create(
        self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        """Save a new FloatingRateIndex in the platform.

        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "currency": "str",
                        "name": "str",
                        "quoteDefinition": {
                            "instrumentCode": "str",
                            "ask": {
                                "historicalFidPriority": [
                                    "str"
                                ],
                                "realTimeFidPriority": [
                                    "str"
                                ]
                            },
                            "bid": {
                                "historicalFidPriority": [
                                    "str"
                                ],
                                "realTimeFidPriority": [
                                    "str"
                                ]
                            },
                            "source": "str"
                        },
                        "rounding": {
                            "decimalPlaces": 0,
                            "direction": "str",
                            "scale": 0
                        },
                        "tenor": "str",
                        "yearBasis": "str"
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self,
        *,
        location: _models.Location,
        definition: _models.FloatingRateIndexDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        """Save a new FloatingRateIndex in the platform.

        :keyword location: Object defining the location of the FloatingRateIndex in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FloatingRateIndex. Required.
        :paramtype definition: ~analyticsapi.models.FloatingRateIndexDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the FloatingRateIndex. Default value is
         None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def create(
        self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        """Save a new FloatingRateIndex in the platform.

        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def create(
        self,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.FloatingRateIndexDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        """Save a new FloatingRateIndex in the platform.

        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the FloatingRateIndex in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FloatingRateIndex. Required.
        :paramtype definition: ~analyticsapi.models.FloatingRateIndexDefinition
        :keyword description: Object defining metadata for the FloatingRateIndex. Default value is
         None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "currency": "str",
                        "name": "str",
                        "quoteDefinition": {
                            "instrumentCode": "str",
                            "ask": {
                                "historicalFidPriority": [
                                    "str"
                                ],
                                "realTimeFidPriority": [
                                    "str"
                                ]
                            },
                            "bid": {
                                "historicalFidPriority": [
                                    "str"
                                ],
                                "realTimeFidPriority": [
                                    "str"
                                ]
                            },
                            "source": "str"
                        },
                        "rounding": {
                            "decimalPlaces": 0,
                            "direction": "str",
                            "scale": 0
                        },
                        "tenor": "str",
                        "yearBasis": "str"
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 201
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 415, 428, 429, 500, 501, 502,
                  503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_floating_rate_indices_resource_create_request(
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            201,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            415,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 201:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FloatingRateIndexResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore


class floatingRateIndexResourceOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~analyticsapi.aio.AnalyticsAPIClient`'s
        :attr:`floating_rate_index_resource` attribute.
    """

    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")

    async def read(
        self, floating_rate_index_id: str, *, fields: Optional[str] = None, **kwargs: Any
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        """Access a FloatingRateIndex existing in the platform (read).

        :param floating_rate_index_id: Required.
        :type floating_rate_index_id: str
        :keyword fields: A parameter used to select the fields to return in response. If not provided,
         all fields will be returned.
         Some usage examples:


         #. Simply enumerating the fields, separating them by ',', e.g. 'fields=//please insert the
         selected fields here, e.g., field1, field2 //'
         #. Using parentheses to indicate nesting, e.g. 'fields= //please insert the selected field and
         subfields here, e.g., field1(subfield1, subfield2), field2(subfield3)//’
         #. Using forward slash '/' to indicate nesting, e.g. 'fields=//please insert the selected
         field and subfields here, e.g.,  field1/subfield1, field1/subfield2, field2/subfield3//’ (same
         result as example above)
         #. Operators can even be combined (forward slashes in brackets, not the way around), e.g.
         'fields=//please insert the selected field and subfields here, e.g.,
         field1(subfield1/subsubfield1), field2/subfield2//'. Default value is None.
        :paramtype fields: str
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.FloatingRateIndexResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_floating_rate_index_resource_read_request(
            floating_rate_index_id=floating_rate_index_id,
            fields=fields,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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, 400, 401, 403, 404, 405, 406, 408, 410, 428, 429, 500, 501, 502, 503, 504]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        if response.status_code == 200:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FloatingRateIndexResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    async def delete(self, floating_rate_index_id: str, **kwargs: Any) -> Optional[_models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Delete a FloatingRateIndex that exists in the platform.

        :param floating_rate_index_id: Required.
        :type floating_rate_index_id: str
        :return: ServiceErrorResponse or None. The ServiceErrorResponse is compatible with
         MutableMapping
        :rtype: ~analyticsapi.models.ServiceErrorResponse or None
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            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.ServiceErrorResponse]] = kwargs.pop("cls", None)

        _request = build_floating_rate_index_resource_delete_request(
            floating_rate_index_id=floating_rate_index_id,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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 [
            204,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        deserialized = None
        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore

    @overload
    async def overwrite(
        self, floating_rate_index_id: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FloatingRateIndex that exists in the platform.

        :param floating_rate_index_id: Required.
        :type floating_rate_index_id: str
        :param body: Required.
        :type body: JSON
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "currency": "str",
                        "name": "str",
                        "quoteDefinition": {
                            "instrumentCode": "str",
                            "ask": {
                                "historicalFidPriority": [
                                    "str"
                                ],
                                "realTimeFidPriority": [
                                    "str"
                                ]
                            },
                            "bid": {
                                "historicalFidPriority": [
                                    "str"
                                ],
                                "realTimeFidPriority": [
                                    "str"
                                ]
                            },
                            "source": "str"
                        },
                        "rounding": {
                            "decimalPlaces": 0,
                            "direction": "str",
                            "scale": 0
                        },
                        "tenor": "str",
                        "yearBasis": "str"
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self,
        floating_rate_index_id: str,
        *,
        location: _models.Location,
        definition: _models.FloatingRateIndexDefinition,
        content_type: str = "application/json",
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FloatingRateIndex that exists in the platform.

        :param floating_rate_index_id: Required.
        :type floating_rate_index_id: str
        :keyword location: Object defining the location of the FloatingRateIndex in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FloatingRateIndex. Required.
        :paramtype definition: ~analyticsapi.models.FloatingRateIndexDefinition
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword description: Object defining metadata for the FloatingRateIndex. Default value is
         None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    @overload
    async def overwrite(
        self, floating_rate_index_id: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FloatingRateIndex that exists in the platform.

        :param floating_rate_index_id: Required.
        :type floating_rate_index_id: str
        :param body: Required.
        :type body: IO[bytes]
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """

    async def overwrite(
        self,
        floating_rate_index_id: str,
        body: Union[JSON, IO[bytes]] = _Unset,
        *,
        location: _models.Location = _Unset,
        definition: _models.FloatingRateIndexDefinition = _Unset,
        description: Optional[_models.Description] = None,
        **kwargs: Any,
    ) -> Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]:
        # pylint: disable=line-too-long
        """Overwrite a FloatingRateIndex that exists in the platform.

        :param floating_rate_index_id: Required.
        :type floating_rate_index_id: str
        :param body: Is either a JSON type or a IO[bytes] type. Required.
        :type body: JSON or IO[bytes]
        :keyword location: Object defining the location of the FloatingRateIndex in the platform.
         Required.
        :paramtype location: ~analyticsapi.models.Location
        :keyword definition: Object defining the FloatingRateIndex. Required.
        :paramtype definition: ~analyticsapi.models.FloatingRateIndexDefinition
        :keyword description: Object defining metadata for the FloatingRateIndex. Default value is
         None.
        :paramtype description: ~analyticsapi.models.Description
        :return: FloatingRateIndexResponse or ServiceErrorResponse. The FloatingRateIndexResponse is
         compatible with MutableMapping
        :rtype: ~analyticsapi.models.FloatingRateIndexResponse or
         ~analyticsapi.models.ServiceErrorResponse
        :raises ~corehttp.exceptions.HttpResponseError:

        Example:
            .. code-block:: python

                # JSON input template you can fill out and use as your body input.
                body = {
                    "definition": {
                        "currency": "str",
                        "name": "str",
                        "quoteDefinition": {
                            "instrumentCode": "str",
                            "ask": {
                                "historicalFidPriority": [
                                    "str"
                                ],
                                "realTimeFidPriority": [
                                    "str"
                                ]
                            },
                            "bid": {
                                "historicalFidPriority": [
                                    "str"
                                ],
                                "realTimeFidPriority": [
                                    "str"
                                ]
                            },
                            "source": "str"
                        },
                        "rounding": {
                            "decimalPlaces": 0,
                            "direction": "str",
                            "scale": 0
                        },
                        "tenor": "str",
                        "yearBasis": "str"
                    },
                    "location": {
                        "name": "str",
                        "space": "str"
                    },
                    "description": {
                        "summary": "str",
                        "tags": [
                            "str"
                        ]
                    }
                }

                # response body for status code(s): 200
                response == {
                    "data": {
                        "definition": {
                            "currency": "str",
                            "name": "str",
                            "quoteDefinition": {
                                "instrumentCode": "str",
                                "ask": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "bid": {
                                    "historicalFidPriority": [
                                        "str"
                                    ],
                                    "realTimeFidPriority": [
                                        "str"
                                    ]
                                },
                                "source": "str"
                            },
                            "rounding": {
                                "decimalPlaces": 0,
                                "direction": "str",
                                "scale": 0
                            },
                            "tenor": "str",
                            "yearBasis": "str"
                        },
                        "location": {
                            "name": "str",
                            "space": "str"
                        },
                        "description": {
                            "summary": "str",
                            "tags": [
                                "str"
                            ]
                        },
                        "id": "str",
                        "type": "str"
                    },
                    "meta": {
                        "createdAt": "2020-02-20 00:00:00",
                        "creator": "str",
                        "deletedAt": "2020-02-20 00:00:00",
                        "revision": "str",
                        "status": "str",
                        "updatedAt": "2020-02-20 00:00:00",
                        "updatedBy": "str"
                    }
                }
                # response body for status code(s): 400, 401, 403, 404, 405, 406, 408, 409, 410, 412, 415, 423, 428, 429, 500,
                  501, 502, 503, 504
                response == {
                    "error": {
                        "code": "str",
                        "id": "str",
                        "message": "str",
                        "errors": [
                            {
                                "key": "str",
                                "reason": "str",
                                "invalidName": "str",
                                "name": "str"
                            }
                        ],
                        "status": "str"
                    }
                }
        """
        error_map: MutableMapping[int, Type[HttpResponseError]] = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

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

        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[Union[_models.FloatingRateIndexResponse, _models.ServiceErrorResponse]] = kwargs.pop("cls", None)

        if body is _Unset:
            if location is _Unset:
                raise TypeError("missing required argument: location")
            if definition is _Unset:
                raise TypeError("missing required argument: definition")
            body = {"definition": definition, "description": description, "location": location}
            body = {k: v for k, v in body.items() if v is not None}
        content_type = content_type or "application/json"
        _content = None
        if isinstance(body, (IOBase, bytes)):
            _content = body
        else:
            _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True)  # type: ignore

        _request = build_floating_rate_index_resource_overwrite_request(
            floating_rate_index_id=floating_rate_index_id,
            content_type=content_type,
            content=_content,
            headers=_headers,
            params=_params,
        )
        path_format_arguments = {
            "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
        }
        _request.url = self._client.format_url(_request.url, **path_format_arguments)

        _stream = kwargs.pop("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,
            400,
            401,
            403,
            404,
            405,
            406,
            408,
            409,
            410,
            412,
            415,
            423,
            428,
            429,
            500,
            501,
            502,
            503,
            504,
        ]:
            if _stream:
                try:
                    await response.read()  # Load the body in memory and close the socket
                except (StreamConsumedError, StreamClosedError):
                    pass
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            raise HttpResponseError(response=response)

        if response.content_type == "text/html" and "Microsoft-Azure-Application-Gateway" in response.headers.get(
            "Server", ""
        ):
            return _deserialize(
                _models.ServiceErrorResponse,
                {
                    "error": {
                        "id": "",
                        "code": response.status_code,
                        "status": response.status_code,
                        "message": f"unsupported content type {str(response.content_type)}. Original message is {str(response.content)}",
                    }
                },
            )

        response_headers = {}
        if response.status_code == 200:
            response_headers["location"] = self._deserialize("str", response.headers.get("location"))

            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.FloatingRateIndexResponse, response.json())

        if response.status_code == 400:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 401:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 403:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 404:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 405:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 406:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 408:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 409:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 410:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 412:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 415:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 423:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 428:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 429:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 500:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 501:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 502:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 503:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

        if response.status_code == 504:
            if _stream:
                deserialized = response.iter_bytes()
            else:
                deserialized = _deserialize(_models.ServiceErrorResponse, response.json())

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

        return deserialized  # type: ignore
