tba_openapi_rust/models/team_simple.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 TeamSimple {
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 /// City of team derived from parsing the address registered with FIRST.
29 #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
30 pub city: Option<String>,
31 /// State of team derived from parsing the address registered with FIRST.
32 #[serde(rename = "state_prov", skip_serializing_if = "Option::is_none")]
33 pub state_prov: Option<String>,
34 /// Country of team derived from parsing the address registered with FIRST.
35 #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
36 pub country: Option<String>,
37}
38
39impl TeamSimple {
40 pub fn new(key: String, team_number: i32, name: String) -> TeamSimple {
41 TeamSimple {
42 key,
43 team_number,
44 nickname: None,
45 name,
46 city: None,
47 state_prov: None,
48 country: None,
49 }
50 }
51}
52
53