1use 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 EventType {
21 User_LoggedIn = 1000,
22 User_ChangedPassword = 1001,
23 User_Updated2fa = 1002,
24 User_Disabled2fa = 1003,
25 User_Recovered2fa = 1004,
26 User_FailedLogIn = 1005,
27 User_FailedLogIn2fa = 1006,
28 User_ClientExportedVault = 1007,
29 User_UpdatedTempPassword = 1008,
30 User_MigratedKeyToKeyConnector = 1009,
31 User_RequestedDeviceApproval = 1010,
32 User_TdeOffboardingPasswordSet = 1011,
33 Cipher_Created = 1100,
34 Cipher_Updated = 1101,
35 Cipher_Deleted = 1102,
36 Cipher_AttachmentCreated = 1103,
37 Cipher_AttachmentDeleted = 1104,
38 Cipher_Shared = 1105,
39 Cipher_UpdatedCollections = 1106,
40 Cipher_ClientViewed = 1107,
41 Cipher_ClientToggledPasswordVisible = 1108,
42 Cipher_ClientToggledHiddenFieldVisible = 1109,
43 Cipher_ClientToggledCardCodeVisible = 1110,
44 Cipher_ClientCopiedPassword = 1111,
45 Cipher_ClientCopiedHiddenField = 1112,
46 Cipher_ClientCopiedCardCode = 1113,
47 Cipher_ClientAutofilled = 1114,
48 Cipher_SoftDeleted = 1115,
49 Cipher_Restored = 1116,
50 Cipher_ClientToggledCardNumberVisible = 1117,
51 Cipher_Archived = 1118,
52 Cipher_Unarchived = 1119,
53 Collection_Created = 1300,
54 Collection_Updated = 1301,
55 Collection_Deleted = 1302,
56 Group_Created = 1400,
57 Group_Updated = 1401,
58 Group_Deleted = 1402,
59 OrganizationUser_Invited = 1500,
60 OrganizationUser_Confirmed = 1501,
61 OrganizationUser_Updated = 1502,
62 OrganizationUser_Removed = 1503,
63 OrganizationUser_UpdatedGroups = 1504,
64 OrganizationUser_UnlinkedSso = 1505,
65 OrganizationUser_ResetPassword_Enroll = 1506,
66 OrganizationUser_ResetPassword_Withdraw = 1507,
67 OrganizationUser_AdminResetPassword = 1508,
68 OrganizationUser_ResetSsoLink = 1509,
69 OrganizationUser_FirstSsoLogin = 1510,
70 OrganizationUser_Revoked = 1511,
71 OrganizationUser_Restored = 1512,
72 OrganizationUser_ApprovedAuthRequest = 1513,
73 OrganizationUser_RejectedAuthRequest = 1514,
74 OrganizationUser_Deleted = 1515,
75 OrganizationUser_Left = 1516,
76 Organization_Updated = 1600,
77 Organization_PurgedVault = 1601,
78 Organization_ClientExportedVault = 1602,
79 Organization_VaultAccessed = 1603,
80 Organization_EnabledSso = 1604,
81 Organization_DisabledSso = 1605,
82 Organization_EnabledKeyConnector = 1606,
83 Organization_DisabledKeyConnector = 1607,
84 Organization_SponsorshipsSynced = 1608,
85 Organization_CollectionManagement_Updated = 1609,
86 Policy_Updated = 1700,
87 ProviderUser_Invited = 1800,
88 ProviderUser_Confirmed = 1801,
89 ProviderUser_Updated = 1802,
90 ProviderUser_Removed = 1803,
91 ProviderOrganization_Created = 1900,
92 ProviderOrganization_Added = 1901,
93 ProviderOrganization_Removed = 1902,
94 ProviderOrganization_VaultAccessed = 1903,
95 OrganizationDomain_Added = 2000,
96 OrganizationDomain_Removed = 2001,
97 OrganizationDomain_Verified = 2002,
98 OrganizationDomain_NotVerified = 2003,
99 Secret_Retrieved = 2100,
100 Secret_Created = 2101,
101 Secret_Edited = 2102,
102 Secret_Deleted = 2103,
103}
104
105impl std::fmt::Display for EventType {
106 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
107 write!(
108 f,
109 "{}",
110 match self {
111 Self::User_LoggedIn => "1000",
112 Self::User_ChangedPassword => "1001",
113 Self::User_Updated2fa => "1002",
114 Self::User_Disabled2fa => "1003",
115 Self::User_Recovered2fa => "1004",
116 Self::User_FailedLogIn => "1005",
117 Self::User_FailedLogIn2fa => "1006",
118 Self::User_ClientExportedVault => "1007",
119 Self::User_UpdatedTempPassword => "1008",
120 Self::User_MigratedKeyToKeyConnector => "1009",
121 Self::User_RequestedDeviceApproval => "1010",
122 Self::User_TdeOffboardingPasswordSet => "1011",
123 Self::Cipher_Created => "1100",
124 Self::Cipher_Updated => "1101",
125 Self::Cipher_Deleted => "1102",
126 Self::Cipher_AttachmentCreated => "1103",
127 Self::Cipher_AttachmentDeleted => "1104",
128 Self::Cipher_Shared => "1105",
129 Self::Cipher_UpdatedCollections => "1106",
130 Self::Cipher_ClientViewed => "1107",
131 Self::Cipher_ClientToggledPasswordVisible => "1108",
132 Self::Cipher_ClientToggledHiddenFieldVisible => "1109",
133 Self::Cipher_ClientToggledCardCodeVisible => "1110",
134 Self::Cipher_ClientCopiedPassword => "1111",
135 Self::Cipher_ClientCopiedHiddenField => "1112",
136 Self::Cipher_ClientCopiedCardCode => "1113",
137 Self::Cipher_ClientAutofilled => "1114",
138 Self::Cipher_SoftDeleted => "1115",
139 Self::Cipher_Restored => "1116",
140 Self::Cipher_ClientToggledCardNumberVisible => "1117",
141 Self::Cipher_Archived => "1118",
142 Self::Cipher_Unarchived => "1119",
143 Self::Collection_Created => "1300",
144 Self::Collection_Updated => "1301",
145 Self::Collection_Deleted => "1302",
146 Self::Group_Created => "1400",
147 Self::Group_Updated => "1401",
148 Self::Group_Deleted => "1402",
149 Self::OrganizationUser_Invited => "1500",
150 Self::OrganizationUser_Confirmed => "1501",
151 Self::OrganizationUser_Updated => "1502",
152 Self::OrganizationUser_Removed => "1503",
153 Self::OrganizationUser_UpdatedGroups => "1504",
154 Self::OrganizationUser_UnlinkedSso => "1505",
155 Self::OrganizationUser_ResetPassword_Enroll => "1506",
156 Self::OrganizationUser_ResetPassword_Withdraw => "1507",
157 Self::OrganizationUser_AdminResetPassword => "1508",
158 Self::OrganizationUser_ResetSsoLink => "1509",
159 Self::OrganizationUser_FirstSsoLogin => "1510",
160 Self::OrganizationUser_Revoked => "1511",
161 Self::OrganizationUser_Restored => "1512",
162 Self::OrganizationUser_ApprovedAuthRequest => "1513",
163 Self::OrganizationUser_RejectedAuthRequest => "1514",
164 Self::OrganizationUser_Deleted => "1515",
165 Self::OrganizationUser_Left => "1516",
166 Self::Organization_Updated => "1600",
167 Self::Organization_PurgedVault => "1601",
168 Self::Organization_ClientExportedVault => "1602",
169 Self::Organization_VaultAccessed => "1603",
170 Self::Organization_EnabledSso => "1604",
171 Self::Organization_DisabledSso => "1605",
172 Self::Organization_EnabledKeyConnector => "1606",
173 Self::Organization_DisabledKeyConnector => "1607",
174 Self::Organization_SponsorshipsSynced => "1608",
175 Self::Organization_CollectionManagement_Updated => "1609",
176 Self::Policy_Updated => "1700",
177 Self::ProviderUser_Invited => "1800",
178 Self::ProviderUser_Confirmed => "1801",
179 Self::ProviderUser_Updated => "1802",
180 Self::ProviderUser_Removed => "1803",
181 Self::ProviderOrganization_Created => "1900",
182 Self::ProviderOrganization_Added => "1901",
183 Self::ProviderOrganization_Removed => "1902",
184 Self::ProviderOrganization_VaultAccessed => "1903",
185 Self::OrganizationDomain_Added => "2000",
186 Self::OrganizationDomain_Removed => "2001",
187 Self::OrganizationDomain_Verified => "2002",
188 Self::OrganizationDomain_NotVerified => "2003",
189 Self::Secret_Retrieved => "2100",
190 Self::Secret_Created => "2101",
191 Self::Secret_Edited => "2102",
192 Self::Secret_Deleted => "2103",
193 }
194 )
195 }
196}
197impl Default for EventType {
198 fn default() -> EventType {
199 Self::User_LoggedIn
200 }
201}