/*
 * Binance Simple Earn REST API
 *
 * OpenAPI Specification for the Binance Simple Earn 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,
    bfusd_api_client: BfusdApiClient,
    flexible_locked_api_client: FlexibleLockedApiClient,
    rwusd_api_client: RwusdApiClient,
}

impl RestApi {
    pub fn new(configuration: ConfigurationRestApi) -> Self {
        let bfusd_api_client = BfusdApiClient::new(configuration.clone());
        let flexible_locked_api_client = FlexibleLockedApiClient::new(configuration.clone());
        let rwusd_api_client = RwusdApiClient::new(configuration.clone());

        Self {
            configuration,
            bfusd_api_client,
            flexible_locked_api_client,
            rwusd_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
    }

    /// Get BFUSD Account (`USER_DATA`)
    ///
    /// Get BFUSD account information.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetBfusdAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetBfusdAccountResponse>`] 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/simple_earn/bfusd/account/).
    ///
    pub async fn get_bfusd_account(
        &self,
        params: GetBfusdAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::GetBfusdAccountResponse>> {
        self.bfusd_api_client.get_bfusd_account(params).await
    }

    /// Get BFUSD Quota Details (`USER_DATA`)
    ///
    /// Get BFUSD quota details including subscription quota, fast redemption quota and standard redemption quota.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetBfusdQuotaDetailsParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetBfusdQuotaDetailsResponse>`] 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/simple_earn/bfusd/account/Get-BFUSD-Quota-Details).
    ///
    pub async fn get_bfusd_quota_details(
        &self,
        params: GetBfusdQuotaDetailsParams,
    ) -> anyhow::Result<RestApiResponse<models::GetBfusdQuotaDetailsResponse>> {
        self.bfusd_api_client.get_bfusd_quota_details(params).await
    }

    /// Get BFUSD Rate History (`USER_DATA`)
    ///
    /// Get BFUSD rate history sorted by descending order.
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetBfusdRateHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetBfusdRateHistoryResponse>`] 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/simple_earn/bfusd/history/Get-BFUSD-Rate-History).
    ///
    pub async fn get_bfusd_rate_history(
        &self,
        params: GetBfusdRateHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetBfusdRateHistoryResponse>> {
        self.bfusd_api_client.get_bfusd_rate_history(params).await
    }

    /// Get BFUSD Redemption History (`USER_DATA`)
    ///
    /// Get BFUSD redemption history.
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetBfusdRedemptionHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetBfusdRedemptionHistoryResponse>`] 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/simple_earn/bfusd/history/Get-BFUSD-Redemption-History).
    ///
    pub async fn get_bfusd_redemption_history(
        &self,
        params: GetBfusdRedemptionHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetBfusdRedemptionHistoryResponse>> {
        self.bfusd_api_client
            .get_bfusd_redemption_history(params)
            .await
    }

    /// Get BFUSD Rewards History (`USER_DATA`)
    ///
    /// Get BFUSD rewards history.
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetBfusdRewardsHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetBfusdRewardsHistoryResponse>`] 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/simple_earn/bfusd/history/Get-BFUSD-Rewards-History).
    ///
    pub async fn get_bfusd_rewards_history(
        &self,
        params: GetBfusdRewardsHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetBfusdRewardsHistoryResponse>> {
        self.bfusd_api_client
            .get_bfusd_rewards_history(params)
            .await
    }

    /// Get BFUSD subscription `history(USER_DATA)`
    ///
    /// Get BFUSD subscription history
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time advanced by one month, and data between `startTime` and `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetBfusdSubscriptionHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetBfusdSubscriptionHistoryResponse>`] 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/simple_earn/bfusd/history/Get-BFUSD-subscription-history).
    ///
    pub async fn get_bfusd_subscription_history(
        &self,
        params: GetBfusdSubscriptionHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetBfusdSubscriptionHistoryResponse>> {
        self.bfusd_api_client
            .get_bfusd_subscription_history(params)
            .await
    }

    /// Redeem BFUSD(TRADE)
    ///
    /// Redeem BFUSD to USDT
    ///
    /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`RedeemBfusdParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::RedeemBfusdResponse>`] 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/simple_earn/bfusd/earn/Redeem-BFUSD).
    ///
    pub async fn redeem_bfusd(
        &self,
        params: RedeemBfusdParams,
    ) -> anyhow::Result<RestApiResponse<models::RedeemBfusdResponse>> {
        self.bfusd_api_client.redeem_bfusd(params).await
    }

    /// Subscribe BFUSD(TRADE)
    ///
    /// Subscribe BFUSD
    ///
    /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`SubscribeBfusdParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SubscribeBfusdResponse>`] 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/simple_earn/bfusd/earn/Subscribe-BFUSD).
    ///
    pub async fn subscribe_bfusd(
        &self,
        params: SubscribeBfusdParams,
    ) -> anyhow::Result<RestApiResponse<models::SubscribeBfusdResponse>> {
        self.bfusd_api_client.subscribe_bfusd(params).await
    }

    /// Get Collateral `Record(USER_DATA)`
    ///
    /// Get Collateral Record
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetCollateralRecordParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetCollateralRecordResponse>`] 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/simple_earn/flexible-locked/history/Get-Collateral-Record).
    ///
    pub async fn get_collateral_record(
        &self,
        params: GetCollateralRecordParams,
    ) -> anyhow::Result<RestApiResponse<models::GetCollateralRecordResponse>> {
        self.flexible_locked_api_client
            .get_collateral_record(params)
            .await
    }

    /// Get Flexible Personal Left `Quota(USER_DATA)`
    ///
    /// Get Flexible Personal Left Quota
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetFlexiblePersonalLeftQuotaParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetFlexiblePersonalLeftQuotaResponse>`] 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/simple_earn/flexible-locked/account/Get-Flexible-Personal-Left-Quota).
    ///
    pub async fn get_flexible_personal_left_quota(
        &self,
        params: GetFlexiblePersonalLeftQuotaParams,
    ) -> anyhow::Result<RestApiResponse<models::GetFlexiblePersonalLeftQuotaResponse>> {
        self.flexible_locked_api_client
            .get_flexible_personal_left_quota(params)
            .await
    }

    /// Get Flexible Product `Position(USER_DATA)`
    ///
    /// Get Flexible Product Position
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetFlexibleProductPositionParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetFlexibleProductPositionResponse>`] 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/simple_earn/flexible-locked/account/Get-Flexible-Product-Position).
    ///
    pub async fn get_flexible_product_position(
        &self,
        params: GetFlexibleProductPositionParams,
    ) -> anyhow::Result<RestApiResponse<models::GetFlexibleProductPositionResponse>> {
        self.flexible_locked_api_client
            .get_flexible_product_position(params)
            .await
    }

    /// Get Flexible Redemption `Record(USER_DATA)`
    ///
    /// Get Flexible Redemption Record
    ///
    /// *	The time between `startTime` and `endTime` cannot be longer than 30 days.
    /// *	If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// *	If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
    /// *	If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetFlexibleRedemptionRecordParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetFlexibleRedemptionRecordResponse>`] 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/simple_earn/flexible-locked/history/Get-Flexible-Redemption-Record).
    ///
    pub async fn get_flexible_redemption_record(
        &self,
        params: GetFlexibleRedemptionRecordParams,
    ) -> anyhow::Result<RestApiResponse<models::GetFlexibleRedemptionRecordResponse>> {
        self.flexible_locked_api_client
            .get_flexible_redemption_record(params)
            .await
    }

    /// Get Flexible Rewards `History(USER_DATA)`
    ///
    /// Get Flexible Rewards History
    ///
    /// *	The time between `startTime` and `endTime` cannot be longer than 30 days.
    /// *	If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// *	If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
    /// *	If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetFlexibleRewardsHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetFlexibleRewardsHistoryResponse>`] 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/simple_earn/flexible-locked/history/Get-Flexible-Rewards-History).
    ///
    pub async fn get_flexible_rewards_history(
        &self,
        params: GetFlexibleRewardsHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetFlexibleRewardsHistoryResponse>> {
        self.flexible_locked_api_client
            .get_flexible_rewards_history(params)
            .await
    }

    /// Get Flexible Subscription `Preview(USER_DATA)`
    ///
    /// Get Flexible Subscription Preview
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetFlexibleSubscriptionPreviewParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetFlexibleSubscriptionPreviewResponse>`] 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/simple_earn/flexible-locked/earn/Get-Flexible-Subscription-Preview).
    ///
    pub async fn get_flexible_subscription_preview(
        &self,
        params: GetFlexibleSubscriptionPreviewParams,
    ) -> anyhow::Result<RestApiResponse<models::GetFlexibleSubscriptionPreviewResponse>> {
        self.flexible_locked_api_client
            .get_flexible_subscription_preview(params)
            .await
    }

    /// Get Flexible Subscription `Record(USER_DATA)`
    ///
    /// Get Flexible Subscription Record
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetFlexibleSubscriptionRecordParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetFlexibleSubscriptionRecordResponse>`] 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/simple_earn/flexible-locked/history/Get-Flexible-Subscription-Record).
    ///
    pub async fn get_flexible_subscription_record(
        &self,
        params: GetFlexibleSubscriptionRecordParams,
    ) -> anyhow::Result<RestApiResponse<models::GetFlexibleSubscriptionRecordResponse>> {
        self.flexible_locked_api_client
            .get_flexible_subscription_record(params)
            .await
    }

    /// Get Locked Personal Left `Quota(USER_DATA)`
    ///
    /// Get Locked Personal Left Quota
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetLockedPersonalLeftQuotaParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetLockedPersonalLeftQuotaResponse>`] 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/simple_earn/flexible-locked/account/Get-Locked-Personal-Left-Quota).
    ///
    pub async fn get_locked_personal_left_quota(
        &self,
        params: GetLockedPersonalLeftQuotaParams,
    ) -> anyhow::Result<RestApiResponse<models::GetLockedPersonalLeftQuotaResponse>> {
        self.flexible_locked_api_client
            .get_locked_personal_left_quota(params)
            .await
    }

    /// Get Locked Product Position
    ///
    /// Get Locked Product Position
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetLockedProductPositionParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetLockedProductPositionResponse>`] 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/simple_earn/flexible-locked/account/Get-Locked-Product-Position).
    ///
    pub async fn get_locked_product_position(
        &self,
        params: GetLockedProductPositionParams,
    ) -> anyhow::Result<RestApiResponse<models::GetLockedProductPositionResponse>> {
        self.flexible_locked_api_client
            .get_locked_product_position(params)
            .await
    }

    /// Get Locked Redemption `Record(USER_DATA)`
    ///
    /// Get Locked Redemption Record
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetLockedRedemptionRecordParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetLockedRedemptionRecordResponse>`] 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/simple_earn/flexible-locked/history/Get-Locked-Redemption-Record).
    ///
    pub async fn get_locked_redemption_record(
        &self,
        params: GetLockedRedemptionRecordParams,
    ) -> anyhow::Result<RestApiResponse<models::GetLockedRedemptionRecordResponse>> {
        self.flexible_locked_api_client
            .get_locked_redemption_record(params)
            .await
    }

    /// Get Locked Rewards `History(USER_DATA)`
    ///
    /// Get Locked Rewards History
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetLockedRewardsHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetLockedRewardsHistoryResponse>`] 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/simple_earn/flexible-locked/history/Get-Locked-Rewards-History).
    ///
    pub async fn get_locked_rewards_history(
        &self,
        params: GetLockedRewardsHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetLockedRewardsHistoryResponse>> {
        self.flexible_locked_api_client
            .get_locked_rewards_history(params)
            .await
    }

    /// Get Locked Subscription `Preview(USER_DATA)`
    ///
    /// Get Locked Subscription Preview
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetLockedSubscriptionPreviewParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<Vec<models::GetLockedSubscriptionPreviewResponseInner>>`] 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/simple_earn/flexible-locked/earn/Get-Locked-Subscription-Preview).
    ///
    pub async fn get_locked_subscription_preview(
        &self,
        params: GetLockedSubscriptionPreviewParams,
    ) -> anyhow::Result<RestApiResponse<Vec<models::GetLockedSubscriptionPreviewResponseInner>>>
    {
        self.flexible_locked_api_client
            .get_locked_subscription_preview(params)
            .await
    }

    /// Get Locked Subscription `Record(USER_DATA)`
    ///
    /// Get Locked Subscription Record
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 30 days.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetLockedSubscriptionRecordParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetLockedSubscriptionRecordResponse>`] 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/simple_earn/flexible-locked/history/Get-Locked-Subscription-Record).
    ///
    pub async fn get_locked_subscription_record(
        &self,
        params: GetLockedSubscriptionRecordParams,
    ) -> anyhow::Result<RestApiResponse<models::GetLockedSubscriptionRecordResponse>> {
        self.flexible_locked_api_client
            .get_locked_subscription_record(params)
            .await
    }

    /// Get Rate `History(USER_DATA)`
    ///
    /// Get Rate History
    ///
    /// * The time between startTime and endTime cannot be longer than 1 year.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, the next 30 days' data beginning from `startTime` will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, the 30 days' data before `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetRateHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetRateHistoryResponse>`] 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/simple_earn/flexible-locked/history/Get-Rate-History).
    ///
    pub async fn get_rate_history(
        &self,
        params: GetRateHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetRateHistoryResponse>> {
        self.flexible_locked_api_client
            .get_rate_history(params)
            .await
    }

    /// Get Simple Earn Flexible Product `List(USER_DATA)`
    ///
    /// Get available Simple Earn flexible product list
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetSimpleEarnFlexibleProductListParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetSimpleEarnFlexibleProductListResponse>`] 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/simple_earn/flexible-locked/account/Get-Simple-Earn-Flexible-Product-List).
    ///
    pub async fn get_simple_earn_flexible_product_list(
        &self,
        params: GetSimpleEarnFlexibleProductListParams,
    ) -> anyhow::Result<RestApiResponse<models::GetSimpleEarnFlexibleProductListResponse>> {
        self.flexible_locked_api_client
            .get_simple_earn_flexible_product_list(params)
            .await
    }

    /// Get Simple Earn Locked Product `List(USER_DATA)`
    ///
    /// Get Simple Earn Locked Product List
    ///
    /// * Get available Simple Earn locked product list
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetSimpleEarnLockedProductListParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetSimpleEarnLockedProductListResponse>`] 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/simple_earn/flexible-locked/account/Get-Simple-Earn-Locked-Product-List).
    ///
    pub async fn get_simple_earn_locked_product_list(
        &self,
        params: GetSimpleEarnLockedProductListParams,
    ) -> anyhow::Result<RestApiResponse<models::GetSimpleEarnLockedProductListResponse>> {
        self.flexible_locked_api_client
            .get_simple_earn_locked_product_list(params)
            .await
    }

    /// Redeem Flexible Product(TRADE)
    ///
    /// Redeem Flexible Product
    ///
    /// * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`RedeemFlexibleProductParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::RedeemFlexibleProductResponse>`] 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/simple_earn/flexible-locked/earn/Redeem-Flexible-Product).
    ///
    pub async fn redeem_flexible_product(
        &self,
        params: RedeemFlexibleProductParams,
    ) -> anyhow::Result<RestApiResponse<models::RedeemFlexibleProductResponse>> {
        self.flexible_locked_api_client
            .redeem_flexible_product(params)
            .await
    }

    /// Redeem Locked Product(TRADE)
    ///
    /// Redeem Locked Product
    ///
    /// * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
    ///
    /// Weight: 1/3s per account
    ///
    /// # Arguments
    ///
    /// - `params`: [`RedeemLockedProductParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::RedeemLockedProductResponse>`] 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/simple_earn/flexible-locked/earn/Redeem-Locked-Product).
    ///
    pub async fn redeem_locked_product(
        &self,
        params: RedeemLockedProductParams,
    ) -> anyhow::Result<RestApiResponse<models::RedeemLockedProductResponse>> {
        self.flexible_locked_api_client
            .redeem_locked_product(params)
            .await
    }

    /// Set Flexible Auto `Subscribe(USER_DATA)`
    ///
    /// Set Flexible Auto Subscribe
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`SetFlexibleAutoSubscribeParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SetFlexibleAutoSubscribeResponse>`] 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/simple_earn/flexible-locked/earn/Set-Flexible-Auto-Subscribe).
    ///
    pub async fn set_flexible_auto_subscribe(
        &self,
        params: SetFlexibleAutoSubscribeParams,
    ) -> anyhow::Result<RestApiResponse<models::SetFlexibleAutoSubscribeResponse>> {
        self.flexible_locked_api_client
            .set_flexible_auto_subscribe(params)
            .await
    }

    /// Set Locked Auto `Subscribe(USER_DATA)`
    ///
    /// Set locked auto subscribe
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`SetLockedAutoSubscribeParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SetLockedAutoSubscribeResponse>`] 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/simple_earn/flexible-locked/earn/Set-Locked-Auto-Subscribe).
    ///
    pub async fn set_locked_auto_subscribe(
        &self,
        params: SetLockedAutoSubscribeParams,
    ) -> anyhow::Result<RestApiResponse<models::SetLockedAutoSubscribeResponse>> {
        self.flexible_locked_api_client
            .set_locked_auto_subscribe(params)
            .await
    }

    /// Set Locked Product Redeem `Option(USER_DATA)`
    ///
    /// Set redeem option for Locked product
    ///
    /// Weight: 50
    ///
    /// # Arguments
    ///
    /// - `params`: [`SetLockedProductRedeemOptionParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SetLockedProductRedeemOptionResponse>`] 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/simple_earn/flexible-locked/earn/Set-Locked-Redeem-Option).
    ///
    pub async fn set_locked_product_redeem_option(
        &self,
        params: SetLockedProductRedeemOptionParams,
    ) -> anyhow::Result<RestApiResponse<models::SetLockedProductRedeemOptionResponse>> {
        self.flexible_locked_api_client
            .set_locked_product_redeem_option(params)
            .await
    }

    /// Simple `Account(USER_DATA)`
    ///
    /// Simple Account query
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`SimpleAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SimpleAccountResponse>`] 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/simple_earn/flexible-locked/account/Simple-Account).
    ///
    pub async fn simple_account(
        &self,
        params: SimpleAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::SimpleAccountResponse>> {
        self.flexible_locked_api_client.simple_account(params).await
    }

    /// Subscribe Flexible Product(TRADE)
    ///
    /// Subscribe Flexible Product
    ///
    /// * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`SubscribeFlexibleProductParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SubscribeFlexibleProductResponse>`] 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/simple_earn/flexible-locked/earn/Subscribe-Flexible-Product).
    ///
    pub async fn subscribe_flexible_product(
        &self,
        params: SubscribeFlexibleProductParams,
    ) -> anyhow::Result<RestApiResponse<models::SubscribeFlexibleProductResponse>> {
        self.flexible_locked_api_client
            .subscribe_flexible_product(params)
            .await
    }

    /// Subscribe Locked Product(TRADE)
    ///
    /// Subscribe Locked Product
    ///
    /// * You need to open `Enable Spot & Margin Trading` permission for the API Key which requests this endpoint.
    ///
    /// Weight: 1
    ///
    /// # Arguments
    ///
    /// - `params`: [`SubscribeLockedProductParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SubscribeLockedProductResponse>`] 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/simple_earn/flexible-locked/earn/Subscribe-Locked-Product).
    ///
    pub async fn subscribe_locked_product(
        &self,
        params: SubscribeLockedProductParams,
    ) -> anyhow::Result<RestApiResponse<models::SubscribeLockedProductResponse>> {
        self.flexible_locked_api_client
            .subscribe_locked_product(params)
            .await
    }

    /// Get RWUSD Account (`USER_DATA`)
    ///
    /// Get RWUSD account information.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetRwusdAccountParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetRwusdAccountResponse>`] 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/simple_earn/rwusd/account/).
    ///
    pub async fn get_rwusd_account(
        &self,
        params: GetRwusdAccountParams,
    ) -> anyhow::Result<RestApiResponse<models::GetRwusdAccountResponse>> {
        self.rwusd_api_client.get_rwusd_account(params).await
    }

    /// Get RWUSD Quota Details (`USER_DATA`)
    ///
    /// Get RWUSD quota details including subscription quota, fast redemption quota, and standard redemption quota.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetRwusdQuotaDetailsParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetRwusdQuotaDetailsResponse>`] 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/simple_earn/rwusd/account/Get-RWUSD-Quota-Details).
    ///
    pub async fn get_rwusd_quota_details(
        &self,
        params: GetRwusdQuotaDetailsParams,
    ) -> anyhow::Result<RestApiResponse<models::GetRwusdQuotaDetailsResponse>> {
        self.rwusd_api_client.get_rwusd_quota_details(params).await
    }

    /// Get RWUSD Rate History (`USER_DATA`)
    ///
    /// Get RWUSD rate history sorted by descending order.
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetRwusdRateHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetRwusdRateHistoryResponse>`] 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/simple_earn/rwusd/history/Get-RWUSD-Rate-History).
    ///
    pub async fn get_rwusd_rate_history(
        &self,
        params: GetRwusdRateHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetRwusdRateHistoryResponse>> {
        self.rwusd_api_client.get_rwusd_rate_history(params).await
    }

    /// Get RWUSD Redemption History (`USER_DATA`)
    ///
    /// Get RWUSD redemption history.
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetRwusdRedemptionHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetRwusdRedemptionHistoryResponse>`] 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/simple_earn/rwusd/history/Get-RWUSD-Redemption-History).
    ///
    pub async fn get_rwusd_redemption_history(
        &self,
        params: GetRwusdRedemptionHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetRwusdRedemptionHistoryResponse>> {
        self.rwusd_api_client
            .get_rwusd_redemption_history(params)
            .await
    }

    /// Get RWUSD Rewards History (`USER_DATA`)
    ///
    /// Get RWUSD rewards history.
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time minus one month, and data between `startTime` and `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetRwusdRewardsHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetRwusdRewardsHistoryResponse>`] 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/simple_earn/rwusd/history/Get-RWUSD-Rewards-History).
    ///
    pub async fn get_rwusd_rewards_history(
        &self,
        params: GetRwusdRewardsHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetRwusdRewardsHistoryResponse>> {
        self.rwusd_api_client
            .get_rwusd_rewards_history(params)
            .await
    }

    /// Get RWUSD subscription `history(USER_DATA)`
    ///
    /// Get RWUSD subscription history
    ///
    /// * The time between `startTime` and `endTime` cannot be longer than 6 months.
    /// * If `startTime` and `endTime` are both not sent, then the last 30 days' data will be returned.
    /// * If `startTime` is sent but `endTime` is not sent, `endTime` will default to current time, and results from `startTime` onward will be returned.
    /// * If `endTime` is sent but `startTime` is not sent, `startTime` defaults to the current time advanced by one month, and data between `startTime` and `endTime` will be returned.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`GetRwusdSubscriptionHistoryParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::GetRwusdSubscriptionHistoryResponse>`] 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/simple_earn/rwusd/history/Get-RWUSD-subscription-history).
    ///
    pub async fn get_rwusd_subscription_history(
        &self,
        params: GetRwusdSubscriptionHistoryParams,
    ) -> anyhow::Result<RestApiResponse<models::GetRwusdSubscriptionHistoryResponse>> {
        self.rwusd_api_client
            .get_rwusd_subscription_history(params)
            .await
    }

    /// Redeem RWUSD(TRADE)
    ///
    /// Redeem RWUSD to USDC
    ///
    /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`RedeemRwusdParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::RedeemRwusdResponse>`] 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/simple_earn/rwusd/earn/Redeem-RWUSD).
    ///
    pub async fn redeem_rwusd(
        &self,
        params: RedeemRwusdParams,
    ) -> anyhow::Result<RestApiResponse<models::RedeemRwusdResponse>> {
        self.rwusd_api_client.redeem_rwusd(params).await
    }

    /// Subscribe RWUSD(TRADE)
    ///
    /// Subscribe RWUSD
    ///
    /// * You need to open Enable Spot & Margin Trading permission for the API Key which requests this endpoint.
    ///
    /// Weight: 150
    ///
    /// # Arguments
    ///
    /// - `params`: [`SubscribeRwusdParams`]
    ///   The parameters for this operation.
    ///
    /// # Returns
    ///
    /// [`RestApiResponse<models::SubscribeRwusdResponse>`] 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/simple_earn/rwusd/earn/Subscribe-RWUSD).
    ///
    pub async fn subscribe_rwusd(
        &self,
        params: SubscribeRwusdParams,
    ) -> anyhow::Result<RestApiResponse<models::SubscribeRwusdResponse>> {
        self.rwusd_api_client.subscribe_rwusd(params).await
    }
}
