/*
 * 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 TradeValueHistoryParams {
    /// Start time (Unix timestamp) (inclusive).
    #[serde(rename = "time_low")]
    pub time_low: i64,
    /// End time (Unix timestamp) (inclusive).
    #[serde(rename = "time_high")]
    pub time_high: i64,
    #[serde(rename = "resolution")]
    pub resolution: models::ResolutionEnum,
    /// The maximum number of primary items to return per page. Due to resolution grouping rules, a page may include additional items beyond the limit to ensure that all items sharing the same date_time_bucket as the last item within the limit are included.
    #[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
    pub limit: Option<rust_decimal::Decimal>,
    /// Set to bookmark from previous call to get next page.
    #[serde(rename = "bookmark", skip_serializing_if = "Option::is_none")]
    pub bookmark: Option<String>,
    #[serde(rename = "sort", skip_serializing_if = "Option::is_none")]
    pub sort: Option<models::SortEnum>,
}

impl TradeValueHistoryParams {
    pub fn new(
        time_low: i64,
        time_high: i64,
        resolution: models::ResolutionEnum,
    ) -> TradeValueHistoryParams {
        TradeValueHistoryParams {
            time_low,
            time_high,
            resolution,
            limit: None,
            bookmark: None,
            sort: None,
        }
    }
}
