stadar 0.1.27

Rust SDK for the stadar.net esports data API.
/*
 * Stadar Esports Data API
 *
 * Read-only esports data across all major competitive titles. Flat-tier pricing (no per-game gates), monthly subscriptions, sandbox keys for evaluation. See https://stadar.net for tier pricing. All endpoints under `/v1/...`. The version in `info.version` matches the URL prefix; non-breaking field additions ship in `/v1`, breaking changes get a `/v2`. We commit to 24 months of `/v1` support after `/v2` ships. Times are UTC end-to-end (RFC 3339). Localization is the client's problem. Cursors are opaque base64 strings; treat them as such. 
 *
 * The version of the OpenAPI document: v1
 * Contact: api@stadar.net
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MatchOdds {
    /// Canonical match public id, even when the prices were observed on a linked provider row.
    #[serde(rename = "match_id")]
    pub match_id: String,
    #[serde(rename = "game")]
    pub game: String,
    /// Series length (bo1 | bo3 | bo5 | bo7). Determines which markets are meaningful.
    #[serde(rename = "format")]
    pub format: String,
    #[serde(rename = "scheduled_at")]
    pub scheduled_at: chrono::DateTime<chrono::FixedOffset>,
    /// Most recent observation across the books below.
    #[serde(rename = "captured_at", skip_serializing_if = "Option::is_none")]
    pub captured_at: Option<chrono::DateTime<chrono::FixedOffset>>,
    #[serde(rename = "books")]
    pub books: Vec<models::OddsBook>,
}

impl MatchOdds {
    pub fn new(match_id: String, game: String, format: String, scheduled_at: chrono::DateTime<chrono::FixedOffset>, books: Vec<models::OddsBook>) -> MatchOdds {
        MatchOdds {
            match_id,
            game,
            format,
            scheduled_at,
            captured_at: None,
            books,
        }
    }
}