tba_openapi_rust/models/
event_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 EventSimple {
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}
49
50impl EventSimple {
51    pub fn new(key: String, name: String, event_code: String, event_type: i32, start_date: String, end_date: String, year: i32) -> EventSimple {
52        EventSimple {
53            key,
54            name,
55            event_code,
56            event_type,
57            district: None,
58            city: None,
59            state_prov: None,
60            country: None,
61            start_date,
62            end_date,
63            year,
64        }
65    }
66}
67
68