bitwarden_api_api/models/
policy_type.rs1use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15#[repr(i64)]
17#[derive(
18 Clone,
19 Copy,
20 Debug,
21 Eq,
22 PartialEq,
23 Ord,
24 PartialOrd,
25 Hash,
26 serde_repr::Serialize_repr,
27 serde_repr::Deserialize_repr,
28)]
29pub enum PolicyType {
30 TwoFactorAuthentication = 0,
31 MasterPassword = 1,
32 PasswordGenerator = 2,
33 SingleOrg = 3,
34 RequireSso = 4,
35 PersonalOwnership = 5,
36 DisableSend = 6,
37 SendOptions = 7,
38 ResetPassword = 8,
39 MaximumVaultTimeout = 9,
40 DisablePersonalVaultExport = 10,
41 ActivateAutofill = 11,
42 AutomaticAppLogIn = 12,
43 FreeFamiliesSponsorshipPolicy = 13,
44 RemoveUnlockWithPin = 14,
45}
46
47impl std::fmt::Display for PolicyType {
48 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
49 match self {
50 Self::TwoFactorAuthentication => write!(f, "0"),
51 Self::MasterPassword => write!(f, "1"),
52 Self::PasswordGenerator => write!(f, "2"),
53 Self::SingleOrg => write!(f, "3"),
54 Self::RequireSso => write!(f, "4"),
55 Self::PersonalOwnership => write!(f, "5"),
56 Self::DisableSend => write!(f, "6"),
57 Self::SendOptions => write!(f, "7"),
58 Self::ResetPassword => write!(f, "8"),
59 Self::MaximumVaultTimeout => write!(f, "9"),
60 Self::DisablePersonalVaultExport => write!(f, "10"),
61 Self::ActivateAutofill => write!(f, "11"),
62 Self::AutomaticAppLogIn => write!(f, "12"),
63 Self::FreeFamiliesSponsorshipPolicy => write!(f, "13"),
64 Self::RemoveUnlockWithPin => write!(f, "14"),
65 }
66 }
67}
68
69impl Default for PolicyType {
70 fn default() -> PolicyType {
71 Self::TwoFactorAuthentication
72 }
73}