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