/*
 * Websocket Subscription Schemas
 *
 * Schema definitions Websocket API subscriptions for Thalex exchange.
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderStatusLegsInner {
    /// Leg instrument name.
    #[serde(rename = "instrument_name")]
    pub instrument_name: String,
    /// Quantity of this leg in a unit of the combination. A non-zero integer, negative for short legs.
    #[serde(rename = "quantity")]
    pub quantity: rust_decimal::Decimal,
    /// Amount executed on this leg.  Legs are filled proportionally to their quantities.
    #[serde(rename = "filled_amount")]
    pub filled_amount: rust_decimal::Decimal,
    /// Amount on this leg that remains in the book; if 0, order is now inactive.  Note that the only `time_in_force` for combination orders currently supported is `immediate_or_cancel`. Therefore, combination orders will never remain on a book, and this field will always be zero.
    #[serde(rename = "remaining_amount")]
    pub remaining_amount: rust_decimal::Decimal,
}

impl OrderStatusLegsInner {
    pub fn new(
        instrument_name: String,
        quantity: rust_decimal::Decimal,
        filled_amount: rust_decimal::Decimal,
        remaining_amount: rust_decimal::Decimal,
    ) -> OrderStatusLegsInner {
        OrderStatusLegsInner {
            instrument_name,
            quantity,
            filled_amount,
            remaining_amount,
        }
    }
}
