/*
 * Thalex RPC API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * 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 BookRpcResult {
    /// Bids (list of price, amount, outright-amount)
    #[serde(rename = "bids")]
    pub bids: Vec<Vec<rust_decimal::Decimal>>,
    /// Asks (list of price, amount, outright-amount)
    #[serde(rename = "asks")]
    pub asks: Vec<Vec<rust_decimal::Decimal>>,
    /// Last traded price
    #[serde(rename = "last", skip_serializing_if = "Option::is_none")]
    pub last: Option<rust_decimal::Decimal>,
    /// Time of the last recorded update to this order book (Unix timestamp).
    #[serde(rename = "time")]
    pub time: rust_decimal::Decimal,
}

impl BookRpcResult {
    pub fn new(
        bids: Vec<Vec<rust_decimal::Decimal>>,
        asks: Vec<Vec<rust_decimal::Decimal>>,
        time: rust_decimal::Decimal,
    ) -> BookRpcResult {
        BookRpcResult {
            bids,
            asks,
            last: None,
            time,
        }
    }
}
