tba-openapi-rust 3.8.2

# 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).
Documentation
/*
 * 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,
        }
    }
}