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