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    PersonalOwnership = 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}
37
38impl std::fmt::Display for PolicyType {
39    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
40        write!(
41            f,
42            "{}",
43            match self {
44                Self::TwoFactorAuthentication => "0",
45                Self::MasterPassword => "1",
46                Self::PasswordGenerator => "2",
47                Self::SingleOrg => "3",
48                Self::RequireSso => "4",
49                Self::PersonalOwnership => "5",
50                Self::DisableSend => "6",
51                Self::SendOptions => "7",
52                Self::ResetPassword => "8",
53                Self::MaximumVaultTimeout => "9",
54                Self::DisablePersonalVaultExport => "10",
55                Self::ActivateAutofill => "11",
56                Self::AutomaticAppLogIn => "12",
57                Self::FreeFamiliesSponsorshipPolicy => "13",
58                Self::RemoveUnlockWithPin => "14",
59            }
60        )
61    }
62}
63impl Default for PolicyType {
64    fn default() -> PolicyType {
65        Self::TwoFactorAuthentication
66    }
67}