# coding: utf-8

"""
Kaziro API

Kaziro Trading API Documentation

The version of the OpenAPI document: 1.0.5
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
"""  # noqa: E501

from typing import Any, Dict, List, Optional, Tuple, Union

from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
from typing_extensions import Annotated

from ..api_client import ApiClient, RequestSerialized
from ..api_response import ApiResponse
from ..models.market_creation_response import MarketCreationResponse
from ..models.market_detail import MarketDetail
from ..models.market_price_history_response import MarketPriceHistoryResponse
from ..models.market_retrieval_response import MarketRetrievalResponse
from ..rest import RESTResponseType


class MarketApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client

    @validate_call
    def create_market_endpoint_v1_exchange_market_create_post(
        self,
        market_detail: List[MarketDetail],
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> MarketCreationResponse:
        """Create Market Endpoint

        Create multiple markets via API.  This endpoint allows users to create multiple conditional markets simultaneously.  Parameters: - market_details (List[MarketDetail]): A list of market details, each containing:     - detail (str): The description of the market     - ref_id (str): A reference identifier for the market  Returns: - MarketCreationResponse:     A dictionary containing the created markets or an error message.  Raises: - HTTPException(400): If there's a validation error or insufficient balance - HTTPException(401): If the API key is invalid - HTTPException(500): For any other unexpected errors  Note: - This endpoint requires a valid Kaziro API Key to be provided in the header. - A market creation fee will be charged for each market created. - Markets are automatically CLOSED after 10 minutes if no request accepts a reply.

        :param market_detail: (required)
        :type market_detail: List[MarketDetail]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_market_endpoint_v1_exchange_market_create_post_serialize(
            market_detail=market_detail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketCreationResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def create_market_endpoint_v1_exchange_market_create_post_with_http_info(
        self,
        market_detail: List[MarketDetail],
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[MarketCreationResponse]:
        """Create Market Endpoint

        Create multiple markets via API.  This endpoint allows users to create multiple conditional markets simultaneously.  Parameters: - market_details (List[MarketDetail]): A list of market details, each containing:     - detail (str): The description of the market     - ref_id (str): A reference identifier for the market  Returns: - MarketCreationResponse:     A dictionary containing the created markets or an error message.  Raises: - HTTPException(400): If there's a validation error or insufficient balance - HTTPException(401): If the API key is invalid - HTTPException(500): For any other unexpected errors  Note: - This endpoint requires a valid Kaziro API Key to be provided in the header. - A market creation fee will be charged for each market created. - Markets are automatically CLOSED after 10 minutes if no request accepts a reply.

        :param market_detail: (required)
        :type market_detail: List[MarketDetail]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_market_endpoint_v1_exchange_market_create_post_serialize(
            market_detail=market_detail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketCreationResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def create_market_endpoint_v1_exchange_market_create_post_without_preload_content(
        self,
        market_detail: List[MarketDetail],
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Create Market Endpoint

        Create multiple markets via API.  This endpoint allows users to create multiple conditional markets simultaneously.  Parameters: - market_details (List[MarketDetail]): A list of market details, each containing:     - detail (str): The description of the market     - ref_id (str): A reference identifier for the market  Returns: - MarketCreationResponse:     A dictionary containing the created markets or an error message.  Raises: - HTTPException(400): If there's a validation error or insufficient balance - HTTPException(401): If the API key is invalid - HTTPException(500): For any other unexpected errors  Note: - This endpoint requires a valid Kaziro API Key to be provided in the header. - A market creation fee will be charged for each market created. - Markets are automatically CLOSED after 10 minutes if no request accepts a reply.

        :param market_detail: (required)
        :type market_detail: List[MarketDetail]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._create_market_endpoint_v1_exchange_market_create_post_serialize(
            market_detail=market_detail, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketCreationResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _create_market_endpoint_v1_exchange_market_create_post_serialize(
        self,
        market_detail,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:
        _host = None

        _collection_formats: Dict[str, str] = {
            "MarketDetail": "",
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if market_detail is not None:
            _body_params = market_detail

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params["Content-Type"] = _content_type
        else:
            _default_content_type = self.api_client.select_header_content_type(["application/json"])
            if _default_content_type is not None:
                _header_params["Content-Type"] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = ["APIKeyHeader"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/v1/exchange/market/create",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def retrieve_markets_endpoint_v1_exchange_market_retrieve_get(
        self,
        market_ids: Optional[List[StrictStr]] = None,
        statuses: Optional[List[StrictStr]] = None,
        tags: Optional[List[StrictStr]] = None,
        creator_id: Optional[StrictStr] = None,
        search_query: Optional[StrictStr] = None,
        sort_by: Optional[StrictStr] = None,
        sort_direction: Optional[StrictStr] = None,
        bucket: Optional[StrictStr] = None,
        page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> MarketRetrievalResponse:
        """Retrieve Markets Endpoint

        Retrieve markets based on various filters and sorting options.  Parameters: - market_ids: Optional list of specific market IDs to retrieve - status: Filter markets by their status - tags: Filter markets that contain ALL of the specified tags - creator_id: Filter markets by their creator - search_query: Search in market questions and descriptions - sort_by: Field to sort results by - sort_direction: Direction of sort (asc or desc) - bucket: Special grouping parameter for market sets - page: Page number for pagination (starts at 1)  Returns: - MarketRetrievalResponse: A list of markets matching the criteria

        :param market_ids:
        :type market_ids: List[str]
        :param statuses:
        :type statuses: List[str]
        :param tags:
        :type tags: List[str]
        :param creator_id:
        :type creator_id: str
        :param search_query:
        :type search_query: str
        :param sort_by:
        :type sort_by: str
        :param sort_direction:
        :type sort_direction: str
        :param bucket:
        :type bucket: str
        :param page:
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._retrieve_markets_endpoint_v1_exchange_market_retrieve_get_serialize(
            market_ids=market_ids,
            statuses=statuses,
            tags=tags,
            creator_id=creator_id,
            search_query=search_query,
            sort_by=sort_by,
            sort_direction=sort_direction,
            bucket=bucket,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketRetrievalResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def retrieve_markets_endpoint_v1_exchange_market_retrieve_get_with_http_info(
        self,
        market_ids: Optional[List[StrictStr]] = None,
        statuses: Optional[List[StrictStr]] = None,
        tags: Optional[List[StrictStr]] = None,
        creator_id: Optional[StrictStr] = None,
        search_query: Optional[StrictStr] = None,
        sort_by: Optional[StrictStr] = None,
        sort_direction: Optional[StrictStr] = None,
        bucket: Optional[StrictStr] = None,
        page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[MarketRetrievalResponse]:
        """Retrieve Markets Endpoint

        Retrieve markets based on various filters and sorting options.  Parameters: - market_ids: Optional list of specific market IDs to retrieve - status: Filter markets by their status - tags: Filter markets that contain ALL of the specified tags - creator_id: Filter markets by their creator - search_query: Search in market questions and descriptions - sort_by: Field to sort results by - sort_direction: Direction of sort (asc or desc) - bucket: Special grouping parameter for market sets - page: Page number for pagination (starts at 1)  Returns: - MarketRetrievalResponse: A list of markets matching the criteria

        :param market_ids:
        :type market_ids: List[str]
        :param statuses:
        :type statuses: List[str]
        :param tags:
        :type tags: List[str]
        :param creator_id:
        :type creator_id: str
        :param search_query:
        :type search_query: str
        :param sort_by:
        :type sort_by: str
        :param sort_direction:
        :type sort_direction: str
        :param bucket:
        :type bucket: str
        :param page:
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._retrieve_markets_endpoint_v1_exchange_market_retrieve_get_serialize(
            market_ids=market_ids,
            statuses=statuses,
            tags=tags,
            creator_id=creator_id,
            search_query=search_query,
            sort_by=sort_by,
            sort_direction=sort_direction,
            bucket=bucket,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketRetrievalResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def retrieve_markets_endpoint_v1_exchange_market_retrieve_get_without_preload_content(
        self,
        market_ids: Optional[List[StrictStr]] = None,
        statuses: Optional[List[StrictStr]] = None,
        tags: Optional[List[StrictStr]] = None,
        creator_id: Optional[StrictStr] = None,
        search_query: Optional[StrictStr] = None,
        sort_by: Optional[StrictStr] = None,
        sort_direction: Optional[StrictStr] = None,
        bucket: Optional[StrictStr] = None,
        page: Optional[Annotated[int, Field(strict=True, ge=1)]] = None,
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve Markets Endpoint

        Retrieve markets based on various filters and sorting options.  Parameters: - market_ids: Optional list of specific market IDs to retrieve - status: Filter markets by their status - tags: Filter markets that contain ALL of the specified tags - creator_id: Filter markets by their creator - search_query: Search in market questions and descriptions - sort_by: Field to sort results by - sort_direction: Direction of sort (asc or desc) - bucket: Special grouping parameter for market sets - page: Page number for pagination (starts at 1)  Returns: - MarketRetrievalResponse: A list of markets matching the criteria

        :param market_ids:
        :type market_ids: List[str]
        :param statuses:
        :type statuses: List[str]
        :param tags:
        :type tags: List[str]
        :param creator_id:
        :type creator_id: str
        :param search_query:
        :type search_query: str
        :param sort_by:
        :type sort_by: str
        :param sort_direction:
        :type sort_direction: str
        :param bucket:
        :type bucket: str
        :param page:
        :type page: int
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._retrieve_markets_endpoint_v1_exchange_market_retrieve_get_serialize(
            market_ids=market_ids,
            statuses=statuses,
            tags=tags,
            creator_id=creator_id,
            search_query=search_query,
            sort_by=sort_by,
            sort_direction=sort_direction,
            bucket=bucket,
            page=page,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketRetrievalResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _retrieve_markets_endpoint_v1_exchange_market_retrieve_get_serialize(
        self,
        market_ids,
        statuses,
        tags,
        creator_id,
        search_query,
        sort_by,
        sort_direction,
        bucket,
        page,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:
        _host = None

        _collection_formats: Dict[str, str] = {
            "market_ids": "multi",
            "statuses": "multi",
            "tags": "multi",
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if market_ids is not None:
            _query_params.append(("market_ids", market_ids))

        if statuses is not None:
            _query_params.append(("statuses", statuses))

        if tags is not None:
            _query_params.append(("tags", tags))

        if creator_id is not None:
            _query_params.append(("creator_id", creator_id))

        if search_query is not None:
            _query_params.append(("search_query", search_query))

        if sort_by is not None:
            _query_params.append(("sort_by", sort_by))

        if sort_direction is not None:
            _query_params.append(("sort_direction", sort_direction))

        if bucket is not None:
            _query_params.append(("bucket", bucket))

        if page is not None:
            _query_params.append(("page", page))

        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = []

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/v1/exchange/market/retrieve",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )

    @validate_call
    def retrieve_ohlc_endpoint_v1_exchange_market_retrieve_ohlc_get(
        self,
        market_ids: Annotated[List[StrictStr], Field(description="List of market IDs to retrieve OHLC data for")],
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> MarketPriceHistoryResponse:
        """Retrieve Ohlc Endpoint


        :param market_ids: List of market IDs to retrieve OHLC data for (required)
        :type market_ids: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._retrieve_ohlc_endpoint_v1_exchange_market_retrieve_ohlc_get_serialize(
            market_ids=market_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketPriceHistoryResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data

    @validate_call
    def retrieve_ohlc_endpoint_v1_exchange_market_retrieve_ohlc_get_with_http_info(
        self,
        market_ids: Annotated[List[StrictStr], Field(description="List of market IDs to retrieve OHLC data for")],
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[MarketPriceHistoryResponse]:
        """Retrieve Ohlc Endpoint


        :param market_ids: List of market IDs to retrieve OHLC data for (required)
        :type market_ids: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._retrieve_ohlc_endpoint_v1_exchange_market_retrieve_ohlc_get_serialize(
            market_ids=market_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketPriceHistoryResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    @validate_call
    def retrieve_ohlc_endpoint_v1_exchange_market_retrieve_ohlc_get_without_preload_content(
        self,
        market_ids: Annotated[List[StrictStr], Field(description="List of market IDs to retrieve OHLC data for")],
        _request_timeout: Union[None, Annotated[StrictFloat, Field(gt=0)], Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]]] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> RESTResponseType:
        """Retrieve Ohlc Endpoint


        :param market_ids: List of market IDs to retrieve OHLC data for (required)
        :type market_ids: List[str]
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """  # noqa: E501

        _param = self._retrieve_ohlc_endpoint_v1_exchange_market_retrieve_ohlc_get_serialize(
            market_ids=market_ids, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "200": "MarketPriceHistoryResponse",
            "400": "ErrorResponse",
            "500": "ErrorResponse",
            "422": "HTTPValidationError",
        }
        response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
        return response_data.response

    def _retrieve_ohlc_endpoint_v1_exchange_market_retrieve_ohlc_get_serialize(
        self,
        market_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:
        _host = None

        _collection_formats: Dict[str, str] = {
            "market_ids": "multi",
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        if market_ids is not None:
            _query_params.append(("market_ids", market_ids))

        # process the header parameters
        # process the form parameters
        # process the body parameter

        # set the HTTP header `Accept`
        if "Accept" not in _header_params:
            _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])

        # authentication setting
        _auth_settings: List[str] = []

        return self.api_client.param_serialize(
            method="GET",
            resource_path="/v1/exchange/market/retrieve/ohlc",
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth,
        )
