bitwarden_api_api/models/
device_type.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
 * Bitwarden Internal API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: latest
 *
 * Generated by: https://openapi-generator.tech
 */

use serde::{Deserialize, Serialize};

use crate::models;

///
#[repr(i64)]
#[derive(
    Clone,
    Copy,
    Debug,
    Eq,
    PartialEq,
    Ord,
    PartialOrd,
    Hash,
    serde_repr::Serialize_repr,
    serde_repr::Deserialize_repr,
)]
pub enum DeviceType {
    Android = 0,
    iOS = 1,
    ChromeExtension = 2,
    FirefoxExtension = 3,
    OperaExtension = 4,
    EdgeExtension = 5,
    WindowsDesktop = 6,
    MacOsDesktop = 7,
    LinuxDesktop = 8,
    ChromeBrowser = 9,
    FirefoxBrowser = 10,
    OperaBrowser = 11,
    EdgeBrowser = 12,
    IEBrowser = 13,
    UnknownBrowser = 14,
    AndroidAmazon = 15,
    UWP = 16,
    SafariBrowser = 17,
    VivaldiBrowser = 18,
    VivaldiExtension = 19,
    SafariExtension = 20,
    SDK = 21,
    Server = 22,
    WindowsCLI = 23,
    MacOsCLI = 24,
    LinuxCLI = 25,
}

impl std::fmt::Display for DeviceType {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Android => write!(f, "0"),
            Self::iOS => write!(f, "1"),
            Self::ChromeExtension => write!(f, "2"),
            Self::FirefoxExtension => write!(f, "3"),
            Self::OperaExtension => write!(f, "4"),
            Self::EdgeExtension => write!(f, "5"),
            Self::WindowsDesktop => write!(f, "6"),
            Self::MacOsDesktop => write!(f, "7"),
            Self::LinuxDesktop => write!(f, "8"),
            Self::ChromeBrowser => write!(f, "9"),
            Self::FirefoxBrowser => write!(f, "10"),
            Self::OperaBrowser => write!(f, "11"),
            Self::EdgeBrowser => write!(f, "12"),
            Self::IEBrowser => write!(f, "13"),
            Self::UnknownBrowser => write!(f, "14"),
            Self::AndroidAmazon => write!(f, "15"),
            Self::UWP => write!(f, "16"),
            Self::SafariBrowser => write!(f, "17"),
            Self::VivaldiBrowser => write!(f, "18"),
            Self::VivaldiExtension => write!(f, "19"),
            Self::SafariExtension => write!(f, "20"),
            Self::SDK => write!(f, "21"),
            Self::Server => write!(f, "22"),
            Self::WindowsCLI => write!(f, "23"),
            Self::MacOsCLI => write!(f, "24"),
            Self::LinuxCLI => write!(f, "25"),
        }
    }
}

impl Default for DeviceType {
    fn default() -> DeviceType {
        Self::Android
    }
}