tba_openapi_rust/models/
team_event_status_playoff.rs

1/*
2 * The Blue Alliance API v3
3 *
4 * # Overview    Information and statistics about FIRST Robotics Competition teams and events.   # Authentication   All endpoints require an Auth Key to be passed in the header `X-TBA-Auth-Key`. If you do not have an auth key yet, you can obtain one from your [Account Page](/account).
5 *
6 * The version of the OpenAPI document: 3.8.2
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// TeamEventStatusPlayoff : Playoff status for this team, may be null if the team did not make playoffs, or playoffs have not begun.
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct TeamEventStatusPlayoff {
17    /// The highest playoff level the team reached.
18    #[serde(rename = "level", skip_serializing_if = "Option::is_none")]
19    pub level: Option<Level>,
20    #[serde(rename = "current_level_record", skip_serializing_if = "Option::is_none")]
21    pub current_level_record: Option<Box<crate::models::WltRecord>>,
22    #[serde(rename = "record", skip_serializing_if = "Option::is_none")]
23    pub record: Option<Box<crate::models::WltRecord>>,
24    /// Current competition status for the playoffs.
25    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
26    pub status: Option<Status>,
27    /// The average match score during playoffs. Year specific. May be null if not relevant for a given year.
28    #[serde(rename = "playoff_average", skip_serializing_if = "Option::is_none")]
29    pub playoff_average: Option<i32>,
30}
31
32impl TeamEventStatusPlayoff {
33    /// Playoff status for this team, may be null if the team did not make playoffs, or playoffs have not begun.
34    pub fn new() -> TeamEventStatusPlayoff {
35        TeamEventStatusPlayoff {
36            level: None,
37            current_level_record: None,
38            record: None,
39            status: None,
40            playoff_average: None,
41        }
42    }
43}
44
45/// The highest playoff level the team reached.
46#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
47pub enum Level {
48    #[serde(rename = "qm")]
49    Qm,
50    #[serde(rename = "ef")]
51    Ef,
52    #[serde(rename = "qf")]
53    Qf,
54    #[serde(rename = "sf")]
55    Sf,
56    #[serde(rename = "f")]
57    F,
58}
59
60impl Default for Level {
61    fn default() -> Level {
62        Self::Qm
63    }
64}
65/// Current competition status for the playoffs.
66#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
67pub enum Status {
68    #[serde(rename = "won")]
69    Won,
70    #[serde(rename = "eliminated")]
71    Eliminated,
72    #[serde(rename = "playing")]
73    Playing,
74}
75
76impl Default for Status {
77    fn default() -> Status {
78        Self::Won
79    }
80}
81