"""
Binance Spot WebSocket API

OpenAPI Specifications for the Binance Spot WebSocket API

API documents:
  - [Github web-socket-api documentation file](https://github.com/binance/binance-spot-api-docs/blob/master/web-socket-api.md)
  - [General API information for web-socket-api on website](https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/general-api-information)

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

Do not edit the class manually.
"""

from binance_common.errors import RequiredError
from binance_common.models import WebsocketApiResponse
from binance_common.signature import Signers
from binance_common.websocket import WebSocketAPIBase

from ..models import AccountCommissionResponse
from ..models import AccountRateLimitsOrdersResponse
from ..models import AccountStatusResponse
from ..models import AllOrderListsResponse
from ..models import AllOrdersResponse
from ..models import MyAllocationsResponse
from ..models import MyFiltersResponse
from ..models import MyPreventedMatchesResponse
from ..models import MyTradesResponse
from ..models import OpenOrderListsStatusResponse
from ..models import OpenOrdersStatusResponse
from ..models import OrderAmendmentsResponse
from ..models import OrderListStatusResponse
from ..models import OrderStatusResponse


from typing import Optional, Union


class AccountApi:
    """API Client for AccountApi endpoints."""

    def __init__(
        self,
        websocket_api: WebSocketAPIBase,
        signer: Signers = None,
    ) -> None:
        self.websocket_api = websocket_api
        self.signer = signer

    async def account_commission(
        self,
        symbol: Union[str, None],
        id: Optional[str] = None,
    ) -> WebsocketApiResponse[AccountCommissionResponse]:
        """
            WebSocket Account Commission Rates
            /account.commission
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-commission-rates-user_data

            Get current account commission rates.
        Weight: 20

            Args:
                    symbol (Union[str, None]):
                    id (Optional[str] = None): Unique WebSocket request ID.

            Returns:
                WebsocketApiResponse[AccountCommissionResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        if symbol is None:
            raise RequiredError(
                field="symbol", error_message="Missing required parameter 'symbol'"
            )

        params = {
            "symbol": symbol,
            **({"id": id} if id is not None else {}),
        }

        payload = {
            "method": "/account.commission".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload,
            response_model=AccountCommissionResponse,
            signer=self.signer,
        )

    async def account_rate_limits_orders(
        self,
        id: Optional[str] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[AccountRateLimitsOrdersResponse]:
        """
            WebSocket Unfilled Order Count
            /account.rateLimits.orders
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#unfilled-order-count-user_data

            Query your current unfilled order count for all intervals.
        Weight: 40

            Args:
                    id (Optional[str] = None): Unique WebSocket request ID.
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[AccountRateLimitsOrdersResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        params = {
            **({"id": id} if id is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/account.rateLimits.orders".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload,
            response_model=AccountRateLimitsOrdersResponse,
            signer=self.signer,
        )

    async def account_status(
        self,
        id: Optional[str] = None,
        omit_zero_balances: Optional[bool] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[AccountStatusResponse]:
        """
            WebSocket Account information
            /account.status
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-information-user_data

            Query information about your account.
        Weight: 20

            Args:
                    id (Optional[str] = None): Unique WebSocket request ID.
                    omit_zero_balances (Optional[bool] = None): When set to `true`, emits only the non-zero balances of an account. <br>Default value: false
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[AccountStatusResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        params = {
            **({"id": id} if id is not None else {}),
            **(
                {"omit_zero_balances": omit_zero_balances}
                if omit_zero_balances is not None
                else {}
            ),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/account.status".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=AccountStatusResponse, signer=self.signer
        )

    async def all_order_lists(
        self,
        id: Optional[str] = None,
        from_id: Optional[int] = None,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        limit: Optional[int] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[AllOrderListsResponse]:
        """
            WebSocket Account order list history
            /allOrderLists
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-order-list-history-user_data

            Query information about all your order lists, filtered by time range.
        Weight: 20

            Args:
                    id (Optional[str] = None): Unique WebSocket request ID.
                    from_id (Optional[int] = None): Aggregate trade ID to begin at
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    limit (Optional[int] = None): Default: 100; Maximum: 5000
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[AllOrderListsResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        params = {
            **({"id": id} if id is not None else {}),
            **({"from_id": from_id} if from_id is not None else {}),
            **({"start_time": start_time} if start_time is not None else {}),
            **({"end_time": end_time} if end_time is not None else {}),
            **({"limit": limit} if limit is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/allOrderLists".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=AllOrderListsResponse, signer=self.signer
        )

    async def all_orders(
        self,
        symbol: Union[str, None],
        id: Optional[str] = None,
        order_id: Optional[int] = None,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        limit: Optional[int] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[AllOrdersResponse]:
        """
            WebSocket Account order history
            /allOrders
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-order-history-user_data

            Query information about all your orders – active, canceled, filled – filtered by time range.
        Weight: 20

            Args:
                    symbol (Union[str, None]):
                    id (Optional[str] = None): Unique WebSocket request ID.
                    order_id (Optional[int] = None): `orderId`or`origClientOrderId`mustbesent
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    limit (Optional[int] = None): Default: 100; Maximum: 5000
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[AllOrdersResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        if symbol is None:
            raise RequiredError(
                field="symbol", error_message="Missing required parameter 'symbol'"
            )

        params = {
            "symbol": symbol,
            **({"id": id} if id is not None else {}),
            **({"order_id": order_id} if order_id is not None else {}),
            **({"start_time": start_time} if start_time is not None else {}),
            **({"end_time": end_time} if end_time is not None else {}),
            **({"limit": limit} if limit is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/allOrders".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=AllOrdersResponse, signer=self.signer
        )

    async def my_allocations(
        self,
        symbol: Union[str, None],
        id: Optional[str] = None,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        from_allocation_id: Optional[int] = None,
        limit: Optional[int] = None,
        order_id: Optional[int] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[MyAllocationsResponse]:
        """
            WebSocket Account allocations
            /myAllocations
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-allocations-user_data

            Retrieves allocations resulting from SOR order placement.
        Weight: 20

            Args:
                    symbol (Union[str, None]):
                    id (Optional[str] = None): Unique WebSocket request ID.
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    from_allocation_id (Optional[int] = None):
                    limit (Optional[int] = None): Default: 100; Maximum: 5000
                    order_id (Optional[int] = None): `orderId`or`origClientOrderId`mustbesent
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[MyAllocationsResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        if symbol is None:
            raise RequiredError(
                field="symbol", error_message="Missing required parameter 'symbol'"
            )

        params = {
            "symbol": symbol,
            **({"id": id} if id is not None else {}),
            **({"start_time": start_time} if start_time is not None else {}),
            **({"end_time": end_time} if end_time is not None else {}),
            **(
                {"from_allocation_id": from_allocation_id}
                if from_allocation_id is not None
                else {}
            ),
            **({"limit": limit} if limit is not None else {}),
            **({"order_id": order_id} if order_id is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/myAllocations".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=MyAllocationsResponse, signer=self.signer
        )

    async def my_filters(
        self,
        symbol: Union[str, None],
        id: Optional[str] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[MyFiltersResponse]:
        """
            WebSocket Query Relevant Filters
            /myFilters
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-relevant-filters-user_data

            Retrieves the list of [filters](filters.md) relevant to an account on a given symbol. This is the only method that shows if an account has `MAX_ASSET` filters applied to it.
        Weight: 40

            Args:
                    symbol (Union[str, None]):
                    id (Optional[str] = None): Unique WebSocket request ID.
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[MyFiltersResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        if symbol is None:
            raise RequiredError(
                field="symbol", error_message="Missing required parameter 'symbol'"
            )

        params = {
            "symbol": symbol,
            **({"id": id} if id is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/myFilters".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=MyFiltersResponse, signer=self.signer
        )

    async def my_prevented_matches(
        self,
        symbol: Union[str, None],
        id: Optional[str] = None,
        prevented_match_id: Optional[int] = None,
        order_id: Optional[int] = None,
        from_prevented_match_id: Optional[int] = None,
        limit: Optional[int] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[MyPreventedMatchesResponse]:
        """
            WebSocket Account prevented matches
            /myPreventedMatches
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-prevented-matches-user_data

            Displays the list of orders that were expired due to STP.

        These are the combinations supported:

        * `symbol` + `preventedMatchId`
        * `symbol` + `orderId`
        * `symbol` + `orderId` + `fromPreventedMatchId` (`limit` will default to 500)
        * `symbol` + `orderId` + `fromPreventedMatchId` + `limit`
        Weight: Case                            | Weight
        ----                            | -----
        If `symbol` is invalid          | 2
        Querying by `preventedMatchId`  | 2
        Querying by `orderId`           | 20

            Args:
                    symbol (Union[str, None]):
                    id (Optional[str] = None): Unique WebSocket request ID.
                    prevented_match_id (Optional[int] = None):
                    order_id (Optional[int] = None): `orderId`or`origClientOrderId`mustbesent
                    from_prevented_match_id (Optional[int] = None):
                    limit (Optional[int] = None): Default: 100; Maximum: 5000
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[MyPreventedMatchesResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        if symbol is None:
            raise RequiredError(
                field="symbol", error_message="Missing required parameter 'symbol'"
            )

        params = {
            "symbol": symbol,
            **({"id": id} if id is not None else {}),
            **(
                {"prevented_match_id": prevented_match_id}
                if prevented_match_id is not None
                else {}
            ),
            **({"order_id": order_id} if order_id is not None else {}),
            **(
                {"from_prevented_match_id": from_prevented_match_id}
                if from_prevented_match_id is not None
                else {}
            ),
            **({"limit": limit} if limit is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/myPreventedMatches".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload,
            response_model=MyPreventedMatchesResponse,
            signer=self.signer,
        )

    async def my_trades(
        self,
        symbol: Union[str, None],
        id: Optional[str] = None,
        order_id: Optional[int] = None,
        start_time: Optional[int] = None,
        end_time: Optional[int] = None,
        from_id: Optional[int] = None,
        limit: Optional[int] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[MyTradesResponse]:
        """
            WebSocket Account trade history
            /myTrades
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data

            Query information about all your trades, filtered by time range.
        Weight: Condition| Weight|
        ---| ---
        |Without orderId|20|
        |With orderId|5|

            Args:
                    symbol (Union[str, None]):
                    id (Optional[str] = None): Unique WebSocket request ID.
                    order_id (Optional[int] = None): `orderId`or`origClientOrderId`mustbesent
                    start_time (Optional[int] = None):
                    end_time (Optional[int] = None):
                    from_id (Optional[int] = None): Aggregate trade ID to begin at
                    limit (Optional[int] = None): Default: 100; Maximum: 5000
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[MyTradesResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        if symbol is None:
            raise RequiredError(
                field="symbol", error_message="Missing required parameter 'symbol'"
            )

        params = {
            "symbol": symbol,
            **({"id": id} if id is not None else {}),
            **({"order_id": order_id} if order_id is not None else {}),
            **({"start_time": start_time} if start_time is not None else {}),
            **({"end_time": end_time} if end_time is not None else {}),
            **({"from_id": from_id} if from_id is not None else {}),
            **({"limit": limit} if limit is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/myTrades".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=MyTradesResponse, signer=self.signer
        )

    async def open_order_lists_status(
        self,
        id: Optional[str] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[OpenOrderListsStatusResponse]:
        """
            WebSocket Current open Order lists
            /openOrderLists.status
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#current-open-order-lists-user_data

            Query execution status of all open order lists.

        If you need to continuously monitor order status updates, please consider using WebSocket Streams:

        * `userDataStream.start` request
        * `executionReport` user data stream event
        Weight: 6

            Args:
                    id (Optional[str] = None): Unique WebSocket request ID.
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[OpenOrderListsStatusResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        params = {
            **({"id": id} if id is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/openOrderLists.status".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload,
            response_model=OpenOrderListsStatusResponse,
            signer=self.signer,
        )

    async def open_orders_status(
        self,
        id: Optional[str] = None,
        symbol: Optional[str] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[OpenOrdersStatusResponse]:
        """
            WebSocket Current open orders
            /openOrders.status
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#current-open-orders-user_data

            Query execution status of all open orders.

        If you need to continuously monitor order status updates, please consider using WebSocket Streams:

        * `userDataStream.start` request
        * `executionReport` user data stream event
        Weight: Adjusted based on the number of requested symbols:

        | Parameter | Weight |
        | --------- | ------ |
        | `symbol`  |      6 |
        | none      |     80 |

            Args:
                    id (Optional[str] = None): Unique WebSocket request ID.
                    symbol (Optional[str] = None): Describe a single symbol
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[OpenOrdersStatusResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        params = {
            **({"id": id} if id is not None else {}),
            **({"symbol": symbol} if symbol is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/openOrders.status".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=OpenOrdersStatusResponse, signer=self.signer
        )

    async def order_amendments(
        self,
        symbol: Union[str, None],
        order_id: Union[int, None],
        id: Optional[str] = None,
        from_execution_id: Optional[int] = None,
        limit: Optional[int] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[OrderAmendmentsResponse]:
        """
            WebSocket Query Order Amendments
            /order.amendments
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-amendments-user_data

            Queries all amendments of a single order.
        Weight: 4

            Args:
                    symbol (Union[str, None]):
                    order_id (Union[int, None]):
                    id (Optional[str] = None): Unique WebSocket request ID.
                    from_execution_id (Optional[int] = None):
                    limit (Optional[int] = None): Default: 100; Maximum: 5000
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[OrderAmendmentsResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        if symbol is None:
            raise RequiredError(
                field="symbol", error_message="Missing required parameter 'symbol'"
            )
        if order_id is None:
            raise RequiredError(
                field="order_id", error_message="Missing required parameter 'order_id'"
            )

        params = {
            "symbol": symbol,
            "order_id": order_id,
            **({"id": id} if id is not None else {}),
            **(
                {"from_execution_id": from_execution_id}
                if from_execution_id is not None
                else {}
            ),
            **({"limit": limit} if limit is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/order.amendments".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=OrderAmendmentsResponse, signer=self.signer
        )

    async def order_list_status(
        self,
        id: Optional[str] = None,
        orig_client_order_id: Optional[str] = None,
        order_list_id: Optional[int] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[OrderListStatusResponse]:
        """
            WebSocket Query Order list
            /orderList.status
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-list-user_data

            Check execution status of an Order list.

        For execution status of individual orders, use `order.status`.
        Weight: 4

            Args:
                    id (Optional[str] = None): Unique WebSocket request ID.
                    orig_client_order_id (Optional[str] = None): `orderId`or`origClientOrderId`mustbesent
                    order_list_id (Optional[int] = None): Cancel order list by orderListId
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[OrderListStatusResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        params = {
            **({"id": id} if id is not None else {}),
            **(
                {"orig_client_order_id": orig_client_order_id}
                if orig_client_order_id is not None
                else {}
            ),
            **({"order_list_id": order_list_id} if order_list_id is not None else {}),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/orderList.status".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=OrderListStatusResponse, signer=self.signer
        )

    async def order_status(
        self,
        symbol: Union[str, None],
        id: Optional[str] = None,
        order_id: Optional[int] = None,
        orig_client_order_id: Optional[str] = None,
        recv_window: Optional[float] = None,
    ) -> WebsocketApiResponse[OrderStatusResponse]:
        """
            WebSocket Query order
            /order.status
            https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#query-order-user_data

            Check execution status of an order.
        Weight: 4

            Args:
                    symbol (Union[str, None]):
                    id (Optional[str] = None): Unique WebSocket request ID.
                    order_id (Optional[int] = None): `orderId`or`origClientOrderId`mustbesent
                    orig_client_order_id (Optional[str] = None): `orderId`or`origClientOrderId`mustbesent
                    recv_window (Optional[float] = None): The value cannot be greater than `60000`. <br> Supports up to three decimal places of precision (e.g., 6000.346) so that microseconds may be specified.

            Returns:
                WebsocketApiResponse[OrderStatusResponse]

            Raises:
                RequiredError: If a required parameter is missing.

        """

        if symbol is None:
            raise RequiredError(
                field="symbol", error_message="Missing required parameter 'symbol'"
            )

        params = {
            "symbol": symbol,
            **({"id": id} if id is not None else {}),
            **({"order_id": order_id} if order_id is not None else {}),
            **(
                {"orig_client_order_id": orig_client_order_id}
                if orig_client_order_id is not None
                else {}
            ),
            **({"recv_window": recv_window} if recv_window is not None else {}),
        }

        payload = {
            "method": "/order.status".replace("/", "", 1),
            "params": params,
        }

        return await self.websocket_api.send_signed_message(
            payload=payload, response_model=OrderStatusResponse, signer=self.signer
        )
