/*
 * 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 OrderHistoryLegsInner {
    /// 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: f64,
    /// Amount executed on this leg.  Legs are filled proportionally to their quantities.
    #[serde(rename = "filled_amount")]
    pub filled_amount: f64,
}

impl OrderHistoryLegsInner {
    pub fn new(
        instrument_name: String,
        quantity: f64,
        filled_amount: f64,
    ) -> OrderHistoryLegsInner {
        OrderHistoryLegsInner {
            instrument_name,
            quantity,
            filled_amount,
        }
    }
}
