neis_client/types/
academy_info.rs1#![allow(non_snake_case)]
2use super::{ToQueryString, YesOrNo};
3use form_urlencoded::Serializer;
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, Serialize)]
7pub struct AcademyInfoParams {
8 pub ATPT_OFCDC_SC_CODE: String,
10 pub ADMST_ZONE_NM: Option<String>,
12 pub ACA_ASNUM: Option<String>,
14 pub ACA_NM: Option<String>,
16 pub REALM_SC_NM: Option<String>,
18 pub LE_ORD_NM: Option<String>,
20 pub LE_CRSE_NM: Option<String>,
22}
23
24impl AcademyInfoParams {
25 pub fn new(atpt_ofcdc_sc_code: &str) -> Self {
26 Self {
27 ATPT_OFCDC_SC_CODE: atpt_ofcdc_sc_code.to_owned(),
28 ADMST_ZONE_NM: None,
29 ACA_ASNUM: None,
30 ACA_NM: None,
31 REALM_SC_NM: None,
32 LE_ORD_NM: None,
33 LE_CRSE_NM: None,
34 }
35 }
36}
37
38impl ToQueryString for AcademyInfoParams {
39 fn to_query_string(&self) -> String {
40 let mut serializer = Serializer::new(String::new());
41
42 serializer.append_pair("ATPT_OFCDC_SC_CODE", &self.ATPT_OFCDC_SC_CODE);
43 if let Some(s) = &self.ADMST_ZONE_NM {
44 serializer.append_pair("ADMST_ZONE_NM", s);
45 }
46 if let Some(s) = &self.ACA_ASNUM {
47 serializer.append_pair("ACA_ASNUM", s);
48 }
49 if let Some(s) = &self.ACA_NM {
50 serializer.append_pair("ACA_NM", s);
51 }
52 if let Some(s) = &self.REALM_SC_NM {
53 serializer.append_pair("REALM_SC_NM", s);
54 }
55 if let Some(s) = &self.LE_ORD_NM {
56 serializer.append_pair("LE_ORD_NM", s);
57 }
58 if let Some(s) = &self.LE_CRSE_NM {
59 serializer.append_pair("LE_CRSE_NM", s);
60 }
61
62 serializer.finish()
63 }
64}
65
66#[derive(Debug, Clone, Deserialize, Hash)]
67pub struct AcademyInfoItem {
68 pub ATPT_OFCDC_SC_CODE: String,
71
72 pub ATPT_OFCDC_SC_NM: String,
75
76 pub ADMST_ZONE_NM: Option<String>,
79
80 pub ACA_INSTI_SC_NM: String,
83
84 pub ACA_ASNUM: String,
87
88 pub ACA_NM: String,
91
92 pub ESTBL_YMD: String,
95
96 pub REG_YMD: String,
99
100 pub REG_STTUS_NM: String,
103
104 pub CAA_BEGIN_YMD: String,
107
108 pub CAA_END_YMD: String,
111
112 pub TOFOR_SMTOT: i64,
115
116 pub DTM_RCPTN_ABLTY_NMPR_SMTOT: i64,
119
120 pub REALM_SC_NM: Option<String>,
123
124 pub LE_ORD_NM: Option<String>,
127
128 pub LE_CRSE_LIST_NM: Option<String>,
131
132 pub LE_CRSE_NM: Option<String>,
135
136 pub PSNBY_THCC_CNTNT: String,
139
140 pub THCC_OTHBC_YN: YesOrNo,
142
143 pub BRHS_ACA_YN: String,
146
147 pub FA_RDNMA: String,
150
151 pub FA_RDNDA: String,
154
155 pub FA_RDNZC: String,
158
159 pub FA_TELNO: Option<String>,
161
162 pub LOAD_DTM: String,
165}