ggapi/structs/
race_match_config.rs1
2use serde::{
3 Deserialize,
4 Serialize,
5};
6
7#[derive(Clone, Default, Serialize, Deserialize)]
13pub struct GGRaceMatchConfig {
14
15 #[serde(rename(serialize = "bracketType", deserialize = "bracketType"))]
16 pub bracket_type: Option<i64>,
17 pub id: Option<i64>,
18
19 #[serde(rename(serialize = "playerReportingEnabled", deserialize = "playerReportingEnabled"))]
20 pub player_reporting_enabled: Option<bool>,
21
22 #[serde(rename(serialize = "verificationMethods", deserialize = "verificationMethods"))]
23 pub verification_methods: Option<Vec<i64>>,
24
25 #[serde(rename(serialize = "verificationRequired", deserialize = "verificationRequired"))]
26 pub verification_required: Option<bool>,
27
28}
29
30impl GGRaceMatchConfig {
31
32 pub fn bracket_type(&self) -> i64 {
36 let mut result: i64 = 0;
37 if self.bracket_type.is_some() {
38 result = self.bracket_type.unwrap().clone();
39 }
40 return result;
41 }
42
43 pub fn id(&self) -> i64 {
47 let mut result: i64 = 0;
48 if self.id.is_some() {
49 result = self.id.unwrap().clone();
50 }
51 return result;
52 }
53
54 pub fn player_reporting_enabled(&self) -> bool {
58 let mut result: bool = false;
59 if self.player_reporting_enabled.is_some() {
60 result = self.player_reporting_enabled.unwrap().clone();
61 }
62 return result;
63 }
64
65 pub fn verification_methods(&self) -> Vec<i64> {
69 let mut result: Vec<i64> = Vec::new();
70 if self.verification_methods.is_some() {
71 for verification_method in self.verification_methods.as_ref().unwrap() {
72 result.push(verification_method.clone());
73 }
74 }
75 return result;
76 }
77
78 pub fn verification_required(&self) -> bool {
82 let mut result: bool = false;
83 if self.verification_required.is_some() {
84 result = self.verification_required.unwrap().clone();
85 }
86 return result;
87 }
88
89}