# coding: utf-8

"""
    Indicator API

    API for Indicator Data about the crypto market

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

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

import warnings
from asgiref.sync import async_to_sync
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union, Awaitable
from typing_extensions import Annotated

from pydantic import Field, StrictStr, field_validator
from typing import Any, List, Optional
from typing_extensions import Annotated
from crypticorn.indicator.client.models.polymarket_histogram import PolymarketHistogram
from crypticorn.indicator.client.models.polymarket_histogram_update import PolymarketHistogramUpdate

from crypticorn.indicator.client.api_client import ApiClient, RequestSerialized
from crypticorn.indicator.client.api_response import ApiResponse
from crypticorn.indicator.client.rest import RESTResponseType


class HistogramsApi:
    """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, is_sync: bool = False) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client
        self.is_sync = is_sync


    @validate_call
    def get_latest_polymarket_histogram(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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,
    ) -> Union[PolymarketHistogram, Awaitable[PolymarketHistogram]]:
        """Get Latest Polymarket Histogram"""
        if self.is_sync:
            return self._get_latest_polymarket_histogram_sync(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_latest_polymarket_histogram_async(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def get_latest_polymarket_histogram_with_http_info(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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,
    ) -> Union[ApiResponse[PolymarketHistogram], Awaitable[ApiResponse[PolymarketHistogram]]]:
        """Get Latest Polymarket Histogram with HTTP info"""
        if self.is_sync:
            return self._get_latest_polymarket_histogram_sync_with_http_info(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_latest_polymarket_histogram_async_with_http_info(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def get_latest_polymarket_histogram_without_preload_content(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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,
    ) -> Union[RESTResponseType, Awaitable[RESTResponseType]]:
        """Get Latest Polymarket Histogram without preloading content"""
        if self.is_sync:
            return self._get_latest_polymarket_histogram_sync_without_preload_content(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_latest_polymarket_histogram_async_without_preload_content(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    # Private async implementation methods
    @validate_call
    async def _get_latest_polymarket_histogram_async(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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,
    ) -> PolymarketHistogram:
        """Get Latest Polymarket Histogram

        Get the latest Polymarket histogram for a specific symbol and interval.  Returns the most recent histogram data for pattern-matching based predictions.

        :param symbol: The symbol (e.g., BTC, ETH) (required)
        :type symbol: str
        :param interval: The interval (e.g., 15min, 1h) (required)
        :type interval: 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._get_latest_polymarket_histogram_serialize(
            symbol=symbol,
            interval=interval,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PolymarketHistogram",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def _get_latest_polymarket_histogram_async_with_http_info(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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[PolymarketHistogram]:
        """Get Latest Polymarket Histogram

        Get the latest Polymarket histogram for a specific symbol and interval.  Returns the most recent histogram data for pattern-matching based predictions.

        :param symbol: The symbol (e.g., BTC, ETH) (required)
        :type symbol: str
        :param interval: The interval (e.g., 15min, 1h) (required)
        :type interval: 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._get_latest_polymarket_histogram_serialize(
            symbol=symbol,
            interval=interval,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PolymarketHistogram",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data, response_types_map=_response_types_map
        )


    @validate_call
    async def _get_latest_polymarket_histogram_async_without_preload_content(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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:
        """Get Latest Polymarket Histogram

        Get the latest Polymarket histogram for a specific symbol and interval.  Returns the most recent histogram data for pattern-matching based predictions.

        :param symbol: The symbol (e.g., BTC, ETH) (required)
        :type symbol: str
        :param interval: The interval (e.g., 15min, 1h) (required)
        :type interval: 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._get_latest_polymarket_histogram_serialize(
            symbol=symbol,
            interval=interval,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "PolymarketHistogram",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data


    # Private sync implementation methods
    @validate_call
    def _get_latest_polymarket_histogram_sync(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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,
    ) -> PolymarketHistogram:
        """Synchronous version of get_latest_polymarket_histogram"""
        return async_to_sync(self._get_latest_polymarket_histogram_async)(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def _get_latest_polymarket_histogram_sync_with_http_info(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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[PolymarketHistogram]:
        """Synchronous version of get_latest_polymarket_histogram_with_http_info"""
        return async_to_sync(self._get_latest_polymarket_histogram_async_with_http_info)(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def _get_latest_polymarket_histogram_sync_without_preload_content(
        self,
        symbol: Annotated[StrictStr, Field(description="The symbol (e.g., BTC, ETH)")],
        interval: Annotated[StrictStr, Field(description="The interval (e.g., 15min, 1h)")],
        _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:
        """Synchronous version of get_latest_polymarket_histogram_without_preload_content"""
        return async_to_sync(self._get_latest_polymarket_histogram_async_without_preload_content)(
        symbol=symbol,
        interval=interval,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    def _get_latest_polymarket_histogram_serialize(
        self,
        symbol,
        interval,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _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
        if symbol is not None:
            _path_params['symbol'] = symbol
        if interval is not None:
            _path_params['interval'] = interval
        # process the query parameters
        # 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] = [
            'APIKeyHeader', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/histogram/latest/{symbol}/{interval}',
            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 get_latest_polymarket_histograms(
        self,
        _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,
    ) -> Union[List[PolymarketHistogram], Awaitable[List[PolymarketHistogram]]]:
        """Get Latest Polymarket Histograms"""
        if self.is_sync:
            return self._get_latest_polymarket_histograms_sync(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_latest_polymarket_histograms_async(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def get_latest_polymarket_histograms_with_http_info(
        self,
        _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,
    ) -> Union[ApiResponse[List[PolymarketHistogram]], Awaitable[ApiResponse[List[PolymarketHistogram]]]]:
        """Get Latest Polymarket Histograms with HTTP info"""
        if self.is_sync:
            return self._get_latest_polymarket_histograms_sync_with_http_info(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_latest_polymarket_histograms_async_with_http_info(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def get_latest_polymarket_histograms_without_preload_content(
        self,
        _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,
    ) -> Union[RESTResponseType, Awaitable[RESTResponseType]]:
        """Get Latest Polymarket Histograms without preloading content"""
        if self.is_sync:
            return self._get_latest_polymarket_histograms_sync_without_preload_content(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_latest_polymarket_histograms_async_without_preload_content(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    # Private async implementation methods
    @validate_call
    async def _get_latest_polymarket_histograms_async(
        self,
        _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,
    ) -> List[PolymarketHistogram]:
        """Get Latest Polymarket Histograms

        Get the latest Polymarket histograms for all symbols and intervals.  The response contains one latest histogram per (symbol, interval) pair.

        :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._get_latest_polymarket_histograms_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PolymarketHistogram]",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def _get_latest_polymarket_histograms_async_with_http_info(
        self,
        _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[List[PolymarketHistogram]]:
        """Get Latest Polymarket Histograms

        Get the latest Polymarket histograms for all symbols and intervals.  The response contains one latest histogram per (symbol, interval) pair.

        :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._get_latest_polymarket_histograms_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PolymarketHistogram]",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data, response_types_map=_response_types_map
        )


    @validate_call
    async def _get_latest_polymarket_histograms_async_without_preload_content(
        self,
        _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:
        """Get Latest Polymarket Histograms

        Get the latest Polymarket histograms for all symbols and intervals.  The response contains one latest histogram per (symbol, interval) pair.

        :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._get_latest_polymarket_histograms_serialize(
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PolymarketHistogram]",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data


    # Private sync implementation methods
    @validate_call
    def _get_latest_polymarket_histograms_sync(
        self,
        _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,
    ) -> List[PolymarketHistogram]:
        """Synchronous version of get_latest_polymarket_histograms"""
        return async_to_sync(self._get_latest_polymarket_histograms_async)(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def _get_latest_polymarket_histograms_sync_with_http_info(
        self,
        _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[List[PolymarketHistogram]]:
        """Synchronous version of get_latest_polymarket_histograms_with_http_info"""
        return async_to_sync(self._get_latest_polymarket_histograms_async_with_http_info)(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def _get_latest_polymarket_histograms_sync_without_preload_content(
        self,
        _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:
        """Synchronous version of get_latest_polymarket_histograms_without_preload_content"""
        return async_to_sync(self._get_latest_polymarket_histograms_async_without_preload_content)(
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    def _get_latest_polymarket_histograms_serialize(
        self,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _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


        # 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] = [
            'APIKeyHeader', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/histogram/latest',
            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 get_polymarket_histograms(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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,
    ) -> Union[List[PolymarketHistogram], Awaitable[List[PolymarketHistogram]]]:
        """Get Polymarket Histograms"""
        if self.is_sync:
            return self._get_polymarket_histograms_sync(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_polymarket_histograms_async(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def get_polymarket_histograms_with_http_info(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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,
    ) -> Union[ApiResponse[List[PolymarketHistogram]], Awaitable[ApiResponse[List[PolymarketHistogram]]]]:
        """Get Polymarket Histograms with HTTP info"""
        if self.is_sync:
            return self._get_polymarket_histograms_sync_with_http_info(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_polymarket_histograms_async_with_http_info(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def get_polymarket_histograms_without_preload_content(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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,
    ) -> Union[RESTResponseType, Awaitable[RESTResponseType]]:
        """Get Polymarket Histograms without preloading content"""
        if self.is_sync:
            return self._get_polymarket_histograms_sync_without_preload_content(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._get_polymarket_histograms_async_without_preload_content(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    # Private async implementation methods
    @validate_call
    async def _get_polymarket_histograms_async(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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,
    ) -> List[PolymarketHistogram]:
        """Get Polymarket Histograms

        Get Polymarket histograms with optional filtering.  Returns histograms ordered by timestamp (newest first), optionally filtered by symbol and/or interval.

        :param symbol: Filter by symbol (e.g., BTC)
        :type symbol: str
        :param interval: Filter by interval (e.g., 15min)
        :type interval: str
        :param limit: Number of results to return
        :type limit: 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._get_polymarket_histograms_serialize(
            symbol=symbol,
            interval=interval,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PolymarketHistogram]",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def _get_polymarket_histograms_async_with_http_info(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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[List[PolymarketHistogram]]:
        """Get Polymarket Histograms

        Get Polymarket histograms with optional filtering.  Returns histograms ordered by timestamp (newest first), optionally filtered by symbol and/or interval.

        :param symbol: Filter by symbol (e.g., BTC)
        :type symbol: str
        :param interval: Filter by interval (e.g., 15min)
        :type interval: str
        :param limit: Number of results to return
        :type limit: 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._get_polymarket_histograms_serialize(
            symbol=symbol,
            interval=interval,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PolymarketHistogram]",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data, response_types_map=_response_types_map
        )


    @validate_call
    async def _get_polymarket_histograms_async_without_preload_content(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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:
        """Get Polymarket Histograms

        Get Polymarket histograms with optional filtering.  Returns histograms ordered by timestamp (newest first), optionally filtered by symbol and/or interval.

        :param symbol: Filter by symbol (e.g., BTC)
        :type symbol: str
        :param interval: Filter by interval (e.g., 15min)
        :type interval: str
        :param limit: Number of results to return
        :type limit: 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._get_polymarket_histograms_serialize(
            symbol=symbol,
            interval=interval,
            limit=limit,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "List[PolymarketHistogram]",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data


    # Private sync implementation methods
    @validate_call
    def _get_polymarket_histograms_sync(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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,
    ) -> List[PolymarketHistogram]:
        """Synchronous version of get_polymarket_histograms"""
        return async_to_sync(self._get_polymarket_histograms_async)(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def _get_polymarket_histograms_sync_with_http_info(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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[List[PolymarketHistogram]]:
        """Synchronous version of get_polymarket_histograms_with_http_info"""
        return async_to_sync(self._get_polymarket_histograms_async_with_http_info)(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def _get_polymarket_histograms_sync_without_preload_content(
        self,
        symbol: Annotated[Optional[StrictStr], Field(description="Filter by symbol (e.g., BTC)")] = None,
        interval: Annotated[Optional[StrictStr], Field(description="Filter by interval (e.g., 15min)")] = None,
        limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True)]], Field(description="Number of results to return")] = 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:
        """Synchronous version of get_polymarket_histograms_without_preload_content"""
        return async_to_sync(self._get_polymarket_histograms_async_without_preload_content)(
        symbol=symbol,
        interval=interval,
        limit=limit,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    def _get_polymarket_histograms_serialize(
        self,
        symbol,
        interval,
        limit,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _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 symbol is not None:
            
            _query_params.append(('symbol', symbol))
            
        if interval is not None:
            
            _query_params.append(('interval', interval))
            
        if limit is not None:
            
            _query_params.append(('limit', limit))
            
        # 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] = [
            'APIKeyHeader', 
            'HTTPBearer'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/histogram',
            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 post_polymarket_histogram(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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,
    ) -> Union[object, Awaitable[object]]:
        """Post Polymarket Histogram"""
        if self.is_sync:
            return self._post_polymarket_histogram_sync(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._post_polymarket_histogram_async(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def post_polymarket_histogram_with_http_info(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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,
    ) -> Union[ApiResponse[object], Awaitable[ApiResponse[object]]]:
        """Post Polymarket Histogram with HTTP info"""
        if self.is_sync:
            return self._post_polymarket_histogram_sync_with_http_info(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._post_polymarket_histogram_async_with_http_info(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def post_polymarket_histogram_without_preload_content(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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,
    ) -> Union[RESTResponseType, Awaitable[RESTResponseType]]:
        """Post Polymarket Histogram without preloading content"""
        if self.is_sync:
            return self._post_polymarket_histogram_sync_without_preload_content(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )

        else:
            return self._post_polymarket_histogram_async_without_preload_content(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    # Private async implementation methods
    @validate_call
    async def _post_polymarket_histogram_async(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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,
    ) -> object:
        """Post Polymarket Histogram

        Post a new Polymarket histogram.  The histogram is stored in the background and a 202 response is returned. This endpoint is called by the histogram generation service to store pattern-matching histogram data for price predictions.

        :param polymarket_histogram_update: (required)
        :type polymarket_histogram_update: PolymarketHistogramUpdate
        :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._post_polymarket_histogram_serialize(
            polymarket_histogram_update=polymarket_histogram_update,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '202': "object",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    async def _post_polymarket_histogram_async_with_http_info(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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[object]:
        """Post Polymarket Histogram

        Post a new Polymarket histogram.  The histogram is stored in the background and a 202 response is returned. This endpoint is called by the histogram generation service to store pattern-matching histogram data for price predictions.

        :param polymarket_histogram_update: (required)
        :type polymarket_histogram_update: PolymarketHistogramUpdate
        :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._post_polymarket_histogram_serialize(
            polymarket_histogram_update=polymarket_histogram_update,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '202': "object",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        await response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data, response_types_map=_response_types_map
        )


    @validate_call
    async def _post_polymarket_histogram_async_without_preload_content(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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:
        """Post Polymarket Histogram

        Post a new Polymarket histogram.  The histogram is stored in the background and a 202 response is returned. This endpoint is called by the histogram generation service to store pattern-matching histogram data for price predictions.

        :param polymarket_histogram_update: (required)
        :type polymarket_histogram_update: PolymarketHistogramUpdate
        :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._post_polymarket_histogram_serialize(
            polymarket_histogram_update=polymarket_histogram_update,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '202': "object",
        }

        response_data = await self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data


    # Private sync implementation methods
    @validate_call
    def _post_polymarket_histogram_sync(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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,
    ) -> object:
        """Synchronous version of post_polymarket_histogram"""
        return async_to_sync(self._post_polymarket_histogram_async)(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def _post_polymarket_histogram_sync_with_http_info(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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[object]:
        """Synchronous version of post_polymarket_histogram_with_http_info"""
        return async_to_sync(self._post_polymarket_histogram_async_with_http_info)(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    @validate_call
    def _post_polymarket_histogram_sync_without_preload_content(
        self,
        polymarket_histogram_update: PolymarketHistogramUpdate,
        _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:
        """Synchronous version of post_polymarket_histogram_without_preload_content"""
        return async_to_sync(self._post_polymarket_histogram_async_without_preload_content)(
        polymarket_histogram_update=polymarket_histogram_update,
        _request_timeout=_request_timeout,
        _request_auth=_request_auth,
        _content_type=_content_type,
        _headers=_headers,
        _host_index=_host_index,
    )



    def _post_polymarket_histogram_serialize(
        self,
        polymarket_histogram_update,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _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 polymarket_histogram_update is not None:
            _body_params = polymarket_histogram_update


        # 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='/histogram',
            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
        )


