bitwarden_api_api/models/
policy_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, Serialize};
12use serde_repr::{Deserialize_repr, Serialize_repr};
13
14use crate::models;
15///
16#[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    BlockClaimedDomainAccountCreation = 19,
41}
42
43impl std::fmt::Display for PolicyType {
44    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
45        write!(
46            f,
47            "{}",
48            match self {
49                Self::TwoFactorAuthentication => "0",
50                Self::MasterPassword => "1",
51                Self::PasswordGenerator => "2",
52                Self::SingleOrg => "3",
53                Self::RequireSso => "4",
54                Self::OrganizationDataOwnership => "5",
55                Self::DisableSend => "6",
56                Self::SendOptions => "7",
57                Self::ResetPassword => "8",
58                Self::MaximumVaultTimeout => "9",
59                Self::DisablePersonalVaultExport => "10",
60                Self::ActivateAutofill => "11",
61                Self::AutomaticAppLogIn => "12",
62                Self::FreeFamiliesSponsorshipPolicy => "13",
63                Self::RemoveUnlockWithPin => "14",
64                Self::RestrictedItemTypesPolicy => "15",
65                Self::UriMatchDefaults => "16",
66                Self::AutotypeDefaultSetting => "17",
67                Self::AutomaticUserConfirmation => "18",
68                Self::BlockClaimedDomainAccountCreation => "19",
69            }
70        )
71    }
72}
73impl Default for PolicyType {
74    fn default() -> PolicyType {
75        Self::TwoFactorAuthentication
76    }
77}