languageCode

This commit is contained in:
p0lunin 2020-01-11 20:56:49 +02:00
parent 3e0b647658
commit d50e47ecd2
3 changed files with 192 additions and 2 deletions

View file

@ -0,0 +1,187 @@
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
pub enum LanguageCode {
AA,
AB,
AE,
AF,
AK,
AM,
AN,
AR,
AS,
AV,
AY,
AZ,
BA,
BE,
BG,
BH,
BI,
BM,
BN,
BO,
BR,
BS,
CA,
CE,
CH,
CO,
CR,
CS,
CU,
CV,
CY,
DA,
DE,
DV,
DZ,
EE,
EL,
EN,
EO,
ES,
ET,
EU,
FA,
FF,
FI,
FJ,
FO,
FR,
FY,
GA,
GD,
GL,
GN,
GU,
GV,
HA,
HE,
HI,
HO,
HR,
HT,
HU,
HY,
HZ,
IA,
ID,
IE,
IG,
II,
IK,
IO,
IS,
IT,
IU,
JA,
JV,
KA,
KG,
KI,
KJ,
KK,
KL,
KM,
KN,
KO,
KR,
KS,
KU,
KV,
KW,
KY,
LA,
LB,
LG,
LI,
LN,
LO,
LT,
LU,
LV,
MG,
MH,
MI,
MK,
ML,
MN,
MR,
MS,
MT,
MY,
NA,
NB,
ND,
NE,
NG,
NL,
NN,
NO,
NR,
NV,
NY,
OC,
OJ,
OM,
OR,
OS,
PA,
PI,
PL,
PS,
PT,
QU,
RM,
RN,
RO,
RU,
RW,
SA,
SC,
SD,
SE,
SG,
SI,
SK,
SL,
SM,
SN,
SO,
SQ,
SR,
SS,
ST,
SU,
SV,
SW,
TA,
TE,
TG,
TH,
TI,
TK,
TL,
TN,
TO,
TR,
TS,
TT,
TW,
TY,
UG,
UK,
UR,
UZ,
VE,
VI,
VO,
WA,
WO,
XH,
YI,
YO,
ZA,
ZH,
ZU,
}

View file

@ -1,5 +1,7 @@
pub use currency::*; pub use currency::*;
pub use country_code::*; pub use country_code::*;
pub use language_code::*;
mod currency; mod currency;
mod country_code; mod country_code;
mod language_code;

View file

@ -1,4 +1,5 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::types::LanguageCode;
/// This object represents a Telegram user or bot. /// This object represents a Telegram user or bot.
/// ///
@ -24,7 +25,7 @@ pub struct User {
/// [IETF language tag] of the user's language. /// [IETF language tag] of the user's language.
/// ///
/// [IETF language tag]: https://en.wikipedia.org/wiki/IETF_language_tag /// [IETF language tag]: https://en.wikipedia.org/wiki/IETF_language_tag
pub language_code: Option<String>, pub language_code: Option<LanguageCode>,
} }
#[cfg(test)] #[cfg(test)]