/*
 * 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 RfqOrder {
    /// Identifier of the RFQ.
    #[serde(rename = "rfq_id")]
    pub rfq_id: String,
    /// Identifier of the individual quote.
    #[serde(rename = "order_id")]
    pub order_id: String,
    /// Client-supplied order id. Field is omitted if no client order id was supplied.
    #[serde(rename = "client_order_id", skip_serializing_if = "Option::is_none")]
    pub client_order_id: Option<rust_decimal::Decimal>,
    #[serde(rename = "direction")]
    pub direction: models::DirectionEnum,
    #[serde(rename = "price")]
    pub price: rust_decimal::Decimal,
    #[serde(rename = "amount")]
    pub amount: rust_decimal::Decimal,
    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    /// the price at which this order traded.
    #[serde(rename = "trade_price", skip_serializing_if = "Option::is_none")]
    pub trade_price: Option<rust_decimal::Decimal>,
    /// the number of combinations that traded.
    #[serde(rename = "trade_amount", skip_serializing_if = "Option::is_none")]
    pub trade_amount: Option<rust_decimal::Decimal>,
    #[serde(rename = "delete_reason", skip_serializing_if = "Option::is_none")]
    pub delete_reason: Option<models::DeleteReasonEnum>,
    #[serde(rename = "event", skip_serializing_if = "Option::is_none")]
    pub event: Option<models::EventEnum>,
}

impl RfqOrder {
    pub fn new(
        rfq_id: String,
        order_id: String,
        direction: models::DirectionEnum,
        price: rust_decimal::Decimal,
        amount: rust_decimal::Decimal,
    ) -> RfqOrder {
        RfqOrder {
            rfq_id,
            order_id,
            client_order_id: None,
            direction,
            price,
            amount,
            label: None,
            trade_price: None,
            trade_amount: None,
            delete_reason: None,
            event: None,
        }
    }
}
