binance-sdk 69.2.0

This is a lightweight library that works as a connector to the Binance public API.
Documentation
/*
 * Stocks Trading REST API
 *
 * REST APIs for Binance Stocks Trading. All endpoints under `/sapi/v1/equity/_*`.
 *
 * 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 crate::stocks::rest_api::models;
use serde::{Deserialize, Serialize};

/// `EquityOrderDetailResponse` : Top-level fields mirror an order row from `/order/history` (orderId, symbol, quote, side, orderType, limitPrice, avgFilledPrice, qty, notional, filledQty, filledTotal, fee, session, status, createdAt, updatedAt), plus a `trades` array. `clientOrderId` is present only in Order Detail, not in Order History.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EquityOrderDetailResponse {
    /// Equity order id.
    #[serde(rename = "orderId", skip_serializing_if = "Option::is_none")]
    pub order_id: Option<String>,
    /// Client-supplied order id. Present only in Order Detail, not in Order History.
    #[serde(rename = "clientOrderId", skip_serializing_if = "Option::is_none")]
    pub client_order_id: Option<String>,
    /// US-equity ticker.
    #[serde(rename = "symbol", skip_serializing_if = "Option::is_none")]
    pub symbol: Option<String>,
    /// Quote asset.
    #[serde(rename = "quote", skip_serializing_if = "Option::is_none")]
    pub quote: Option<String>,
    /// `BUY` / `SELL`.
    #[serde(rename = "side", skip_serializing_if = "Option::is_none")]
    pub side: Option<String>,
    /// `MARKET` / `LIMIT`.
    #[serde(rename = "orderType", skip_serializing_if = "Option::is_none")]
    pub order_type: Option<String>,
    /// Limit price (USD). Non-null for `LIMIT`, `null` for `MARKET`.
    #[serde(
        rename = "limitPrice",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub limit_price: Option<Option<String>>,
    /// Average fill price (USD). Only present when the order has at least one fill.
    #[serde(
        rename = "avgFilledPrice",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub avg_filled_price: Option<Option<String>>,
    /// Requested quantity.
    #[serde(
        rename = "qty",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub qty: Option<Option<String>>,
    /// Requested notional.
    #[serde(
        rename = "notional",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub notional: Option<Option<String>>,
    /// Cumulative filled quantity.
    #[serde(rename = "filledQty", skip_serializing_if = "Option::is_none")]
    pub filled_qty: Option<String>,
    /// Cumulative filled notional.
    #[serde(
        rename = "filledTotal",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub filled_total: Option<Option<String>>,
    /// Total commission fee (USD).
    #[serde(rename = "fee", skip_serializing_if = "Option::is_none")]
    pub fee: Option<String>,
    /// Trading session.
    #[serde(
        rename = "session",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub session: Option<Option<String>>,
    /// Order lifecycle status.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// Order creation time (ms epoch).
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<i64>,
    /// Last update time (ms epoch).
    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<i64>,
    /// Trade executions for this order, most recent first. Empty array when no fills.
    #[serde(rename = "trades", skip_serializing_if = "Option::is_none")]
    pub trades: Option<Vec<models::EquityOrderDetailResponseTradesInner>>,
}

impl EquityOrderDetailResponse {
    /// Top-level fields mirror an order row from `/order/history` (orderId, symbol, quote, side, orderType, limitPrice, avgFilledPrice, qty, notional, filledQty, filledTotal, fee, session, status, createdAt, updatedAt), plus a `trades` array. `clientOrderId` is present only in Order Detail, not in Order History.
    #[must_use]
    pub fn new() -> EquityOrderDetailResponse {
        EquityOrderDetailResponse {
            order_id: None,
            client_order_id: None,
            symbol: None,
            quote: None,
            side: None,
            order_type: None,
            limit_price: None,
            avg_filled_price: None,
            qty: None,
            notional: None,
            filled_qty: None,
            filled_total: None,
            fee: None,
            session: None,
            status: None,
            created_at: None,
            updated_at: None,
            trades: None,
        }
    }
}