bitwarden_api_api/models/
policy_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
/*
 * 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 PolicyType {
    TwoFactorAuthentication = 0,
    MasterPassword = 1,
    PasswordGenerator = 2,
    SingleOrg = 3,
    RequireSso = 4,
    PersonalOwnership = 5,
    DisableSend = 6,
    SendOptions = 7,
    ResetPassword = 8,
    MaximumVaultTimeout = 9,
    DisablePersonalVaultExport = 10,
    ActivateAutofill = 11,
    AutomaticAppLogIn = 12,
    FreeFamiliesSponsorshipPolicy = 13,
}

impl std::fmt::Display for PolicyType {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::TwoFactorAuthentication => write!(f, "0"),
            Self::MasterPassword => write!(f, "1"),
            Self::PasswordGenerator => write!(f, "2"),
            Self::SingleOrg => write!(f, "3"),
            Self::RequireSso => write!(f, "4"),
            Self::PersonalOwnership => write!(f, "5"),
            Self::DisableSend => write!(f, "6"),
            Self::SendOptions => write!(f, "7"),
            Self::ResetPassword => write!(f, "8"),
            Self::MaximumVaultTimeout => write!(f, "9"),
            Self::DisablePersonalVaultExport => write!(f, "10"),
            Self::ActivateAutofill => write!(f, "11"),
            Self::AutomaticAppLogIn => write!(f, "12"),
            Self::FreeFamiliesSponsorshipPolicy => write!(f, "13"),
        }
    }
}

impl Default for PolicyType {
    fn default() -> PolicyType {
        Self::TwoFactorAuthentication
    }
}