/*
 * OpenAPI
 *
 * OpenAPI
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderFillMessageDataDInner {
    /// Order fill identifier.
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// Related order identifier for this fill.
    #[serde(rename = "oid")]
    pub oid: uuid::Uuid,
    /// Client order identifier provided at order placement. May be empty if not provided or for certain order update types.
    #[serde(rename = "cloid", skip_serializing_if = "Option::is_none")]
    pub cloid: Option<String>,
    /// Price.
    #[serde(rename = "px")]
    pub px: rust_decimal::Decimal,
    /// Size.
    #[serde(rename = "sz")]
    pub sz: rust_decimal::Decimal,
    #[serde(rename = "typ")]
    pub typ: models::OrderType,
    #[serde(rename = "sd")]
    pub sd: models::OrderSide,
    #[serde(rename = "s")]
    pub s: String,
    #[serde(rename = "sid")]
    pub sid: uuid::Uuid,
    #[serde(rename = "ro")]
    pub ro: bool,
    /// Fees for this fill.
    #[serde(rename = "fee")]
    pub fee: rust_decimal::Decimal,
    /// Whether this fill was a maker or taker fill.
    #[serde(rename = "m")]
    pub m: bool,
    #[serde(rename = "t")]
    pub t: i64,
}

impl OrderFillMessageDataDInner {
    pub fn new(
        id: uuid::Uuid,
        oid: uuid::Uuid,
        px: rust_decimal::Decimal,
        sz: rust_decimal::Decimal,
        typ: models::OrderType,
        sd: models::OrderSide,
        s: String,
        sid: uuid::Uuid,
        ro: bool,
        fee: rust_decimal::Decimal,
        m: bool,
        t: i64,
    ) -> OrderFillMessageDataDInner {
        OrderFillMessageDataDInner {
            id,
            oid,
            cloid: None,
            px,
            sz,
            typ,
            sd,
            s,
            sid,
            ro,
            fee,
            m,
            t,
        }
    }
}
