tba_openapi_rust/models/
team.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
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct Team {
16    /// TBA team key with the format `frcXXXX` with `XXXX` representing the team number.
17    #[serde(rename = "key")]
18    pub key: String,
19    /// Official team number issued by FIRST.
20    #[serde(rename = "team_number")]
21    pub team_number: i32,
22    /// Team nickname provided by FIRST.
23    #[serde(rename = "nickname", skip_serializing_if = "Option::is_none")]
24    pub nickname: Option<String>,
25    /// Official long name registered with FIRST.
26    #[serde(rename = "name")]
27    pub name: String,
28    /// Name of team school or affilited group registered with FIRST.
29    #[serde(rename = "school_name", skip_serializing_if = "Option::is_none")]
30    pub school_name: Option<String>,
31    /// City of team derived from parsing the address registered with FIRST.
32    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
33    pub city: Option<String>,
34    /// State of team derived from parsing the address registered with FIRST.
35    #[serde(rename = "state_prov", skip_serializing_if = "Option::is_none")]
36    pub state_prov: Option<String>,
37    /// Country of team derived from parsing the address registered with FIRST.
38    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
39    pub country: Option<String>,
40    /// Will be NULL, for future development.
41    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
42    pub address: Option<String>,
43    /// Postal code from the team address.
44    #[serde(rename = "postal_code", skip_serializing_if = "Option::is_none")]
45    pub postal_code: Option<String>,
46    /// Will be NULL, for future development.
47    #[serde(rename = "gmaps_place_id", skip_serializing_if = "Option::is_none")]
48    pub gmaps_place_id: Option<String>,
49    /// Will be NULL, for future development.
50    #[serde(rename = "gmaps_url", skip_serializing_if = "Option::is_none")]
51    pub gmaps_url: Option<String>,
52    /// Will be NULL, for future development.
53    #[serde(rename = "lat", skip_serializing_if = "Option::is_none")]
54    pub lat: Option<f64>,
55    /// Will be NULL, for future development.
56    #[serde(rename = "lng", skip_serializing_if = "Option::is_none")]
57    pub lng: Option<f64>,
58    /// Will be NULL, for future development.
59    #[serde(rename = "location_name", skip_serializing_if = "Option::is_none")]
60    pub location_name: Option<String>,
61    /// Official website associated with the team.
62    #[serde(rename = "website", skip_serializing_if = "Option::is_none")]
63    pub website: Option<String>,
64    /// First year the team officially competed.
65    #[serde(rename = "rookie_year", skip_serializing_if = "Option::is_none")]
66    pub rookie_year: Option<i32>,
67    /// Team's motto as provided by FIRST. This field is deprecated and will return null - will be removed at end-of-season in 2019.
68    #[serde(rename = "motto", skip_serializing_if = "Option::is_none")]
69    pub motto: Option<String>,
70    /// Location of the team's home championship each year as a key-value pair. The year (as a string) is the key, and the city is the value.
71    #[serde(rename = "home_championship", skip_serializing_if = "Option::is_none")]
72    pub home_championship: Option<serde_json::Value>,
73}
74
75impl Team {
76    pub fn new(key: String, team_number: i32, name: String) -> Team {
77        Team {
78            key,
79            team_number,
80            nickname: None,
81            name,
82            school_name: None,
83            city: None,
84            state_prov: None,
85            country: None,
86            address: None,
87            postal_code: None,
88            gmaps_place_id: None,
89            gmaps_url: None,
90            lat: None,
91            lng: None,
92            location_name: None,
93            website: None,
94            rookie_year: None,
95            motto: None,
96            home_championship: None,
97        }
98    }
99}
100
101