Skip to main content

bitwarden_api_api/models/
global_equivalent_domains_type.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Deserializer, Serialize, Serializer, de::Visitor};
12
13use crate::models;
14///
15#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
16pub enum GlobalEquivalentDomainsType {
17    Google,
18    Apple,
19    Ameritrade,
20    BoA,
21    Sprint,
22    WellsFargo,
23    Merrill,
24    Citi,
25    Cnet,
26    Gap,
27    Microsoft,
28    United,
29    Yahoo,
30    Zonelabs,
31    PayPal,
32    Avon,
33    Diapers,
34    Contacts,
35    Amazon,
36    Cox,
37    Norton,
38    Verizon,
39    Buy,
40    Sirius,
41    Ea,
42    Basecamp,
43    Steam,
44    Chart,
45    Gotomeeting,
46    Gogo,
47    Oracle,
48    Discover,
49    Dcu,
50    Healthcare,
51    Pepco,
52    Century21,
53    Comcast,
54    Cricket,
55    Mtb,
56    Dropbox,
57    Snapfish,
58    Alibaba,
59    Playstation,
60    Mercado,
61    Zendesk,
62    Autodesk,
63    RailNation,
64    Wpcu,
65    Mathletics,
66    Discountbank,
67    Mi,
68    Facebook,
69    Postepay,
70    Skysports,
71    Disney,
72    Pokemon,
73    Uv,
74    Yahavo,
75    Mdsol,
76    Sears,
77    Xiami,
78    Belkin,
79    Turbotax,
80    Shopify,
81    Ebay,
82    Techdata,
83    Schwab,
84    Mozilla,
85    Tesla,
86    MorganStanley,
87    TaxAct,
88    Wikimedia,
89    Airbnb,
90    Eventbrite,
91    StackExchange,
92    Docusign,
93    Envato,
94    X10Hosting,
95    Cisco,
96    CedarFair,
97    Ubiquiti,
98    Discord,
99    Netcup,
100    Yandex,
101    Sony,
102    Proton,
103    Ubisoft,
104    TransferWise,
105    TakeawayEU,
106    Atlassian,
107    Pinterest,
108    Twitter,
109
110    /// Unknown value returned from the server. This is used to handle forward compatibility.
111    __Unknown(i64),
112}
113
114impl GlobalEquivalentDomainsType {
115    pub fn as_i64(&self) -> i64 {
116        match self {
117            Self::Google => 0,
118            Self::Apple => 1,
119            Self::Ameritrade => 2,
120            Self::BoA => 3,
121            Self::Sprint => 4,
122            Self::WellsFargo => 5,
123            Self::Merrill => 6,
124            Self::Citi => 7,
125            Self::Cnet => 8,
126            Self::Gap => 9,
127            Self::Microsoft => 10,
128            Self::United => 11,
129            Self::Yahoo => 12,
130            Self::Zonelabs => 13,
131            Self::PayPal => 14,
132            Self::Avon => 15,
133            Self::Diapers => 16,
134            Self::Contacts => 17,
135            Self::Amazon => 18,
136            Self::Cox => 19,
137            Self::Norton => 20,
138            Self::Verizon => 21,
139            Self::Buy => 22,
140            Self::Sirius => 23,
141            Self::Ea => 24,
142            Self::Basecamp => 25,
143            Self::Steam => 26,
144            Self::Chart => 27,
145            Self::Gotomeeting => 28,
146            Self::Gogo => 29,
147            Self::Oracle => 30,
148            Self::Discover => 31,
149            Self::Dcu => 32,
150            Self::Healthcare => 33,
151            Self::Pepco => 34,
152            Self::Century21 => 35,
153            Self::Comcast => 36,
154            Self::Cricket => 37,
155            Self::Mtb => 38,
156            Self::Dropbox => 39,
157            Self::Snapfish => 40,
158            Self::Alibaba => 41,
159            Self::Playstation => 42,
160            Self::Mercado => 43,
161            Self::Zendesk => 44,
162            Self::Autodesk => 45,
163            Self::RailNation => 46,
164            Self::Wpcu => 47,
165            Self::Mathletics => 48,
166            Self::Discountbank => 49,
167            Self::Mi => 50,
168            Self::Facebook => 51,
169            Self::Postepay => 52,
170            Self::Skysports => 53,
171            Self::Disney => 54,
172            Self::Pokemon => 55,
173            Self::Uv => 56,
174            Self::Yahavo => 57,
175            Self::Mdsol => 58,
176            Self::Sears => 59,
177            Self::Xiami => 60,
178            Self::Belkin => 61,
179            Self::Turbotax => 62,
180            Self::Shopify => 63,
181            Self::Ebay => 64,
182            Self::Techdata => 65,
183            Self::Schwab => 66,
184            Self::Mozilla => 67,
185            Self::Tesla => 68,
186            Self::MorganStanley => 69,
187            Self::TaxAct => 70,
188            Self::Wikimedia => 71,
189            Self::Airbnb => 72,
190            Self::Eventbrite => 73,
191            Self::StackExchange => 74,
192            Self::Docusign => 75,
193            Self::Envato => 76,
194            Self::X10Hosting => 77,
195            Self::Cisco => 78,
196            Self::CedarFair => 79,
197            Self::Ubiquiti => 80,
198            Self::Discord => 81,
199            Self::Netcup => 82,
200            Self::Yandex => 83,
201            Self::Sony => 84,
202            Self::Proton => 85,
203            Self::Ubisoft => 86,
204            Self::TransferWise => 87,
205            Self::TakeawayEU => 88,
206            Self::Atlassian => 89,
207            Self::Pinterest => 90,
208            Self::Twitter => 91,
209            Self::__Unknown(v) => *v,
210        }
211    }
212
213    pub fn from_i64(value: i64) -> Self {
214        match value {
215            0 => Self::Google,
216            1 => Self::Apple,
217            2 => Self::Ameritrade,
218            3 => Self::BoA,
219            4 => Self::Sprint,
220            5 => Self::WellsFargo,
221            6 => Self::Merrill,
222            7 => Self::Citi,
223            8 => Self::Cnet,
224            9 => Self::Gap,
225            10 => Self::Microsoft,
226            11 => Self::United,
227            12 => Self::Yahoo,
228            13 => Self::Zonelabs,
229            14 => Self::PayPal,
230            15 => Self::Avon,
231            16 => Self::Diapers,
232            17 => Self::Contacts,
233            18 => Self::Amazon,
234            19 => Self::Cox,
235            20 => Self::Norton,
236            21 => Self::Verizon,
237            22 => Self::Buy,
238            23 => Self::Sirius,
239            24 => Self::Ea,
240            25 => Self::Basecamp,
241            26 => Self::Steam,
242            27 => Self::Chart,
243            28 => Self::Gotomeeting,
244            29 => Self::Gogo,
245            30 => Self::Oracle,
246            31 => Self::Discover,
247            32 => Self::Dcu,
248            33 => Self::Healthcare,
249            34 => Self::Pepco,
250            35 => Self::Century21,
251            36 => Self::Comcast,
252            37 => Self::Cricket,
253            38 => Self::Mtb,
254            39 => Self::Dropbox,
255            40 => Self::Snapfish,
256            41 => Self::Alibaba,
257            42 => Self::Playstation,
258            43 => Self::Mercado,
259            44 => Self::Zendesk,
260            45 => Self::Autodesk,
261            46 => Self::RailNation,
262            47 => Self::Wpcu,
263            48 => Self::Mathletics,
264            49 => Self::Discountbank,
265            50 => Self::Mi,
266            51 => Self::Facebook,
267            52 => Self::Postepay,
268            53 => Self::Skysports,
269            54 => Self::Disney,
270            55 => Self::Pokemon,
271            56 => Self::Uv,
272            57 => Self::Yahavo,
273            58 => Self::Mdsol,
274            59 => Self::Sears,
275            60 => Self::Xiami,
276            61 => Self::Belkin,
277            62 => Self::Turbotax,
278            63 => Self::Shopify,
279            64 => Self::Ebay,
280            65 => Self::Techdata,
281            66 => Self::Schwab,
282            67 => Self::Mozilla,
283            68 => Self::Tesla,
284            69 => Self::MorganStanley,
285            70 => Self::TaxAct,
286            71 => Self::Wikimedia,
287            72 => Self::Airbnb,
288            73 => Self::Eventbrite,
289            74 => Self::StackExchange,
290            75 => Self::Docusign,
291            76 => Self::Envato,
292            77 => Self::X10Hosting,
293            78 => Self::Cisco,
294            79 => Self::CedarFair,
295            80 => Self::Ubiquiti,
296            81 => Self::Discord,
297            82 => Self::Netcup,
298            83 => Self::Yandex,
299            84 => Self::Sony,
300            85 => Self::Proton,
301            86 => Self::Ubisoft,
302            87 => Self::TransferWise,
303            88 => Self::TakeawayEU,
304            89 => Self::Atlassian,
305            90 => Self::Pinterest,
306            91 => Self::Twitter,
307            v => Self::__Unknown(v),
308        }
309    }
310}
311
312impl serde::Serialize for GlobalEquivalentDomainsType {
313    fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
314        serializer.serialize_i64(self.as_i64())
315    }
316}
317
318impl<'de> serde::Deserialize<'de> for GlobalEquivalentDomainsType {
319    fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
320        struct GlobalEquivalentDomainsTypeVisitor;
321
322        impl Visitor<'_> for GlobalEquivalentDomainsTypeVisitor {
323            type Value = GlobalEquivalentDomainsType;
324
325            fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
326                f.write_str("an integer")
327            }
328
329            fn visit_i64<E: serde::de::Error>(self, v: i64) -> Result<Self::Value, E> {
330                Ok(GlobalEquivalentDomainsType::from_i64(v))
331            }
332
333            fn visit_u64<E: serde::de::Error>(self, v: u64) -> Result<Self::Value, E> {
334                Ok(GlobalEquivalentDomainsType::from_i64(v as i64))
335            }
336        }
337
338        deserializer.deserialize_i64(GlobalEquivalentDomainsTypeVisitor)
339    }
340}
341
342impl std::fmt::Display for GlobalEquivalentDomainsType {
343    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
344        write!(f, "{}", self.as_i64())
345    }
346}
347impl Default for GlobalEquivalentDomainsType {
348    fn default() -> GlobalEquivalentDomainsType {
349        Self::Google
350    }
351}