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