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

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

/// TradeStreamMessage : Server-to-client TradeStreams event message containing recent trades for a product.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TradeStreamMessage {
    /// Array of trade objects.
    #[serde(rename = "data")]
    pub data: Vec<models::TradeStreamMessageDataInner>,
    /// Identifier of the product.
    #[serde(rename = "productId")]
    pub product_id: uuid::Uuid,
}

impl TradeStreamMessage {
    /// Server-to-client TradeStreams event message containing recent trades for a product.
    pub fn new(
        data: Vec<models::TradeStreamMessageDataInner>,
        product_id: uuid::Uuid,
    ) -> TradeStreamMessage {
        TradeStreamMessage { data, product_id }
    }
}
