# coding: utf-8

"""
Trading API

API for automated trading and exchange interface. This API is used to trade on the exchange and manage bots, API keys, orders, and more.

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

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

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

from crypticorn.trade.client.api_client import ApiClient, RequestSerialized
from crypticorn.trade.client.api_response import ApiResponse
from crypticorn.trade.client.models.bot import Bot
from crypticorn.trade.client.models.bot_create import BotCreate
from crypticorn.trade.client.models.bot_update import BotUpdate
from crypticorn.trade.client.models.orders_count import OrdersCount
from crypticorn.trade.client.models.paginated_response_futures_trading_action import (
    PaginatedResponseFuturesTradingAction,
)
from crypticorn.trade.client.models.paginated_response_order import (
    PaginatedResponseOrder,
)
from crypticorn.trade.client.models.pn_l import PnL
from crypticorn.trade.client.rest import RESTResponseType

# Import async_to_sync for sync methods
try:
    from asgiref.sync import async_to_sync

    _HAS_ASGIREF = True
except ImportError:
    _HAS_ASGIREF = False

    def async_to_sync(async_func):
        """Fallback decorator that raises an error if asgiref is not available."""

        def wrapper(*args, **kwargs):
            raise ImportError(
                "asgiref is required for sync methods. Install with: pip install asgiref"
            )

        return wrapper


class BotsApi:
    """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 create_bot(
        self,
        bot_create: BotCreate,
        _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[Bot, Awaitable[Bot]]:
        """Create Bot"""
        if self.is_sync:
            return self._create_bot_sync(
                bot_create=bot_create,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

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

    @validate_call
    def create_bot_with_http_info(
        self,
        bot_create: BotCreate,
        _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[Bot], Awaitable[ApiResponse[Bot]]]:
        """Create Bot with HTTP info"""
        if self.is_sync:
            return self._create_bot_sync_with_http_info(
                bot_create=bot_create,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

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

    @validate_call
    def create_bot_without_preload_content(
        self,
        bot_create: BotCreate,
        _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]]:
        """Create Bot without preloading content"""
        if self.is_sync:
            return self._create_bot_sync_without_preload_content(
                bot_create=bot_create,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._create_bot_async_without_preload_content(
                bot_create=bot_create,
                _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 _create_bot_async(
        self,
        bot_create: BotCreate,
        _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,
    ) -> Bot:
        """Create Bot

        Creates a new bot.

        :param bot_create: (required)
        :type bot_create: BotCreate
        :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_bot_serialize(
            bot_create=bot_create,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "Bot",
        }

        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 _create_bot_async_with_http_info(
        self,
        bot_create: BotCreate,
        _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[Bot]:
        """Create Bot

        Creates a new bot.

        :param bot_create: (required)
        :type bot_create: BotCreate
        :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_bot_serialize(
            bot_create=bot_create,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "Bot",
        }

        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 _create_bot_async_without_preload_content(
        self,
        bot_create: BotCreate,
        _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 Bot

        Creates a new bot.

        :param bot_create: (required)
        :type bot_create: BotCreate
        :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_bot_serialize(
            bot_create=bot_create,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "201": "Bot",
        }

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

    # Private sync implementation methods
    @validate_call
    def _create_bot_sync(
        self,
        bot_create: BotCreate,
        _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,
    ) -> Bot:
        """Synchronous version of create_bot"""
        return async_to_sync(self._create_bot_async)(
            bot_create=bot_create,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _create_bot_sync_with_http_info(
        self,
        bot_create: BotCreate,
        _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[Bot]:
        """Synchronous version of create_bot_with_http_info"""
        return async_to_sync(self._create_bot_async_with_http_info)(
            bot_create=bot_create,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _create_bot_sync_without_preload_content(
        self,
        bot_create: BotCreate,
        _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 create_bot_without_preload_content"""
        return async_to_sync(self._create_bot_async_without_preload_content)(
            bot_create=bot_create,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _create_bot_serialize(
        self,
        bot_create,
        _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 bot_create is not None:
            _body_params = bot_create

        # 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", "HTTPBearer"]

        return self.api_client.param_serialize(
            method="POST",
            resource_path="/bots",
            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 delete_bot(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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[None, Awaitable[None]]:
        """Delete Bot"""
        if self.is_sync:
            return self._delete_bot_sync(
                id=id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

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

    @validate_call
    def delete_bot_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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[None], Awaitable[ApiResponse[None]]]:
        """Delete Bot with HTTP info"""
        if self.is_sync:
            return self._delete_bot_sync_with_http_info(
                id=id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

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

    @validate_call
    def delete_bot_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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]]:
        """Delete Bot without preloading content"""
        if self.is_sync:
            return self._delete_bot_sync_without_preload_content(
                id=id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._delete_bot_async_without_preload_content(
                id=id,
                _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 _delete_bot_async(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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,
    ) -> None:
        """Delete Bot

        Soft deletes a bot by cancelling all orders and closing all positions.

        :param id: The ID of the bot (required)
        :type id: 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._delete_bot_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
        }

        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 _delete_bot_async_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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[None]:
        """Delete Bot

        Soft deletes a bot by cancelling all orders and closing all positions.

        :param id: The ID of the bot (required)
        :type id: 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._delete_bot_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
        }

        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 _delete_bot_async_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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:
        """Delete Bot

        Soft deletes a bot by cancelling all orders and closing all positions.

        :param id: The ID of the bot (required)
        :type id: 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._delete_bot_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

        _response_types_map: Dict[str, Optional[str]] = {
            "204": None,
        }

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

    # Private sync implementation methods
    @validate_call
    def _delete_bot_sync(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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,
    ) -> None:
        """Synchronous version of delete_bot"""
        return async_to_sync(self._delete_bot_async)(
            id=id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _delete_bot_sync_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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[None]:
        """Synchronous version of delete_bot_with_http_info"""
        return async_to_sync(self._delete_bot_async_with_http_info)(
            id=id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _delete_bot_sync_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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 delete_bot_without_preload_content"""
        return async_to_sync(self._delete_bot_async_without_preload_content)(
            id=id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _delete_bot_serialize(
        self,
        id,
        _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 id is not None:
            _path_params["id"] = id
        # 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="DELETE",
            resource_path="/bots/{id}",
            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_bot(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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[Bot, Awaitable[Bot]]:
        """Get Bot"""
        if self.is_sync:
            return self._get_bot_sync(
                id=id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

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

    @validate_call
    def get_bot_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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[Bot], Awaitable[ApiResponse[Bot]]]:
        """Get Bot with HTTP info"""
        if self.is_sync:
            return self._get_bot_sync_with_http_info(
                id=id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

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

    @validate_call
    def get_bot_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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 Bot without preloading content"""
        if self.is_sync:
            return self._get_bot_sync_without_preload_content(
                id=id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_async_without_preload_content(
                id=id,
                _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_bot_async(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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,
    ) -> Bot:
        """Get Bot

        Returns a bot for the user.

        :param id: The ID of the bot (required)
        :type id: 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_bot_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bot_async_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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[Bot]:
        """Get Bot

        Returns a bot for the user.

        :param id: The ID of the bot (required)
        :type id: 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_bot_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bot_async_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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 Bot

        Returns a bot for the user.

        :param id: The ID of the bot (required)
        :type id: 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_bot_serialize(
            id=id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _get_bot_sync(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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,
    ) -> Bot:
        """Synchronous version of get_bot"""
        return async_to_sync(self._get_bot_async)(
            id=id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_sync_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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[Bot]:
        """Synchronous version of get_bot_with_http_info"""
        return async_to_sync(self._get_bot_async_with_http_info)(
            id=id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_sync_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        _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_bot_without_preload_content"""
        return async_to_sync(self._get_bot_async_without_preload_content)(
            id=id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bot_serialize(
        self,
        id,
        _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 id is not None:
            _path_params["id"] = id
        # 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="/bots/{id}",
            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_bot_actions(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[
        PaginatedResponseFuturesTradingAction,
        Awaitable[PaginatedResponseFuturesTradingAction],
    ]:
        """Get Bot Actions"""
        if self.is_sync:
            return self._get_bot_actions_sync(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_actions_async(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bot_actions_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseFuturesTradingAction],
        Awaitable[ApiResponse[PaginatedResponseFuturesTradingAction]],
    ]:
        """Get Bot Actions with HTTP info"""
        if self.is_sync:
            return self._get_bot_actions_sync_with_http_info(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_actions_async_with_http_info(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bot_actions_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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 Bot Actions without preloading content"""
        if self.is_sync:
            return self._get_bot_actions_sync_without_preload_content(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_actions_async_without_preload_content(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _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_bot_actions_async(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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,
    ) -> PaginatedResponseFuturesTradingAction:
        """Get Bot Actions

        Get all orders for a bot of the user

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bot_actions_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bot_actions_async_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseFuturesTradingAction]:
        """Get Bot Actions

        Get all orders for a bot of the user

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bot_actions_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bot_actions_async_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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 Bot Actions

        Get all orders for a bot of the user

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bot_actions_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _get_bot_actions_sync(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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,
    ) -> PaginatedResponseFuturesTradingAction:
        """Synchronous version of get_bot_actions"""
        return async_to_sync(self._get_bot_actions_async)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_actions_sync_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseFuturesTradingAction]:
        """Synchronous version of get_bot_actions_with_http_info"""
        return async_to_sync(self._get_bot_actions_async_with_http_info)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_actions_sync_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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_bot_actions_without_preload_content"""
        return async_to_sync(self._get_bot_actions_async_without_preload_content)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bot_actions_serialize(
        self,
        id,
        sort_order,
        sort_by,
        filter_by,
        filter_value,
        page,
        page_size,
        user_id,
        _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 id is not None:
            _path_params["id"] = id
        # process the query parameters
        if sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if filter_by is not None:

            _query_params.append(("filter_by", filter_by))

        if filter_value is not None:

            _query_params.append(("filter_value", filter_value))

        if page is not None:

            _query_params.append(("page", page))

        if page_size is not None:

            _query_params.append(("page_size", page_size))

        if user_id is not None:

            _query_params.append(("user_id", user_id))

        # 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="/bots/{id}/actions",
            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_bot_orders(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseOrder, Awaitable[PaginatedResponseOrder]]:
        """Get Bot Orders"""
        if self.is_sync:
            return self._get_bot_orders_sync(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_async(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bot_orders_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseOrder],
        Awaitable[ApiResponse[PaginatedResponseOrder]],
    ]:
        """Get Bot Orders with HTTP info"""
        if self.is_sync:
            return self._get_bot_orders_sync_with_http_info(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_async_with_http_info(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bot_orders_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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 Bot Orders without preloading content"""
        if self.is_sync:
            return self._get_bot_orders_sync_without_preload_content(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_async_without_preload_content(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _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_bot_orders_async(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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,
    ) -> PaginatedResponseOrder:
        """Get Bot Orders

        Get all orders for a bot of the user. Default sort is `created_at` and default order is `desc`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bot_orders_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bot_orders_async_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseOrder]:
        """Get Bot Orders

        Get all orders for a bot of the user. Default sort is `created_at` and default order is `desc`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bot_orders_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bot_orders_async_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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 Bot Orders

        Get all orders for a bot of the user. Default sort is `created_at` and default order is `desc`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bot_orders_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _get_bot_orders_sync(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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,
    ) -> PaginatedResponseOrder:
        """Synchronous version of get_bot_orders"""
        return async_to_sync(self._get_bot_orders_async)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_orders_sync_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseOrder]:
        """Synchronous version of get_bot_orders_with_http_info"""
        return async_to_sync(self._get_bot_orders_async_with_http_info)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_orders_sync_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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_bot_orders_without_preload_content"""
        return async_to_sync(self._get_bot_orders_async_without_preload_content)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bot_orders_serialize(
        self,
        id,
        sort_order,
        sort_by,
        filter_by,
        filter_value,
        page,
        page_size,
        user_id,
        _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 id is not None:
            _path_params["id"] = id
        # process the query parameters
        if sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if filter_by is not None:

            _query_params.append(("filter_by", filter_by))

        if filter_value is not None:

            _query_params.append(("filter_value", filter_value))

        if page is not None:

            _query_params.append(("page", page))

        if page_size is not None:

            _query_params.append(("page_size", page_size))

        if user_id is not None:

            _query_params.append(("user_id", user_id))

        # 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="/bots/{id}/orders",
            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_bot_orders_count(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount], Awaitable[List[OrdersCount]]]:
        """Get Bot Orders Count"""
        if self.is_sync:
            return self._get_bot_orders_count_sync(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_count_async(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bot_orders_count_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]], Awaitable[ApiResponse[List[OrdersCount]]]
    ]:
        """Get Bot Orders Count with HTTP info"""
        if self.is_sync:
            return self._get_bot_orders_count_sync_with_http_info(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_count_async_with_http_info(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bot_orders_count_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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 Bot Orders Count without preloading content"""
        if self.is_sync:
            return self._get_bot_orders_count_sync_without_preload_content(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_count_async_without_preload_content(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _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_bot_orders_count_async(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]:
        """Get Bot Orders Count

        Get the number of orders for a bot by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param group_by: The group by period for the orders count. Defaults to day.
        :type group_by: 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_bot_orders_count_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bot_orders_count_async_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]]:
        """Get Bot Orders Count

        Get the number of orders for a bot by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param group_by: The group by period for the orders count. Defaults to day.
        :type group_by: 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_bot_orders_count_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bot_orders_count_async_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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 Bot Orders Count

        Get the number of orders for a bot by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param group_by: The group by period for the orders count. Defaults to day.
        :type group_by: 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_bot_orders_count_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _get_bot_orders_count_sync(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]:
        """Synchronous version of get_bot_orders_count"""
        return async_to_sync(self._get_bot_orders_count_async)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_orders_count_sync_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]]:
        """Synchronous version of get_bot_orders_count_with_http_info"""
        return async_to_sync(self._get_bot_orders_count_async_with_http_info)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_orders_count_sync_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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_bot_orders_count_without_preload_content"""
        return async_to_sync(self._get_bot_orders_count_async_without_preload_content)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bot_orders_count_serialize(
        self,
        id,
        sort_order,
        sort_by,
        group_by,
        _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 id is not None:
            _path_params["id"] = id
        # process the query parameters
        if sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if group_by is not None:

            _query_params.append(("group_by", group_by))

        # 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="/bots/{id}/orders/count",
            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_bot_orders_pnl(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL], Awaitable[List[PnL]]]:
        """Get Bot Pnl"""
        if self.is_sync:
            return self._get_bot_orders_pnl_sync(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_pnl_async(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bot_orders_pnl_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]], Awaitable[ApiResponse[List[PnL]]]]:
        """Get Bot Pnl with HTTP info"""
        if self.is_sync:
            return self._get_bot_orders_pnl_sync_with_http_info(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_pnl_async_with_http_info(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bot_orders_pnl_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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 Bot Pnl without preloading content"""
        if self.is_sync:
            return self._get_bot_orders_pnl_sync_without_preload_content(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bot_orders_pnl_async_without_preload_content(
                id=id,
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                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_bot_orders_pnl_async(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]:
        """Get Bot Pnl

        Returns a list of PnLs for a bot over time, sorted by `timestamp` ascending by default.  If more than 1000 points exist, PnLs are grouped by day. To get the latest cumulative PnL in a time window, use `sort_by=timestamp`, `sort_order=desc`, and `limit=1`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param window: Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range.
        :type window: str
        :param period: The number of days to return the PnL for. Only used if `window` is `period`. Default is 30.
        :type period: int
        :param user_id: The ID of the user. Defaults to the authenticated user, unless user is an admin.
        :type user_id: str
        :param limit: The number of items to return. Defaults to None, meaning no limit.
        :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_bot_orders_pnl_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            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[PnL]",
        }

        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_bot_orders_pnl_async_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]]:
        """Get Bot Pnl

        Returns a list of PnLs for a bot over time, sorted by `timestamp` ascending by default.  If more than 1000 points exist, PnLs are grouped by day. To get the latest cumulative PnL in a time window, use `sort_by=timestamp`, `sort_order=desc`, and `limit=1`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param window: Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range.
        :type window: str
        :param period: The number of days to return the PnL for. Only used if `window` is `period`. Default is 30.
        :type period: int
        :param user_id: The ID of the user. Defaults to the authenticated user, unless user is an admin.
        :type user_id: str
        :param limit: The number of items to return. Defaults to None, meaning no limit.
        :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_bot_orders_pnl_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            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[PnL]",
        }

        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_bot_orders_pnl_async_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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 Bot Pnl

        Returns a list of PnLs for a bot over time, sorted by `timestamp` ascending by default.  If more than 1000 points exist, PnLs are grouped by day. To get the latest cumulative PnL in a time window, use `sort_by=timestamp`, `sort_order=desc`, and `limit=1`.

        :param id: The ID of the bot (required)
        :type id: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param window: Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range.
        :type window: str
        :param period: The number of days to return the PnL for. Only used if `window` is `period`. Default is 30.
        :type period: int
        :param user_id: The ID of the user. Defaults to the authenticated user, unless user is an admin.
        :type user_id: str
        :param limit: The number of items to return. Defaults to None, meaning no limit.
        :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_bot_orders_pnl_serialize(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            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[PnL]",
        }

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

    # Private sync implementation methods
    @validate_call
    def _get_bot_orders_pnl_sync(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]:
        """Synchronous version of get_bot_orders_pnl"""
        return async_to_sync(self._get_bot_orders_pnl_async)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            limit=limit,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_orders_pnl_sync_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]]:
        """Synchronous version of get_bot_orders_pnl_with_http_info"""
        return async_to_sync(self._get_bot_orders_pnl_async_with_http_info)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            limit=limit,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bot_orders_pnl_sync_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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_bot_orders_pnl_without_preload_content"""
        return async_to_sync(self._get_bot_orders_pnl_async_without_preload_content)(
            id=id,
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            limit=limit,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bot_orders_pnl_serialize(
        self,
        id,
        sort_order,
        sort_by,
        window,
        period,
        user_id,
        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
        if id is not None:
            _path_params["id"] = id
        # process the query parameters
        if sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if window is not None:

            _query_params.append(("window", window))

        if period is not None:

            _query_params.append(("period", period))

        if user_id is not None:

            _query_params.append(("user_id", user_id))

        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="/bots/{id}/orders/pnl",
            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_bots(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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[Bot], Awaitable[List[Bot]]]:
        """Get Bots"""
        if self.is_sync:
            return self._get_bots_sync(
                filter_by=filter_by,
                filter_value=filter_value,
                sort_order=sort_order,
                sort_by=sort_by,
                include_deleted=include_deleted,
                should_validate=should_validate,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_async(
                filter_by=filter_by,
                filter_value=filter_value,
                sort_order=sort_order,
                sort_by=sort_by,
                include_deleted=include_deleted,
                should_validate=should_validate,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_with_http_info(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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[Bot]], Awaitable[ApiResponse[List[Bot]]]]:
        """Get Bots with HTTP info"""
        if self.is_sync:
            return self._get_bots_sync_with_http_info(
                filter_by=filter_by,
                filter_value=filter_value,
                sort_order=sort_order,
                sort_by=sort_by,
                include_deleted=include_deleted,
                should_validate=should_validate,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_async_with_http_info(
                filter_by=filter_by,
                filter_value=filter_value,
                sort_order=sort_order,
                sort_by=sort_by,
                include_deleted=include_deleted,
                should_validate=should_validate,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_without_preload_content(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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 Bots without preloading content"""
        if self.is_sync:
            return self._get_bots_sync_without_preload_content(
                filter_by=filter_by,
                filter_value=filter_value,
                sort_order=sort_order,
                sort_by=sort_by,
                include_deleted=include_deleted,
                should_validate=should_validate,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_async_without_preload_content(
                filter_by=filter_by,
                filter_value=filter_value,
                sort_order=sort_order,
                sort_by=sort_by,
                include_deleted=include_deleted,
                should_validate=should_validate,
                _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_bots_async(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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[Bot]:
        """Get Bots

        Returns all bots for the user. Default sort is by created_at, descending. Deleted bots are included by default.

        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param include_deleted: Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True.
        :type include_deleted: bool
        :param should_validate: Whether to validate the bots. Defaults to True.
        :type should_validate: bool
        :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_bots_serialize(
            filter_by=filter_by,
            filter_value=filter_value,
            sort_order=sort_order,
            sort_by=sort_by,
            include_deleted=include_deleted,
            should_validate=should_validate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bots_async_with_http_info(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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[Bot]]:
        """Get Bots

        Returns all bots for the user. Default sort is by created_at, descending. Deleted bots are included by default.

        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param include_deleted: Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True.
        :type include_deleted: bool
        :param should_validate: Whether to validate the bots. Defaults to True.
        :type should_validate: bool
        :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_bots_serialize(
            filter_by=filter_by,
            filter_value=filter_value,
            sort_order=sort_order,
            sort_by=sort_by,
            include_deleted=include_deleted,
            should_validate=should_validate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bots_async_without_preload_content(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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 Bots

        Returns all bots for the user. Default sort is by created_at, descending. Deleted bots are included by default.

        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param include_deleted: Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True.
        :type include_deleted: bool
        :param should_validate: Whether to validate the bots. Defaults to True.
        :type should_validate: bool
        :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_bots_serialize(
            filter_by=filter_by,
            filter_value=filter_value,
            sort_order=sort_order,
            sort_by=sort_by,
            include_deleted=include_deleted,
            should_validate=should_validate,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _get_bots_sync(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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[Bot]:
        """Synchronous version of get_bots"""
        return async_to_sync(self._get_bots_async)(
            filter_by=filter_by,
            filter_value=filter_value,
            sort_order=sort_order,
            sort_by=sort_by,
            include_deleted=include_deleted,
            should_validate=should_validate,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_sync_with_http_info(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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[Bot]]:
        """Synchronous version of get_bots_with_http_info"""
        return async_to_sync(self._get_bots_async_with_http_info)(
            filter_by=filter_by,
            filter_value=filter_value,
            sort_order=sort_order,
            sort_by=sort_by,
            include_deleted=include_deleted,
            should_validate=should_validate,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_sync_without_preload_content(
        self,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        include_deleted: Annotated[
            Optional[StrictBool],
            Field(
                description="Whether to include deleted bots. Filter by status takes precedence over this. Defaults to True."
            ),
        ] = None,
        should_validate: Annotated[
            Optional[StrictBool],
            Field(description="Whether to validate the bots. Defaults to True."),
        ] = 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_bots_without_preload_content"""
        return async_to_sync(self._get_bots_async_without_preload_content)(
            filter_by=filter_by,
            filter_value=filter_value,
            sort_order=sort_order,
            sort_by=sort_by,
            include_deleted=include_deleted,
            should_validate=should_validate,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bots_serialize(
        self,
        filter_by,
        filter_value,
        sort_order,
        sort_by,
        include_deleted,
        should_validate,
        _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 filter_by is not None:

            _query_params.append(("filter_by", filter_by))

        if filter_value is not None:

            _query_params.append(("filter_value", filter_value))

        if sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if include_deleted is not None:

            _query_params.append(("include_deleted", include_deleted))

        if should_validate is not None:

            _query_params.append(("should_validate", should_validate))

        # 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="/bots",
            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_bots_actions(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[
        PaginatedResponseFuturesTradingAction,
        Awaitable[PaginatedResponseFuturesTradingAction],
    ]:
        """Get Bots Actions"""
        if self.is_sync:
            return self._get_bots_actions_sync(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_actions_async(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_actions_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseFuturesTradingAction],
        Awaitable[ApiResponse[PaginatedResponseFuturesTradingAction]],
    ]:
        """Get Bots Actions with HTTP info"""
        if self.is_sync:
            return self._get_bots_actions_sync_with_http_info(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_actions_async_with_http_info(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_actions_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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 Bots Actions without preloading content"""
        if self.is_sync:
            return self._get_bots_actions_sync_without_preload_content(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_actions_async_without_preload_content(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _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_bots_actions_async(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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,
    ) -> PaginatedResponseFuturesTradingAction:
        """Get Bots Actions

        Get all actions for all bots of the user

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bots_actions_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bots_actions_async_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseFuturesTradingAction]:
        """Get Bots Actions

        Get all actions for all bots of the user

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bots_actions_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bots_actions_async_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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 Bots Actions

        Get all actions for all bots of the user

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bots_actions_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _get_bots_actions_sync(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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,
    ) -> PaginatedResponseFuturesTradingAction:
        """Synchronous version of get_bots_actions"""
        return async_to_sync(self._get_bots_actions_async)(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_actions_sync_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseFuturesTradingAction]:
        """Synchronous version of get_bots_actions_with_http_info"""
        return async_to_sync(self._get_bots_actions_async_with_http_info)(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_actions_sync_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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_bots_actions_without_preload_content"""
        return async_to_sync(self._get_bots_actions_async_without_preload_content)(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bots_actions_serialize(
        self,
        sort_order,
        sort_by,
        filter_by,
        filter_value,
        page,
        page_size,
        user_id,
        _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 sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if filter_by is not None:

            _query_params.append(("filter_by", filter_by))

        if filter_value is not None:

            _query_params.append(("filter_value", filter_value))

        if page is not None:

            _query_params.append(("page", page))

        if page_size is not None:

            _query_params.append(("page_size", page_size))

        if user_id is not None:

            _query_params.append(("user_id", user_id))

        # 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="/bots/actions",
            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_bots_orders(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseOrder, Awaitable[PaginatedResponseOrder]]:
        """Get Bots Orders"""
        if self.is_sync:
            return self._get_bots_orders_sync(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_async(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_orders_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseOrder],
        Awaitable[ApiResponse[PaginatedResponseOrder]],
    ]:
        """Get Bots Orders with HTTP info"""
        if self.is_sync:
            return self._get_bots_orders_sync_with_http_info(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_async_with_http_info(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_orders_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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 Bots Orders without preloading content"""
        if self.is_sync:
            return self._get_bots_orders_sync_without_preload_content(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_async_without_preload_content(
                sort_order=sort_order,
                sort_by=sort_by,
                filter_by=filter_by,
                filter_value=filter_value,
                page=page,
                page_size=page_size,
                user_id=user_id,
                _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_bots_orders_async(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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,
    ) -> PaginatedResponseOrder:
        """Get Bots Orders

        Get all orders for all bots of the user. Default sort is `created_at` and default order is `desc`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bots_orders_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bots_orders_async_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseOrder]:
        """Get Bots Orders

        Get all orders for all bots of the user. Default sort is `created_at` and default order is `desc`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bots_orders_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bots_orders_async_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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 Bots Orders

        Get all orders for all bots of the user. Default sort is `created_at` and default order is `desc`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param filter_by: The field to filter by
        :type filter_by: str
        :param filter_value: The value to filter with
        :type filter_value: str
        :param page: The current page number
        :type page: int
        :param page_size: The number of items per page. Default is 100, max is 1000.
        :type page_size: int
        :param user_id: The ID of the user. Overrides the authenticated user if provided and the user is an admin.
        :type user_id: 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_bots_orders_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _get_bots_orders_sync(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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,
    ) -> PaginatedResponseOrder:
        """Synchronous version of get_bots_orders"""
        return async_to_sync(self._get_bots_orders_async)(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_orders_sync_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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[PaginatedResponseOrder]:
        """Synchronous version of get_bots_orders_with_http_info"""
        return async_to_sync(self._get_bots_orders_async_with_http_info)(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_orders_sync_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        filter_by: Annotated[
            Optional[StrictStr], Field(description="The field to filter by")
        ] = None,
        filter_value: Annotated[
            Optional[StrictStr], Field(description="The value to filter with")
        ] = None,
        page: Annotated[
            Optional[StrictInt], Field(description="The current page number")
        ] = None,
        page_size: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items per page. Default is 100, max is 1000."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Overrides the authenticated user if provided and the user is an admin."
            ),
        ] = 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_bots_orders_without_preload_content"""
        return async_to_sync(self._get_bots_orders_async_without_preload_content)(
            sort_order=sort_order,
            sort_by=sort_by,
            filter_by=filter_by,
            filter_value=filter_value,
            page=page,
            page_size=page_size,
            user_id=user_id,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bots_orders_serialize(
        self,
        sort_order,
        sort_by,
        filter_by,
        filter_value,
        page,
        page_size,
        user_id,
        _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 sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if filter_by is not None:

            _query_params.append(("filter_by", filter_by))

        if filter_value is not None:

            _query_params.append(("filter_value", filter_value))

        if page is not None:

            _query_params.append(("page", page))

        if page_size is not None:

            _query_params.append(("page_size", page_size))

        if user_id is not None:

            _query_params.append(("user_id", user_id))

        # 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="/bots/orders",
            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_bots_orders_count(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount], Awaitable[List[OrdersCount]]]:
        """Get Bots Orders Count"""
        if self.is_sync:
            return self._get_bots_orders_count_sync(
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_count_async(
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_orders_count_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]], Awaitable[ApiResponse[List[OrdersCount]]]
    ]:
        """Get Bots Orders Count with HTTP info"""
        if self.is_sync:
            return self._get_bots_orders_count_sync_with_http_info(
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_count_async_with_http_info(
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_orders_count_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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 Bots Orders Count without preloading content"""
        if self.is_sync:
            return self._get_bots_orders_count_sync_without_preload_content(
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_count_async_without_preload_content(
                sort_order=sort_order,
                sort_by=sort_by,
                group_by=group_by,
                _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_bots_orders_count_async(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]:
        """Get Bots Orders Count

        Get the number of orders for all bots of the user by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param group_by: The group by period for the orders count. Defaults to day.
        :type group_by: 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_bots_orders_count_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bots_orders_count_async_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]]:
        """Get Bots Orders Count

        Get the number of orders for all bots of the user by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param group_by: The group by period for the orders count. Defaults to day.
        :type group_by: 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_bots_orders_count_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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_bots_orders_count_async_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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 Bots Orders Count

        Get the number of orders for all bots of the user by day, week, month, or year. The default sort is `timestamp` and the default order is `asc`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param group_by: The group by period for the orders count. Defaults to day.
        :type group_by: 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_bots_orders_count_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _get_bots_orders_count_sync(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]:
        """Synchronous version of get_bots_orders_count"""
        return async_to_sync(self._get_bots_orders_count_async)(
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_orders_count_sync_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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[OrdersCount]]:
        """Synchronous version of get_bots_orders_count_with_http_info"""
        return async_to_sync(self._get_bots_orders_count_async_with_http_info)(
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_orders_count_sync_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        group_by: Annotated[
            Optional[StrictStr],
            Field(
                description="The group by period for the orders count. Defaults to day."
            ),
        ] = 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_bots_orders_count_without_preload_content"""
        return async_to_sync(self._get_bots_orders_count_async_without_preload_content)(
            sort_order=sort_order,
            sort_by=sort_by,
            group_by=group_by,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bots_orders_count_serialize(
        self,
        sort_order,
        sort_by,
        group_by,
        _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 sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if group_by is not None:

            _query_params.append(("group_by", group_by))

        # 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="/bots/orders/count",
            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_bots_orders_pnl(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL], Awaitable[List[PnL]]]:
        """Get Bots Pnl"""
        if self.is_sync:
            return self._get_bots_orders_pnl_sync(
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_pnl_async(
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_orders_pnl_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]], Awaitable[ApiResponse[List[PnL]]]]:
        """Get Bots Pnl with HTTP info"""
        if self.is_sync:
            return self._get_bots_orders_pnl_sync_with_http_info(
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_pnl_async_with_http_info(
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def get_bots_orders_pnl_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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 Bots Pnl without preloading content"""
        if self.is_sync:
            return self._get_bots_orders_pnl_sync_without_preload_content(
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                limit=limit,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._get_bots_orders_pnl_async_without_preload_content(
                sort_order=sort_order,
                sort_by=sort_by,
                window=window,
                period=period,
                user_id=user_id,
                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_bots_orders_pnl_async(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]:
        """Get Bots Pnl

        Returns a list of PnLs for all bots of the user over time, sorted by `timestamp` ascending by default.  If more than 1000 points exist, PnLs are grouped by day. To get the latest cumulative PnL in a time window, use `sort_by=timestamp`, `sort_order=desc`, and `limit=1`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param window: Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range.
        :type window: str
        :param period: The number of days to return the PnL for. Only used if `window` is `period`. Default is 30.
        :type period: int
        :param user_id: The ID of the user. Defaults to the authenticated user, unless user is an admin.
        :type user_id: str
        :param limit: The number of items to return. Defaults to None, meaning no limit.
        :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_bots_orders_pnl_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            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[PnL]",
        }

        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_bots_orders_pnl_async_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]]:
        """Get Bots Pnl

        Returns a list of PnLs for all bots of the user over time, sorted by `timestamp` ascending by default.  If more than 1000 points exist, PnLs are grouped by day. To get the latest cumulative PnL in a time window, use `sort_by=timestamp`, `sort_order=desc`, and `limit=1`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param window: Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range.
        :type window: str
        :param period: The number of days to return the PnL for. Only used if `window` is `period`. Default is 30.
        :type period: int
        :param user_id: The ID of the user. Defaults to the authenticated user, unless user is an admin.
        :type user_id: str
        :param limit: The number of items to return. Defaults to None, meaning no limit.
        :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_bots_orders_pnl_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            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[PnL]",
        }

        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_bots_orders_pnl_async_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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 Bots Pnl

        Returns a list of PnLs for all bots of the user over time, sorted by `timestamp` ascending by default.  If more than 1000 points exist, PnLs are grouped by day. To get the latest cumulative PnL in a time window, use `sort_by=timestamp`, `sort_order=desc`, and `limit=1`.

        :param sort_order: The order to sort by
        :type sort_order: str
        :param sort_by: The field to sort by
        :type sort_by: str
        :param window: Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range.
        :type window: str
        :param period: The number of days to return the PnL for. Only used if `window` is `period`. Default is 30.
        :type period: int
        :param user_id: The ID of the user. Defaults to the authenticated user, unless user is an admin.
        :type user_id: str
        :param limit: The number of items to return. Defaults to None, meaning no limit.
        :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_bots_orders_pnl_serialize(
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            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[PnL]",
        }

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

    # Private sync implementation methods
    @validate_call
    def _get_bots_orders_pnl_sync(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]:
        """Synchronous version of get_bots_orders_pnl"""
        return async_to_sync(self._get_bots_orders_pnl_async)(
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            limit=limit,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_orders_pnl_sync_with_http_info(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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[PnL]]:
        """Synchronous version of get_bots_orders_pnl_with_http_info"""
        return async_to_sync(self._get_bots_orders_pnl_async_with_http_info)(
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            limit=limit,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _get_bots_orders_pnl_sync_without_preload_content(
        self,
        sort_order: Annotated[
            Optional[StrictStr], Field(description="The order to sort by")
        ] = None,
        sort_by: Annotated[
            Optional[StrictStr], Field(description="The field to sort by")
        ] = None,
        window: Annotated[
            Optional[StrictStr],
            Field(
                description="Time window for PnL. Defaults to full (all time), or use period (last X days), month, quarter, or year for values since the start of that range."
            ),
        ] = None,
        period: Annotated[
            Optional[Annotated[int, Field(le=365, strict=True, ge=1)]],
            Field(
                description="The number of days to return the PnL for. Only used if `window` is `period`. Default is 30."
            ),
        ] = None,
        user_id: Annotated[
            Optional[StrictStr],
            Field(
                description="The ID of the user. Defaults to the authenticated user, unless user is an admin."
            ),
        ] = None,
        limit: Annotated[
            Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
            Field(
                description="The number of items to return. Defaults to None, meaning no limit."
            ),
        ] = 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_bots_orders_pnl_without_preload_content"""
        return async_to_sync(self._get_bots_orders_pnl_async_without_preload_content)(
            sort_order=sort_order,
            sort_by=sort_by,
            window=window,
            period=period,
            user_id=user_id,
            limit=limit,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _get_bots_orders_pnl_serialize(
        self,
        sort_order,
        sort_by,
        window,
        period,
        user_id,
        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 sort_order is not None:

            _query_params.append(("sort_order", sort_order))

        if sort_by is not None:

            _query_params.append(("sort_by", sort_by))

        if window is not None:

            _query_params.append(("window", window))

        if period is not None:

            _query_params.append(("period", period))

        if user_id is not None:

            _query_params.append(("user_id", user_id))

        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="/bots/orders/pnl",
            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 update_bot(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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[Bot, Awaitable[Bot]]:
        """Update Bot"""
        if self.is_sync:
            return self._update_bot_sync(
                id=id,
                bot_update=bot_update,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._update_bot_async(
                id=id,
                bot_update=bot_update,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def update_bot_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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[Bot], Awaitable[ApiResponse[Bot]]]:
        """Update Bot with HTTP info"""
        if self.is_sync:
            return self._update_bot_sync_with_http_info(
                id=id,
                bot_update=bot_update,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._update_bot_async_with_http_info(
                id=id,
                bot_update=bot_update,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

    @validate_call
    def update_bot_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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]]:
        """Update Bot without preloading content"""
        if self.is_sync:
            return self._update_bot_sync_without_preload_content(
                id=id,
                bot_update=bot_update,
                _request_timeout=_request_timeout,
                _request_auth=_request_auth,
                _content_type=_content_type,
                _headers=_headers,
                _host_index=_host_index,
            )

        else:
            return self._update_bot_async_without_preload_content(
                id=id,
                bot_update=bot_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 _update_bot_async(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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,
    ) -> Bot:
        """Update Bot

        Updates a bot.

        :param id: The ID of the bot (required)
        :type id: str
        :param bot_update: (required)
        :type bot_update: BotUpdate
        :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._update_bot_serialize(
            id=id,
            bot_update=bot_update,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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 _update_bot_async_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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[Bot]:
        """Update Bot

        Updates a bot.

        :param id: The ID of the bot (required)
        :type id: str
        :param bot_update: (required)
        :type bot_update: BotUpdate
        :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._update_bot_serialize(
            id=id,
            bot_update=bot_update,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

        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 _update_bot_async_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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:
        """Update Bot

        Updates a bot.

        :param id: The ID of the bot (required)
        :type id: str
        :param bot_update: (required)
        :type bot_update: BotUpdate
        :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._update_bot_serialize(
            id=id,
            bot_update=bot_update,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

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

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

    # Private sync implementation methods
    @validate_call
    def _update_bot_sync(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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,
    ) -> Bot:
        """Synchronous version of update_bot"""
        return async_to_sync(self._update_bot_async)(
            id=id,
            bot_update=bot_update,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _update_bot_sync_with_http_info(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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[Bot]:
        """Synchronous version of update_bot_with_http_info"""
        return async_to_sync(self._update_bot_async_with_http_info)(
            id=id,
            bot_update=bot_update,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    @validate_call
    def _update_bot_sync_without_preload_content(
        self,
        id: Annotated[StrictStr, Field(description="The ID of the bot")],
        bot_update: BotUpdate,
        _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 update_bot_without_preload_content"""
        return async_to_sync(self._update_bot_async_without_preload_content)(
            id=id,
            bot_update=bot_update,
            _request_timeout=_request_timeout,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index,
        )

    def _update_bot_serialize(
        self,
        id,
        bot_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
        if id is not None:
            _path_params["id"] = id
        # process the query parameters
        # process the header parameters
        # process the form parameters
        # process the body parameter
        if bot_update is not None:
            _body_params = bot_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", "HTTPBearer"]

        return self.api_client.param_serialize(
            method="PUT",
            resource_path="/bots/{id}",
            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,
        )
