eclipsis_rs/models/model_match.rs
1/*
2 * xethlyx's api server
3 *
4 * Public APIs for use within whatever you want. These are ratelimited, so try to keep requests to a minimum. Future use of the API will require an API key. ## API Keys API keys need to be passed alongside every request. With an API key, you are also expected to adhere to the following guidelines: - Do not share your API key. - Data can be retained for a maximum of 30 days (this is to adhere with GDPR guidelines). API keys can also be saved to the browser for convenience using the client login/logout APIs. You can obtain an API key by asking staff in the [Eclipsis discord](https://discord.gg/AkDsUtz).
5 *
6 * The version of the OpenAPI document: 3.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct Match {
13 /// Discord's ID format. To get a snowflake, turn on Developer Mode and click Copy ID from any context menu.
14 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
15 pub id: Option<String>,
16 /// How long the match took in seconds
17 #[serde(rename = "match_time", skip_serializing_if = "Option::is_none")]
18 pub match_time: Option<i64>,
19 /// The type of match
20 #[serde(rename = "match_type", skip_serializing_if = "Option::is_none")]
21 pub match_type: Option<MatchType>,
22 #[serde(rename = "teams", skip_serializing_if = "Option::is_none")]
23 pub teams: Option<Vec<crate::models::MatchTeam>>,
24}
25
26impl Match {
27 pub fn new() -> Match {
28 Match {
29 id: None,
30 match_time: None,
31 match_type: None,
32 teams: None,
33 }
34 }
35}
36
37/// The type of match
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum MatchType {
40 #[serde(rename = "TeamRated")]
41 TeamRated,
42 #[serde(rename = "TeamUnrated")]
43 TeamUnrated,
44 #[serde(rename = "SoloRated")]
45 SoloRated,
46 #[serde(rename = "SoloUnrated")]
47 SoloUnrated,
48}
49
50impl Default for MatchType {
51 fn default() -> MatchType {
52 Self::TeamRated
53 }
54}