1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* The Blue Alliance API v3
*
* # 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).
*
* The version of the OpenAPI document: 3.8.2
*
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct EventSimple {
/// TBA event key with the format yyyy[EVENT_CODE], where yyyy is the year, and EVENT_CODE is the event code of the event.
#[serde(rename = "key")]
pub key: String,
/// Official name of event on record either provided by FIRST or organizers of offseason event.
#[serde(rename = "name")]
pub name: String,
/// Event short code, as provided by FIRST.
#[serde(rename = "event_code")]
pub event_code: String,
/// Event Type, as defined here: https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/event_type.py#L2
#[serde(rename = "event_type")]
pub event_type: i32,
#[serde(rename = "district", skip_serializing_if = "Option::is_none")]
pub district: Option<Box<crate::models::DistrictList>>,
/// City, town, village, etc. the event is located in.
#[serde(rename = "city", skip_serializing_if = "Option::is_none")]
pub city: Option<String>,
/// State or Province the event is located in.
#[serde(rename = "state_prov", skip_serializing_if = "Option::is_none")]
pub state_prov: Option<String>,
/// Country the event is located in.
#[serde(rename = "country", skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
/// Event start date in `yyyy-mm-dd` format.
#[serde(rename = "start_date")]
pub start_date: String,
/// Event end date in `yyyy-mm-dd` format.
#[serde(rename = "end_date")]
pub end_date: String,
/// Year the event data is for.
#[serde(rename = "year")]
pub year: i32,
}
impl EventSimple {
pub fn new(key: String, name: String, event_code: String, event_type: i32, start_date: String, end_date: String, year: i32) -> EventSimple {
EventSimple {
key,
name,
event_code,
event_type,
district: None,
city: None,
state_prov: None,
country: None,
start_date,
end_date,
year,
}
}
}