tba_openapi_rust/models/
event.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 Event {
16    /// TBA event key with the format yyyy[EVENT_CODE], where yyyy is the year, and EVENT_CODE is the event code of the event.
17    #[serde(rename = "key")]
18    pub key: String,
19    /// Official name of event on record either provided by FIRST or organizers of offseason event.
20    #[serde(rename = "name")]
21    pub name: String,
22    /// Event short code, as provided by FIRST.
23    #[serde(rename = "event_code")]
24    pub event_code: String,
25    /// Event Type, as defined here: https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/event_type.py#L2
26    #[serde(rename = "event_type")]
27    pub event_type: i32,
28    #[serde(rename = "district", skip_serializing_if = "Option::is_none")]
29    pub district: Option<Box<crate::models::DistrictList>>,
30    /// City, town, village, etc. the event is located in.
31    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
32    pub city: Option<String>,
33    /// State or Province the event is located in.
34    #[serde(rename = "state_prov", skip_serializing_if = "Option::is_none")]
35    pub state_prov: Option<String>,
36    /// Country the event is located in.
37    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
38    pub country: Option<String>,
39    /// Event start date in `yyyy-mm-dd` format.
40    #[serde(rename = "start_date")]
41    pub start_date: String,
42    /// Event end date in `yyyy-mm-dd` format.
43    #[serde(rename = "end_date")]
44    pub end_date: String,
45    /// Year the event data is for.
46    #[serde(rename = "year")]
47    pub year: i32,
48    /// Same as `name` but doesn't include event specifiers, such as 'Regional' or 'District'. May be null.
49    #[serde(rename = "short_name", skip_serializing_if = "Option::is_none")]
50    pub short_name: Option<String>,
51    /// Event Type, eg Regional, District, or Offseason.
52    #[serde(rename = "event_type_string")]
53    pub event_type_string: String,
54    /// Week of the event relative to the first official season event, zero-indexed. Only valid for Regionals, Districts, and District Championships. Null otherwise. (Eg. A season with a week 0 'preseason' event does not count, and week 1 events will show 0 here. Seasons with a week 0.5 regional event will show week 0 for those event(s) and week 1 for week 1 events and so on.)
55    #[serde(rename = "week", skip_serializing_if = "Option::is_none")]
56    pub week: Option<i32>,
57    /// Address of the event's venue, if available.
58    #[serde(rename = "address", skip_serializing_if = "Option::is_none")]
59    pub address: Option<String>,
60    /// Postal code from the event address.
61    #[serde(rename = "postal_code", skip_serializing_if = "Option::is_none")]
62    pub postal_code: Option<String>,
63    /// Google Maps Place ID for the event address.
64    #[serde(rename = "gmaps_place_id", skip_serializing_if = "Option::is_none")]
65    pub gmaps_place_id: Option<String>,
66    /// Link to address location on Google Maps.
67    #[serde(rename = "gmaps_url", skip_serializing_if = "Option::is_none")]
68    pub gmaps_url: Option<String>,
69    /// Latitude for the event address.
70    #[serde(rename = "lat", skip_serializing_if = "Option::is_none")]
71    pub lat: Option<f64>,
72    /// Longitude for the event address.
73    #[serde(rename = "lng", skip_serializing_if = "Option::is_none")]
74    pub lng: Option<f64>,
75    /// Name of the location at the address for the event, eg. Blue Alliance High School.
76    #[serde(rename = "location_name", skip_serializing_if = "Option::is_none")]
77    pub location_name: Option<String>,
78    /// Timezone name.
79    #[serde(rename = "timezone", skip_serializing_if = "Option::is_none")]
80    pub timezone: Option<String>,
81    /// The event's website, if any.
82    #[serde(rename = "website", skip_serializing_if = "Option::is_none")]
83    pub website: Option<String>,
84    /// The FIRST internal Event ID, used to link to the event on the FRC webpage.
85    #[serde(rename = "first_event_id", skip_serializing_if = "Option::is_none")]
86    pub first_event_id: Option<String>,
87    /// Public facing event code used by FIRST (on frc-events.firstinspires.org, for example)
88    #[serde(rename = "first_event_code", skip_serializing_if = "Option::is_none")]
89    pub first_event_code: Option<String>,
90    #[serde(rename = "webcasts", skip_serializing_if = "Option::is_none")]
91    pub webcasts: Option<Vec<crate::models::Webcast>>,
92    /// An array of event keys for the divisions at this event.
93    #[serde(rename = "division_keys", skip_serializing_if = "Option::is_none")]
94    pub division_keys: Option<Vec<String>>,
95    /// The TBA Event key that represents the event's parent. Used to link back to the event from a division event. It is also the inverse relation of `divison_keys`.
96    #[serde(rename = "parent_event_key", skip_serializing_if = "Option::is_none")]
97    pub parent_event_key: Option<String>,
98    /// Playoff Type, as defined here: https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/playoff_type.py#L4, or null.
99    #[serde(rename = "playoff_type", skip_serializing_if = "Option::is_none")]
100    pub playoff_type: Option<i32>,
101    /// String representation of the `playoff_type`, or null.
102    #[serde(rename = "playoff_type_string", skip_serializing_if = "Option::is_none")]
103    pub playoff_type_string: Option<String>,
104}
105
106impl Event {
107    pub fn new(key: String, name: String, event_code: String, event_type: i32, start_date: String, end_date: String, year: i32, event_type_string: String) -> Event {
108        Event {
109            key,
110            name,
111            event_code,
112            event_type,
113            district: None,
114            city: None,
115            state_prov: None,
116            country: None,
117            start_date,
118            end_date,
119            year,
120            short_name: None,
121            event_type_string,
122            week: None,
123            address: None,
124            postal_code: None,
125            gmaps_place_id: None,
126            gmaps_url: None,
127            lat: None,
128            lng: None,
129            location_name: None,
130            timezone: None,
131            website: None,
132            first_event_id: None,
133            first_event_code: None,
134            webcasts: None,
135            division_keys: None,
136            parent_event_key: None,
137            playoff_type: None,
138            playoff_type_string: None,
139        }
140    }
141}
142
143