binance-sdk 77.0.1

This is a lightweight library that works as a connector to the Binance public API.
Documentation
/*
 * Spot WebSocket API
 *
 * Access market data, manage accounts, and trade on Binance Spot.
 *
 * 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::spot::websocket_api::models;
use serde::{Deserialize, Deserializer, Serialize, de::Error};
use serde_json::Value;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderPlaceResponseResult {
    #[serde(rename = "symbol", skip_serializing_if = "Option::is_none")]
    pub symbol: Option<String>,
    #[serde(rename = "orderId", skip_serializing_if = "Option::is_none")]
    pub order_id: Option<i64>,
    /// always -1 for singular orders
    #[serde(rename = "orderListId", skip_serializing_if = "Option::is_none")]
    pub order_list_id: Option<i64>,
    #[serde(rename = "clientOrderId", skip_serializing_if = "Option::is_none")]
    pub client_order_id: Option<String>,
    #[serde(rename = "transactTime", skip_serializing_if = "Option::is_none")]
    pub transact_time: Option<i64>,
    #[serde(rename = "price", skip_serializing_if = "Option::is_none")]
    pub price: Option<String>,
    #[serde(rename = "origQty", skip_serializing_if = "Option::is_none")]
    pub orig_qty: Option<String>,
    #[serde(rename = "executedQty", skip_serializing_if = "Option::is_none")]
    pub executed_qty: Option<String>,
    #[serde(rename = "origQuoteOrderQty", skip_serializing_if = "Option::is_none")]
    pub orig_quote_order_qty: Option<String>,
    #[serde(
        rename = "cummulativeQuoteQty",
        skip_serializing_if = "Option::is_none"
    )]
    pub cummulative_quote_qty: Option<String>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    #[serde(rename = "timeInForce", skip_serializing_if = "Option::is_none")]
    pub time_in_force: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
    #[serde(rename = "side", skip_serializing_if = "Option::is_none")]
    pub side: Option<String>,
    #[serde(rename = "workingTime", skip_serializing_if = "Option::is_none")]
    pub working_time: Option<i64>,
    #[serde(
        rename = "selfTradePreventionMode",
        skip_serializing_if = "Option::is_none"
    )]
    pub self_trade_prevention_mode: Option<String>,
    /// Appears for `STOP_LOSS`, `TAKE_PROFIT`, `STOP_LOSS_LIMIT`, and `TAKE_PROFIT_LIMIT` orders.
    #[serde(rename = "stopPrice", skip_serializing_if = "Option::is_none")]
    pub stop_price: Option<String>,
    /// Delta price change required before order activation.
    #[serde(rename = "trailingDelta", skip_serializing_if = "Option::is_none")]
    pub trailing_delta: Option<i64>,
    /// Appears only if the parameter icebergQty was sent in the request.
    #[serde(rename = "icebergQty", skip_serializing_if = "Option::is_none")]
    pub iceberg_qty: Option<String>,
    /// Appears only if the strategyId parameter was provided upon order placement.
    #[serde(rename = "strategyId", skip_serializing_if = "Option::is_none")]
    pub strategy_id: Option<i64>,
    /// Appears only if the strategyType parameter was provided upon order placement.
    #[serde(rename = "strategyType", skip_serializing_if = "Option::is_none")]
    pub strategy_type: Option<i64>,
    /// Appears only if the order expired due to STP.
    #[serde(rename = "preventedMatchId", skip_serializing_if = "Option::is_none")]
    pub prevented_match_id: Option<i64>,
    /// Order quantity that expired due to STP.
    #[serde(rename = "preventedQuantity", skip_serializing_if = "Option::is_none")]
    pub prevented_quantity: Option<String>,
    /// Time when the trailing order is now active and tracking price changes.
    #[serde(rename = "trailingTime", skip_serializing_if = "Option::is_none")]
    pub trailing_time: Option<i64>,
    /// Field that determines whether order used SOR.
    #[serde(rename = "usedSor", skip_serializing_if = "Option::is_none")]
    pub used_sor: Option<bool>,
    /// Determines whether the order is being filled by the SOR or by the order book.
    #[serde(rename = "workingFloor", skip_serializing_if = "Option::is_none")]
    pub working_floor: Option<String>,
    /// Price peg type. Only for pegged orders.
    #[serde(rename = "pegPriceType", skip_serializing_if = "Option::is_none")]
    pub peg_price_type: Option<String>,
    /// Price peg offset type. Only for pegged orders, if requested.
    #[serde(rename = "pegOffsetType", skip_serializing_if = "Option::is_none")]
    pub peg_offset_type: Option<String>,
    /// Price peg offset value. Only for pegged orders, if requested.
    #[serde(rename = "pegOffsetValue", skip_serializing_if = "Option::is_none")]
    pub peg_offset_value: Option<i64>,
    /// Current price order is pegged at. Only for pegged orders, once determined.
    #[serde(rename = "peggedPrice", skip_serializing_if = "Option::is_none")]
    pub pegged_price: Option<String>,
    /// Cause of the order's expiration. Appears when an order has expired.
    #[serde(rename = "expiryReason", skip_serializing_if = "Option::is_none")]
    pub expiry_reason: Option<String>,
    /// FULL response is identical to RESULT response, with the same optional fields based on the order type and parameters. FULL response additionally includes the list of trades which immediately filled the order.
    #[serde(rename = "fills", skip_serializing_if = "Option::is_none")]
    pub fills: Option<Vec<models::OrderPlaceResponseResultFillsInner>>,
}

impl OrderPlaceResponseResult {
    #[must_use]
    pub fn new() -> OrderPlaceResponseResult {
        OrderPlaceResponseResult {
            symbol: None,
            order_id: None,
            order_list_id: None,
            client_order_id: None,
            transact_time: None,
            price: None,
            orig_qty: None,
            executed_qty: None,
            orig_quote_order_qty: None,
            cummulative_quote_qty: None,
            status: None,
            time_in_force: None,
            r#type: None,
            side: None,
            working_time: None,
            self_trade_prevention_mode: None,
            stop_price: None,
            trailing_delta: None,
            iceberg_qty: None,
            strategy_id: None,
            strategy_type: None,
            prevented_match_id: None,
            prevented_quantity: None,
            trailing_time: None,
            used_sor: None,
            working_floor: None,
            peg_price_type: None,
            peg_offset_type: None,
            peg_offset_value: None,
            pegged_price: None,
            expiry_reason: None,
            fills: None,
        }
    }
}