deepl_openapi/models/
source_language.rs

1/*
2 * DeepL API Documentation
3 *
4 * The DeepL API provides programmatic access to DeepL’s machine translation technology.
5 *
6 * The version of the OpenAPI document: 2.7.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// SourceLanguage : Language of the text to be translated. Options currently available:  * `BG` - Bulgarian  * `CS` - Czech  * `DA` - Danish  * `DE` - German  * `EL` - Greek  * `EN` - English  * `ES` - Spanish  * `ET` - Estonian  * `FI` - Finnish  * `FR` - French  * `HU` - Hungarian  * `ID` - Indonesian  * `IT` - Italian  * `JA` - Japanese  * `KO` - Korean  * `LT` - Lithuanian  * `LV` - Latvian  * `NB` - Norwegian (Bokmål)  * `NL` - Dutch  * `PL` - Polish  * `PT` - Portuguese (all Portuguese varieties mixed)  * `RO` - Romanian  * `RU` - Russian  * `SK` - Slovak  * `SL` - Slovenian  * `SV` - Swedish  * `TR` - Turkish  * `UK` - Ukrainian  * `ZH` - Chinese  If this parameter is omitted, the API will attempt to detect the language of the text and translate it.
12
13/// Language of the text to be translated. Options currently available:  * `BG` - Bulgarian  * `CS` - Czech  * `DA` - Danish  * `DE` - German  * `EL` - Greek  * `EN` - English  * `ES` - Spanish  * `ET` - Estonian  * `FI` - Finnish  * `FR` - French  * `HU` - Hungarian  * `ID` - Indonesian  * `IT` - Italian  * `JA` - Japanese  * `KO` - Korean  * `LT` - Lithuanian  * `LV` - Latvian  * `NB` - Norwegian (Bokmål)  * `NL` - Dutch  * `PL` - Polish  * `PT` - Portuguese (all Portuguese varieties mixed)  * `RO` - Romanian  * `RU` - Russian  * `SK` - Slovak  * `SL` - Slovenian  * `SV` - Swedish  * `TR` - Turkish  * `UK` - Ukrainian  * `ZH` - Chinese  If this parameter is omitted, the API will attempt to detect the language of the text and translate it.
14#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
15pub enum SourceLanguage {
16    #[serde(rename = "BG")]
17    Bg,
18    #[serde(rename = "CS")]
19    Cs,
20    #[serde(rename = "DA")]
21    Da,
22    #[serde(rename = "DE")]
23    De,
24    #[serde(rename = "EL")]
25    El,
26    #[serde(rename = "EN")]
27    En,
28    #[serde(rename = "ES")]
29    Es,
30    #[serde(rename = "ET")]
31    Et,
32    #[serde(rename = "FI")]
33    Fi,
34    #[serde(rename = "FR")]
35    Fr,
36    #[serde(rename = "HU")]
37    Hu,
38    #[serde(rename = "ID")]
39    Id,
40    #[serde(rename = "IT")]
41    It,
42    #[serde(rename = "JA")]
43    Ja,
44    #[serde(rename = "KO")]
45    Ko,
46    #[serde(rename = "LT")]
47    Lt,
48    #[serde(rename = "LV")]
49    Lv,
50    #[serde(rename = "NB")]
51    Nb,
52    #[serde(rename = "NL")]
53    Nl,
54    #[serde(rename = "PL")]
55    Pl,
56    #[serde(rename = "PT")]
57    Pt,
58    #[serde(rename = "RO")]
59    Ro,
60    #[serde(rename = "RU")]
61    Ru,
62    #[serde(rename = "SK")]
63    Sk,
64    #[serde(rename = "SL")]
65    Sl,
66    #[serde(rename = "SV")]
67    Sv,
68    #[serde(rename = "TR")]
69    Tr,
70    #[serde(rename = "UK")]
71    Uk,
72    #[serde(rename = "ZH")]
73    Zh,
74
75}
76
77impl ToString for SourceLanguage {
78    fn to_string(&self) -> String {
79        match self {
80            Self::Bg => String::from("BG"),
81            Self::Cs => String::from("CS"),
82            Self::Da => String::from("DA"),
83            Self::De => String::from("DE"),
84            Self::El => String::from("EL"),
85            Self::En => String::from("EN"),
86            Self::Es => String::from("ES"),
87            Self::Et => String::from("ET"),
88            Self::Fi => String::from("FI"),
89            Self::Fr => String::from("FR"),
90            Self::Hu => String::from("HU"),
91            Self::Id => String::from("ID"),
92            Self::It => String::from("IT"),
93            Self::Ja => String::from("JA"),
94            Self::Ko => String::from("KO"),
95            Self::Lt => String::from("LT"),
96            Self::Lv => String::from("LV"),
97            Self::Nb => String::from("NB"),
98            Self::Nl => String::from("NL"),
99            Self::Pl => String::from("PL"),
100            Self::Pt => String::from("PT"),
101            Self::Ro => String::from("RO"),
102            Self::Ru => String::from("RU"),
103            Self::Sk => String::from("SK"),
104            Self::Sl => String::from("SL"),
105            Self::Sv => String::from("SV"),
106            Self::Tr => String::from("TR"),
107            Self::Uk => String::from("UK"),
108            Self::Zh => String::from("ZH"),
109        }
110    }
111}
112
113impl Default for SourceLanguage {
114    fn default() -> SourceLanguage {
115        Self::Bg
116    }
117}
118
119
120
121