/*
 * Binance Sub Account REST API
 *
 * OpenAPI Specification for the Binance Sub Account REST API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

#![allow(unused_imports)]
use http::Method;
use serde::de::DeserializeOwned;
use serde_json::Value;
use std::collections::BTreeMap;

use crate::common::{config::ConfigurationRestApi, models::RestApiResponse, utils::send_request};

mod apis;
mod models;

pub use apis::*;
pub use models::*;

#[derive(Debug, Clone)]
pub struct RestApi {
    configuration: ConfigurationRestApi,
    account_management_api_client: AccountManagementApiClient,
    api_management_api_client: ApiManagementApiClient,
    asset_management_api_client: AssetManagementApiClient,
    managed_sub_account_api_client: ManagedSubAccountApiClient,
}

impl RestApi {
    pub fn new(configuration: ConfigurationRestApi) -> Self {
        let account_management_api_client = AccountManagementApiClient::new(configuration.clone());
        let api_management_api_client = ApiManagementApiClient::new(configuration.clone());
        let asset_management_api_client = AssetManagementApiClient::new(configuration.clone());
        let managed_sub_account_api_client = ManagedSubAccountApiClient::new(configuration.clone());

        Self {
            configuration,
            account_management_api_client,
            api_management_api_client,
            asset_management_api_client,
            managed_sub_account_api_client,
        }
    }

    /// Send an unsigned request to the API
    ///
    /// # Arguments
    ///
    /// * `endpoint` - The API endpoint to send the request to
    /// * `method` - The HTTP method to use for the request
    /// * `query_params` - A map of query parameters to send with the request
    /// * `body_params` - A map of body parameters to send with the request
    ///
    /// # Returns
    ///
    /// A `RestApiResponse` containing the deserialized response data on success, or an error if the request fails
    ///
    /// # Errors
    ///
    /// Returns an `anyhow::Error` if the HTTP request fails or if parsing the response fails
    pub async fn send_request<R: DeserializeOwned + Send + 'static>(
        &self,
        endpoint: &str,
        method: Method,
        query_params: BTreeMap<String, Value>,
        body_params: BTreeMap<String, Value>,
    ) -> anyhow::Result<RestApiResponse<R>> {
        send_request::<R>(
            &self.configuration,
            endpoint,
            method,
            query_params,
            body_params,
            None,
            false,
        )
        .await
    }

    /// Send a signed request to the API
    ///
    /// # Arguments
    ///
    /// * `endpoint` - The API endpoint to send the request to
    /// * `method` - The HTTP method to use for the request
    /// * `query_params` - A map of query parameters to send with the request
    /// * `body_params` - A map of body parameters to send with the request
    ///
    /// # Returns
    ///
    /// A `RestApiResponse` containing the deserialized response data on success, or an error if the request fails
    ///
    /// # Errors
    ///
    /// Returns an `anyhow::Error` if the HTTP request fails or if parsing the response fails
    pub async fn send_signed_request<R: DeserializeOwned + Send + 'static>(
        &self,
        endpoint: &str,
        method: Method,
        query_params: BTreeMap<String, Value>,
        body_params: BTreeMap<String, Value>,
    ) -> anyhow::Result<RestApiResponse<R>> {
        send_request::<R>(
            &self.configuration,
            endpoint,
            method,
            query_params,
            body_params,
            None,
            true,
        )
        .await
    }

    /// Create a Virtual Sub-account (For Master Account) (`USER_DATA`)
    ///
    /// Create a Virtual Sub-account
    ///
    /// * This request will generate a virtual sub account under your master account.
    /// * You need to enable "trade" option for the API Key which requests this endpoint.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`CreateAVirtualSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::CreateAVirtualSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/account-management/Create-a-Virtual-Sub-account).
    ///
    pub async fn create_a_virtual_sub_account(
        &self,
        params: CreateAVirtualSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::CreateAVirtualSubAccountResponse>> {
        self.account_management_api_client
            .create_a_virtual_sub_account(params)
            .await
    }

    /// Enable Futures for Sub-account (For Master Account) (`USER_DATA`)
    ///
    /// Enable Futures for Sub-account for Master Account
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`EnableFuturesForSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::EnableFuturesForSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/account-management/Enable-Futures-for-Sub-account).
    ///
    pub async fn enable_futures_for_sub_account(
        &self,
        params: EnableFuturesForSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::EnableFuturesForSubAccountResponse>> {
        self.account_management_api_client
            .enable_futures_for_sub_account(params)
            .await
    }

    /// Enable Options for Sub-account (For Master Account) (`USER_DATA`)
    ///
    /// Enable Options for Sub-account (For Master Account).
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`EnableOptionsForSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::EnableOptionsForSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/account-management/Enable-Options-for-Sub-account).
    ///
    pub async fn enable_options_for_sub_account(
        &self,
        params: EnableOptionsForSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::EnableOptionsForSubAccountResponse>> {
        self.account_management_api_client
            .enable_options_for_sub_account(params)
            .await
    }

    /// Get Futures Position-Risk of Sub-account (For Master Account) (`USER_DATA`)
    ///
    /// Get Futures Position-Risk of Sub-account
    ///
    /// Weight: 10
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetFuturesPositionRiskOfSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<Vec<models::GetFuturesPositionRiskOfSubAccountV2ResponseFuturePositionRiskVosInner>>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/account-management/Get-Futures-Position-Risk-of-Sub-account).
    ///
    pub async fn get_futures_position_risk_of_sub_account(
        &self,
        params: GetFuturesPositionRiskOfSubAccountParams,
    ) -> anyhow::Result<
        RestApiResponse<
            Vec<models::GetFuturesPositionRiskOfSubAccountV2ResponseFuturePositionRiskVosInner>,
        >,
    > {
        self.account_management_api_client
            .get_futures_position_risk_of_sub_account(params)
            .await
    }

    /// Get Futures Position-Risk of Sub-account V2 (For Master Account) (`USER_DATA`)
    ///
    /// Get Futures Position-Risk of Sub-account V2
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetFuturesPositionRiskOfSubAccountV2Params`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetFuturesPositionRiskOfSubAccountV2Response>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/account-management/Get-Futures-Position-Risk-of-Sub-account-V2).
    ///
    pub async fn get_futures_position_risk_of_sub_account_v2(
        &self,
        params: GetFuturesPositionRiskOfSubAccountV2Params,
    ) -> anyhow::Result<RestApiResponse<models::GetFuturesPositionRiskOfSubAccountV2Response>> {
        self.account_management_api_client
            .get_futures_position_risk_of_sub_account_v2(params)
            .await
    }

    /// Get Sub-account's Status on Margin Or Futures (For Master Account) (`USER_DATA`)
    ///
    /// Get Sub-account's Status on Margin Or Futures
    ///
    /// * If no email sent, all sub-accounts' information will be returned.
    ///
    /// Weight: 10
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetSubAccountsStatusOnMarginOrFuturesParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<Vec<models::GetSubAccountsStatusOnMarginOrFuturesResponseInner>>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/account-management/Get-Sub-accounts-Status-on-Margin-Or-Futures).
    ///
    pub async fn get_sub_accounts_status_on_margin_or_futures(
        &self,
        params: GetSubAccountsStatusOnMarginOrFuturesParams,
    ) -> anyhow::Result<
        RestApiResponse<Vec<models::GetSubAccountsStatusOnMarginOrFuturesResponseInner>>,
    > {
        self.account_management_api_client
            .get_sub_accounts_status_on_margin_or_futures(params)
            .await
    }

    /// Query Sub-account List (For Master Account) (`USER_DATA`)
    ///
    /// Query Sub-account List
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`QuerySubAccountListParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QuerySubAccountListResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/account-management/Query-Sub-account-List).
    ///
    pub async fn query_sub_account_list(
        &self,
        params: QuerySubAccountListParams,
    ) -> anyhow::Result<RestApiResponse<models::QuerySubAccountListResponse>> {
        self.account_management_api_client
            .query_sub_account_list(params)
            .await
    }

    /// Query Sub-account Transaction Statistics (For Master Account) (`USER_DATA`)
    ///
    /// Query Sub-account Transaction statistics (For Master Account).
    ///
    /// Weight: 60
    ///
    /// # Arguments
    ///
    /// - `params`: [`QuerySubAccountTransactionStatisticsParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QuerySubAccountTransactionStatisticsResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/account-management/Query-Sub-account-Transaction-Statistics).
    ///
    pub async fn query_sub_account_transaction_statistics(
        &self,
        params: QuerySubAccountTransactionStatisticsParams,
    ) -> anyhow::Result<RestApiResponse<models::QuerySubAccountTransactionStatisticsResponse>> {
        self.account_management_api_client
            .query_sub_account_transaction_statistics(params)
            .await
    }

    /// Add IP Restriction for Sub-Account API key (For Master Account) (`USER_DATA`)
    ///
    /// Add IP Restriction for Sub-Account API key
    ///
    /// * You need to enable Enable Spot & Margin Trading option for the api key which requests this endpoint
    ///
    /// Weight: 3000
    ///
    /// # Arguments
    ///
    /// - `params`: [`AddIpRestrictionForSubAccountApiKeyParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::AddIpRestrictionForSubAccountApiKeyResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/api-management/Add-IP-Restriction-for-Sub-Account-API-key).
    ///
    pub async fn add_ip_restriction_for_sub_account_api_key(
        &self,
        params: AddIpRestrictionForSubAccountApiKeyParams,
    ) -> anyhow::Result<RestApiResponse<models::AddIpRestrictionForSubAccountApiKeyResponse>> {
        self.api_management_api_client
            .add_ip_restriction_for_sub_account_api_key(params)
            .await
    }

    /// Delete IP List For a Sub-account API Key (For Master Account) (`USER_DATA`)
    ///
    /// Delete IP List For a Sub-account API Key
    ///
    /// * You need to enable Enable Spot & Margin Trading option for the api key which requests this endpoint
    ///
    /// Weight: 3000
    ///
    /// # Arguments
    ///
    /// - `params`: [`DeleteIpListForASubAccountApiKeyParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::DeleteIpListForASubAccountApiKeyResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/api-management/Delete-IP-List-For-a-Sub-account-API-Key).
    ///
    pub async fn delete_ip_list_for_a_sub_account_api_key(
        &self,
        params: DeleteIpListForASubAccountApiKeyParams,
    ) -> anyhow::Result<RestApiResponse<models::DeleteIpListForASubAccountApiKeyResponse>> {
        self.api_management_api_client
            .delete_ip_list_for_a_sub_account_api_key(params)
            .await
    }

    /// Get IP Restriction for a Sub-account API Key (For Master Account) (`USER_DATA`)
    ///
    /// Get IP Restriction for a Sub-account API Key
    ///
    /// Weight: 3000
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetIpRestrictionForASubAccountApiKeyParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetIpRestrictionForASubAccountApiKeyResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/api-management/Get-IP-Restriction-for-a-Sub-account-API-Key).
    ///
    pub async fn get_ip_restriction_for_a_sub_account_api_key(
        &self,
        params: GetIpRestrictionForASubAccountApiKeyParams,
    ) -> anyhow::Result<RestApiResponse<models::GetIpRestrictionForASubAccountApiKeyResponse>> {
        self.api_management_api_client
            .get_ip_restriction_for_a_sub_account_api_key(params)
            .await
    }

    /// Futures Transfer for Sub-account (For Master Account) (`USER_DATA`)
    ///
    /// Futures Transfer for Sub-account
    ///
    /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`FuturesTransferForSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::FuturesTransferForSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Futures-Transfer-for-Sub-account).
    ///
    pub async fn futures_transfer_for_sub_account(
        &self,
        params: FuturesTransferForSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::FuturesTransferForSubAccountResponse>> {
        self.asset_management_api_client
            .futures_transfer_for_sub_account(params)
            .await
    }

    /// Get Detail on Sub-account's Futures Account (For Master Account) (`USER_DATA`)
    ///
    /// Get Detail on Sub-account's Futures Account
    ///
    /// Weight: 10
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetDetailOnSubAccountsFuturesAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetDetailOnSubAccountsFuturesAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Futures-Account).
    ///
    pub async fn get_detail_on_sub_accounts_futures_account(
        &self,
        params: GetDetailOnSubAccountsFuturesAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::GetDetailOnSubAccountsFuturesAccountResponse>> {
        self.asset_management_api_client
            .get_detail_on_sub_accounts_futures_account(params)
            .await
    }

    /// Get Detail on Sub-account's Futures Account V2 (For Master Account) (`USER_DATA`)
    ///
    /// Get Detail on Sub-account's Futures Account
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetDetailOnSubAccountsFuturesAccountV2Params`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetDetailOnSubAccountsFuturesAccountV2Response>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Futures-Account-V2).
    ///
    pub async fn get_detail_on_sub_accounts_futures_account_v2(
        &self,
        params: GetDetailOnSubAccountsFuturesAccountV2Params,
    ) -> anyhow::Result<RestApiResponse<models::GetDetailOnSubAccountsFuturesAccountV2Response>>
    {
        self.asset_management_api_client
            .get_detail_on_sub_accounts_futures_account_v2(params)
            .await
    }

    /// Get Detail on Sub-account's Margin Account (For Master Account) (`USER_DATA`)
    ///
    /// Get Detail on Sub-account's Margin Account
    ///
    /// Weight: 10
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetDetailOnSubAccountsMarginAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetDetailOnSubAccountsMarginAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Detail-on-Sub-accounts-Margin-Account).
    ///
    pub async fn get_detail_on_sub_accounts_margin_account(
        &self,
        params: GetDetailOnSubAccountsMarginAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::GetDetailOnSubAccountsMarginAccountResponse>> {
        self.asset_management_api_client
            .get_detail_on_sub_accounts_margin_account(params)
            .await
    }

    /// Get Move Position History for Sub-account (For Master Account) (`USER_DATA`)
    ///
    /// Query move position history
    ///
    /// * If `startTime` and `endTime` not sent, return records of the last 90 days by default with 1000 maximum limits
    /// * If `startTime` is sent and `endTime` is not sent, return records of [max(startTime, now-90d), now].
    /// * If `startTime` is not sent and `endTime` is sent, return records of [max(now,endTime-90d), endTime].
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetMovePositionHistoryForSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetMovePositionHistoryForSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Move-Position-History-for-Sub-account).
    ///
    pub async fn get_move_position_history_for_sub_account(
        &self,
        params: GetMovePositionHistoryForSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::GetMovePositionHistoryForSubAccountResponse>> {
        self.asset_management_api_client
            .get_move_position_history_for_sub_account(params)
            .await
    }

    /// Get Sub-account Deposit Address (For Master Account) (`USER_DATA`)
    ///
    /// Fetch sub-account deposit address
    ///
    /// * `amount` needs to be sent if using LIGHTNING network
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetSubAccountDepositAddressParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetSubAccountDepositAddressResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Sub-account-Deposit-Address).
    ///
    pub async fn get_sub_account_deposit_address(
        &self,
        params: GetSubAccountDepositAddressParams,
    ) -> anyhow::Result<RestApiResponse<models::GetSubAccountDepositAddressResponse>> {
        self.asset_management_api_client
            .get_sub_account_deposit_address(params)
            .await
    }

    /// Get Sub-account Deposit History (For Master Account) (`USER_DATA`)
    ///
    /// Fetch sub-account deposit history
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetSubAccountDepositHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<Vec<models::GetSubAccountDepositHistoryResponseInner>>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Sub-account-Deposit-History).
    ///
    pub async fn get_sub_account_deposit_history(
        &self,
        params: GetSubAccountDepositHistoryParams,
    ) -> anyhow::Result<RestApiResponse<Vec<models::GetSubAccountDepositHistoryResponseInner>>>
    {
        self.asset_management_api_client
            .get_sub_account_deposit_history(params)
            .await
    }

    /// Get Summary of Sub-account's Futures Account (For Master Account) (`USER_DATA`)
    ///
    /// Get Summary of Sub-account's Futures Account
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetSummaryOfSubAccountsFuturesAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetSummaryOfSubAccountsFuturesAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Futures-Account).
    ///
    pub async fn get_summary_of_sub_accounts_futures_account(
        &self,
        params: GetSummaryOfSubAccountsFuturesAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::GetSummaryOfSubAccountsFuturesAccountResponse>>
    {
        self.asset_management_api_client
            .get_summary_of_sub_accounts_futures_account(params)
            .await
    }

    /// Get Summary of Sub-account's Futures Account V2 (For Master Account) (`USER_DATA`)
    ///
    /// Get Summary of Sub-account's Futures Account
    ///
    /// Weight: 10
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetSummaryOfSubAccountsFuturesAccountV2Params`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetSummaryOfSubAccountsFuturesAccountV2Response>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Futures-Account-V2).
    ///
    pub async fn get_summary_of_sub_accounts_futures_account_v2(
        &self,
        params: GetSummaryOfSubAccountsFuturesAccountV2Params,
    ) -> anyhow::Result<RestApiResponse<models::GetSummaryOfSubAccountsFuturesAccountV2Response>>
    {
        self.asset_management_api_client
            .get_summary_of_sub_accounts_futures_account_v2(params)
            .await
    }

    /// Get Summary of Sub-account's Margin Account (For Master Account) (`USER_DATA`)
    ///
    /// Get Summary of Sub-account's Margin Account
    ///
    /// Weight: 10
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetSummaryOfSubAccountsMarginAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetSummaryOfSubAccountsMarginAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Get-Summary-of-Sub-accounts-Margin-Account).
    ///
    pub async fn get_summary_of_sub_accounts_margin_account(
        &self,
        params: GetSummaryOfSubAccountsMarginAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::GetSummaryOfSubAccountsMarginAccountResponse>> {
        self.asset_management_api_client
            .get_summary_of_sub_accounts_margin_account(params)
            .await
    }

    /// Margin Transfer for Sub-account (For Master Account) (`USER_DATA`)
    ///
    /// Margin Transfer for Sub-account
    ///
    /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`MarginTransferForSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::MarginTransferForSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Margin-Transfer-for-Sub-account).
    ///
    pub async fn margin_transfer_for_sub_account(
        &self,
        params: MarginTransferForSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::MarginTransferForSubAccountResponse>> {
        self.asset_management_api_client
            .margin_transfer_for_sub_account(params)
            .await
    }

    /// Move Position for Sub-account (For Master Account) (`USER_DATA`)
    ///
    /// Move position between sub-master, master-sub, or sub-sub accounts when necessary
    ///
    /// * You need to Enable Trading permission for the API Key which requests this endpoint.
    /// * This function only support VIP level 7-9.
    /// * Only master account can use the function
    /// * Quantity should be positive number only
    /// * The function support normal account, PM PRO, PM PRO SPAN and PM Retail.
    /// * Only support for from account has positions
    /// * For all orders in the same orderArgs request, if any symbol’s total close position quantity is bigger than the symbol’s current position quantity, all batch orders in the same list will fail simultaneously.
    /// * Only support cross margin mode
    /// * The price for move position is `MarkPrice` only.
    /// * Not support for MSA.
    /// * Not support for the symbol under Reduce-Only.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`MovePositionForSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::MovePositionForSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Move-Position-for-Sub-account).
    ///
    pub async fn move_position_for_sub_account(
        &self,
        params: MovePositionForSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::MovePositionForSubAccountResponse>> {
        self.asset_management_api_client
            .move_position_for_sub_account(params)
            .await
    }

    /// Query Sub-account Assets (For Master Account) (`USER_DATA`)
    ///
    /// Fetch sub-account assets
    ///
    /// Weight: 60
    ///
    /// # Arguments
    ///
    /// - `params`: [`QuerySubAccountAssetsParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QuerySubAccountAssetsResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Assets-V4).
    ///
    pub async fn query_sub_account_assets(
        &self,
        params: QuerySubAccountAssetsParams,
    ) -> anyhow::Result<RestApiResponse<models::QuerySubAccountAssetsResponse>> {
        self.asset_management_api_client
            .query_sub_account_assets(params)
            .await
    }

    /// Query Sub-account Assets (For Master Account) (`USER_DATA`)
    ///
    /// Fetch sub-account assets
    ///
    /// Weight: 60
    ///
    /// # Arguments
    ///
    /// - `params`: [`QuerySubAccountAssetsAssetManagementParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QuerySubAccountAssetsAssetManagementResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Assets-V4).
    ///
    pub async fn query_sub_account_assets_asset_management(
        &self,
        params: QuerySubAccountAssetsAssetManagementParams,
    ) -> anyhow::Result<RestApiResponse<models::QuerySubAccountAssetsAssetManagementResponse>> {
        self.asset_management_api_client
            .query_sub_account_assets_asset_management(params)
            .await
    }

    /// Query Sub-account Futures Asset Transfer History (For Master Account) (`USER_DATA`)
    ///
    /// Query Sub-account Futures Asset Transfer History
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`QuerySubAccountFuturesAssetTransferHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QuerySubAccountFuturesAssetTransferHistoryResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Futures-Asset-Transfer-History).
    ///
    pub async fn query_sub_account_futures_asset_transfer_history(
        &self,
        params: QuerySubAccountFuturesAssetTransferHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::QuerySubAccountFuturesAssetTransferHistoryResponse>>
    {
        self.asset_management_api_client
            .query_sub_account_futures_asset_transfer_history(params)
            .await
    }

    /// Query Sub-account Spot Asset Transfer History (For Master Account) (`USER_DATA`)
    ///
    /// Query Sub-account Spot Asset Transfer History
    ///
    /// * fromEmail and toEmail cannot be sent at the same time.
    /// * Return fromEmail equal master account email by default.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`QuerySubAccountSpotAssetTransferHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<Vec<models::QuerySubAccountSpotAssetTransferHistoryResponseInner>>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Spot-Asset-Transfer-History).
    ///
    pub async fn query_sub_account_spot_asset_transfer_history(
        &self,
        params: QuerySubAccountSpotAssetTransferHistoryParams,
    ) -> anyhow::Result<
        RestApiResponse<Vec<models::QuerySubAccountSpotAssetTransferHistoryResponseInner>>,
    > {
        self.asset_management_api_client
            .query_sub_account_spot_asset_transfer_history(params)
            .await
    }

    /// Query Sub-account Spot Assets Summary (For Master Account) (`USER_DATA`)
    ///
    /// Get BTC valued asset summary of subaccounts.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`QuerySubAccountSpotAssetsSummaryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QuerySubAccountSpotAssetsSummaryResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Query-Sub-account-Spot-Assets-Summary).
    ///
    pub async fn query_sub_account_spot_assets_summary(
        &self,
        params: QuerySubAccountSpotAssetsSummaryParams,
    ) -> anyhow::Result<RestApiResponse<models::QuerySubAccountSpotAssetsSummaryResponse>> {
        self.asset_management_api_client
            .query_sub_account_spot_assets_summary(params)
            .await
    }

    /// Query Universal Transfer History (For Master Account) (`USER_DATA`)
    ///
    /// Query Universal Transfer History
    ///
    /// * fromEmail and toEmail cannot be sent at the same time.
    /// * Return fromEmail equal master account email by default.
    /// * The query time period must be less than 7 days.
    /// * If startTime and endTime not sent, return records of the last 7 days by default.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryUniversalTransferHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QueryUniversalTransferHistoryResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Query-Universal-Transfer-History).
    ///
    pub async fn query_universal_transfer_history(
        &self,
        params: QueryUniversalTransferHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::QueryUniversalTransferHistoryResponse>> {
        self.asset_management_api_client
            .query_universal_transfer_history(params)
            .await
    }

    /// Sub-account Futures Asset Transfer (For Master Account) (`USER_DATA`)
    ///
    /// Sub-account Futures Asset Transfer
    ///
    ///
    /// * Master account can transfer max 2000 times a minute
    /// * There must be sufficient margin balance in futures wallet to execute transferring.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`SubAccountFuturesAssetTransferParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SubAccountFuturesAssetTransferResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Sub-account-Futures-Asset-Transfer).
    ///
    pub async fn sub_account_futures_asset_transfer(
        &self,
        params: SubAccountFuturesAssetTransferParams,
    ) -> anyhow::Result<RestApiResponse<models::SubAccountFuturesAssetTransferResponse>> {
        self.asset_management_api_client
            .sub_account_futures_asset_transfer(params)
            .await
    }

    /// Sub-account Transfer History (For Sub-account) (`USER_DATA`)
    ///
    /// Sub-account Transfer History
    ///
    /// * If type is not sent, the records of type 2: transfer out will be returned by default.
    /// * If startTime and endTime are not sent, the recent 30-day data will be returned.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`SubAccountTransferHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<Vec<models::SubAccountTransferHistoryResponseInner>>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Sub-account-Transfer-History).
    ///
    pub async fn sub_account_transfer_history(
        &self,
        params: SubAccountTransferHistoryParams,
    ) -> anyhow::Result<RestApiResponse<Vec<models::SubAccountTransferHistoryResponseInner>>> {
        self.asset_management_api_client
            .sub_account_transfer_history(params)
            .await
    }

    /// Transfer to Master (For Sub-account) (`USER_DATA`)
    ///
    /// Transfer to Master
    ///
    /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`TransferToMasterParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::TransferToMasterResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Transfer-to-Master).
    ///
    pub async fn transfer_to_master(
        &self,
        params: TransferToMasterParams,
    ) -> anyhow::Result<RestApiResponse<models::TransferToMasterResponse>> {
        self.asset_management_api_client
            .transfer_to_master(params)
            .await
    }

    /// Transfer to Sub-account of Same Master (For Sub-account) (`USER_DATA`)
    ///
    /// Transfer to Sub-account of Same Master
    ///
    /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`TransferToSubAccountOfSameMasterParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::TransferToSubAccountOfSameMasterResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Transfer-to-Sub-account-of-Same-Master).
    ///
    pub async fn transfer_to_sub_account_of_same_master(
        &self,
        params: TransferToSubAccountOfSameMasterParams,
    ) -> anyhow::Result<RestApiResponse<models::TransferToSubAccountOfSameMasterResponse>> {
        self.asset_management_api_client
            .transfer_to_sub_account_of_same_master(params)
            .await
    }

    /// Universal Transfer (For Master Account) (`USER_DATA`)
    ///
    /// Universal Transfer
    ///
    /// * You need to enable "internal transfer" option for the api key which requests this endpoint.
    /// * Transfer from master account by default if fromEmail is not sent.
    /// * Transfer to master account by default if toEmail is not sent.
    /// * At least either fromEmail or toEmail need to be sent when the fromAccountType and the toAccountType are the same.
    /// * Supported transfer scenarios:
    /// * `SPOT` transfer to `SPOT`, `USDT_FUTURE`, `COIN_FUTURE` (regardless of master or sub)
    /// * `SPOT`, `USDT_FUTURE`, `COIN_FUTURE` transfer to `SPOT`  (regardless of master or sub)
    /// * Master account `SPOT` transfer to sub-account `MARGIN(Cross)`, `ISOLATED_MARGIN`
    /// * Sub-account `MARGIN(Cross)`, `ISOLATED_MARGIN` transfer to master account `SPOT`
    /// * Sub-account `MARGIN(Cross)` transfer to Sub-account `MARGIN(Cross)`
    /// * `ALPHA` to `ALPHA`  (regardless of master or sub)
    ///
    /// Weight: 360
    ///
    /// # Arguments
    ///
    /// - `params`: [`UniversalTransferParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::UniversalTransferResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/asset-management/Universal-Transfer).
    ///
    pub async fn universal_transfer(
        &self,
        params: UniversalTransferParams,
    ) -> anyhow::Result<RestApiResponse<models::UniversalTransferResponse>> {
        self.asset_management_api_client
            .universal_transfer(params)
            .await
    }

    /// Deposit Assets Into The Managed Sub-account (For Investor Master Account) (`USER_DATA`)
    ///
    /// Deposit Assets Into The Managed Sub-account
    ///
    /// * You need to enable `Enable Spot & Margin Trading` option for the api key which requests this endpoint
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`DepositAssetsIntoTheManagedSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::DepositAssetsIntoTheManagedSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Deposit-Assets-Into-The-Managed-Sub-account).
    ///
    pub async fn deposit_assets_into_the_managed_sub_account(
        &self,
        params: DepositAssetsIntoTheManagedSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::DepositAssetsIntoTheManagedSubAccountResponse>>
    {
        self.managed_sub_account_api_client
            .deposit_assets_into_the_managed_sub_account(params)
            .await
    }

    /// Get Managed Sub-account Deposit Address (For Investor Master Account) (`USER_DATA`)
    ///
    /// Get investor's managed sub-account deposit address.
    ///
    /// * If `network` is not send, return with default `network` of the `coin`.
    /// * * `amount` needs to be sent if using LIGHTNING network
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetManagedSubAccountDepositAddressParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetManagedSubAccountDepositAddressResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Get-Managed-Sub-account-Deposit-Address).
    ///
    pub async fn get_managed_sub_account_deposit_address(
        &self,
        params: GetManagedSubAccountDepositAddressParams,
    ) -> anyhow::Result<RestApiResponse<models::GetManagedSubAccountDepositAddressResponse>> {
        self.managed_sub_account_api_client
            .get_managed_sub_account_deposit_address(params)
            .await
    }

    /// Query Managed Sub-account Asset Details (For Investor Master Account) (`USER_DATA`)
    ///
    /// Query Managed Sub-account Asset Details
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryManagedSubAccountAssetDetailsParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<Vec<models::QueryManagedSubAccountAssetDetailsResponseInner>>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Asset-Details).
    ///
    pub async fn query_managed_sub_account_asset_details(
        &self,
        params: QueryManagedSubAccountAssetDetailsParams,
    ) -> anyhow::Result<RestApiResponse<Vec<models::QueryManagedSubAccountAssetDetailsResponseInner>>>
    {
        self.managed_sub_account_api_client
            .query_managed_sub_account_asset_details(params)
            .await
    }

    /// Query Managed Sub-account Futures Asset Details (For Investor Master Account) (`USER_DATA`)
    ///
    /// Investor can use this api to query managed sub account futures asset details
    ///
    /// Weight: 60
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryManagedSubAccountFuturesAssetDetailsParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QueryManagedSubAccountFuturesAssetDetailsResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Futures-Asset-Details).
    ///
    pub async fn query_managed_sub_account_futures_asset_details(
        &self,
        params: QueryManagedSubAccountFuturesAssetDetailsParams,
    ) -> anyhow::Result<RestApiResponse<models::QueryManagedSubAccountFuturesAssetDetailsResponse>>
    {
        self.managed_sub_account_api_client
            .query_managed_sub_account_futures_asset_details(params)
            .await
    }

    /// Query Managed Sub-account List (For Investor) (`USER_DATA`)
    ///
    /// Get investor's managed sub-account list.
    ///
    /// Weight: 60
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryManagedSubAccountListParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QueryManagedSubAccountListResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-List).
    ///
    pub async fn query_managed_sub_account_list(
        &self,
        params: QueryManagedSubAccountListParams,
    ) -> anyhow::Result<RestApiResponse<models::QueryManagedSubAccountListResponse>> {
        self.managed_sub_account_api_client
            .query_managed_sub_account_list(params)
            .await
    }

    /// Query Managed Sub-account Margin Asset Details (For Investor Master Account) (`USER_DATA`)
    ///
    /// Investor can use this api to query managed sub account margin asset details
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryManagedSubAccountMarginAssetDetailsParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QueryManagedSubAccountMarginAssetDetailsResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Margin-Asset-Details).
    ///
    pub async fn query_managed_sub_account_margin_asset_details(
        &self,
        params: QueryManagedSubAccountMarginAssetDetailsParams,
    ) -> anyhow::Result<RestApiResponse<models::QueryManagedSubAccountMarginAssetDetailsResponse>>
    {
        self.managed_sub_account_api_client
            .query_managed_sub_account_margin_asset_details(params)
            .await
    }

    /// Query Managed Sub-account Snapshot (For Investor Master Account) (`USER_DATA`)
    ///
    /// Query Managed Sub-account Snapshot
    ///
    /// * The query time period must be less then 30 days
    /// * Support query within the last one month only
    /// * If startTimeand endTime not sent, return records of the last 7 days by default
    ///
    /// Weight: 2400
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryManagedSubAccountSnapshotParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QueryManagedSubAccountSnapshotResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-account-Snapshot).
    ///
    pub async fn query_managed_sub_account_snapshot(
        &self,
        params: QueryManagedSubAccountSnapshotParams,
    ) -> anyhow::Result<RestApiResponse<models::QueryManagedSubAccountSnapshotResponse>> {
        self.managed_sub_account_api_client
            .query_managed_sub_account_snapshot(params)
            .await
    }

    /// Query Managed Sub Account Transfer Log (For Investor Master Account) (`USER_DATA`)
    ///
    /// Investor can use this api to query managed sub account transfer log. This endpoint is available for investor of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team.
    /// Please refer to [link](https://www.binance.com/en/support/faq/how-to-get-started-with-managed-sub-account-functions-and-frequently-asked-questions-0594748722704383a7c369046e489459)
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryManagedSubAccountTransferLogMasterAccountInvestorParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QueryManagedSubAccountTransferLogMasterAccountInvestorResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-Account-Transfer-Log-Investor).
    ///
    pub async fn query_managed_sub_account_transfer_log_master_account_investor(
        &self,
        params: QueryManagedSubAccountTransferLogMasterAccountInvestorParams,
    ) -> anyhow::Result<
        RestApiResponse<models::QueryManagedSubAccountTransferLogMasterAccountInvestorResponse>,
    > {
        self.managed_sub_account_api_client
            .query_managed_sub_account_transfer_log_master_account_investor(params)
            .await
    }

    /// Query Managed Sub Account Transfer Log (For Trading Team Master Account) (`USER_DATA`)
    ///
    /// Trading team can use this api to query managed sub account transfer log. This endpoint is available for trading team of Managed Sub-Account. A Managed Sub-Account is an account type for investors who value flexibility in asset allocation and account application, while delegating trades to a professional trading team.
    /// Please refer to [link](https://www.binance.com/en/support/faq/how-to-get-started-with-managed-sub-account-functions-and-frequently-asked-questions-0594748722704383a7c369046e489459)
    ///
    /// Weight: 60
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryManagedSubAccountTransferLogMasterAccountTradingParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QueryManagedSubAccountTransferLogMasterAccountTradingResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-Account-Transfer-Log-Trading-Team-Master).
    ///
    pub async fn query_managed_sub_account_transfer_log_master_account_trading(
        &self,
        params: QueryManagedSubAccountTransferLogMasterAccountTradingParams,
    ) -> anyhow::Result<
        RestApiResponse<models::QueryManagedSubAccountTransferLogMasterAccountTradingResponse>,
    > {
        self.managed_sub_account_api_client
            .query_managed_sub_account_transfer_log_master_account_trading(params)
            .await
    }

    /// Query Managed Sub Account Transfer Log (For Trading Team Sub Account) (`USER_DATA`)
    ///
    /// Query Managed Sub Account Transfer Log (For Trading Team Sub Account)
    ///
    /// Weight: 60
    ///
    /// # Arguments
    ///
    /// - `params`: [`QueryManagedSubAccountTransferLogSubAccountTradingParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::QueryManagedSubAccountTransferLogSubAccountTradingResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Query-Managed-Sub-Account-Transfer-Log-Trading-Team-Sub).
    ///
    pub async fn query_managed_sub_account_transfer_log_sub_account_trading(
        &self,
        params: QueryManagedSubAccountTransferLogSubAccountTradingParams,
    ) -> anyhow::Result<
        RestApiResponse<models::QueryManagedSubAccountTransferLogSubAccountTradingResponse>,
    > {
        self.managed_sub_account_api_client
            .query_managed_sub_account_transfer_log_sub_account_trading(params)
            .await
    }

    /// Withdrawl Assets From The Managed Sub-account (For Investor Master Account) (`USER_DATA`)
    ///
    /// Withdrawl Assets From The Managed Sub-account
    ///
    /// * You need to enable `Enable Spot & Margin Trading` option for the api key which requests this endpoint
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`WithdrawlAssetsFromTheManagedSubAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::WithdrawlAssetsFromTheManagedSubAccountResponse>`] on success.
    ///
    /// # Errors
    ///
    /// This function will return an [`anyhow::Error`] if:
    /// - the HTTP request fails
    /// - any parameter is invalid
    /// - the response cannot be parsed
    /// - or one of the following occurs:
    ///   - `RequiredError`
    ///   - `ConnectorClientError`
    ///   - `UnauthorizedError`
    ///   - `ForbiddenError`
    ///   - `TooManyRequestsError`
    ///   - `RateLimitBanError`
    ///   - `ServerError`
    ///   - `NotFoundError`
    ///   - `NetworkError`
    ///   - `BadRequestError`
    ///
    ///
    /// For full API details, see the [Binance API Documentation](https://developers.binance.com/docs/sub_account/managed-sub-account/Withdrawl-Assets-From-The-Managed-Sub-account).
    ///
    pub async fn withdrawl_assets_from_the_managed_sub_account(
        &self,
        params: WithdrawlAssetsFromTheManagedSubAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::WithdrawlAssetsFromTheManagedSubAccountResponse>>
    {
        self.managed_sub_account_api_client
            .withdrawl_assets_from_the_managed_sub_account(params)
            .await
    }
}
