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 Collection_Created = 1300,
52 Collection_Updated = 1301,
53 Collection_Deleted = 1302,
54 Group_Created = 1400,
55 Group_Updated = 1401,
56 Group_Deleted = 1402,
57 OrganizationUser_Invited = 1500,
58 OrganizationUser_Confirmed = 1501,
59 OrganizationUser_Updated = 1502,
60 OrganizationUser_Removed = 1503,
61 OrganizationUser_UpdatedGroups = 1504,
62 OrganizationUser_UnlinkedSso = 1505,
63 OrganizationUser_ResetPassword_Enroll = 1506,
64 OrganizationUser_ResetPassword_Withdraw = 1507,
65 OrganizationUser_AdminResetPassword = 1508,
66 OrganizationUser_ResetSsoLink = 1509,
67 OrganizationUser_FirstSsoLogin = 1510,
68 OrganizationUser_Revoked = 1511,
69 OrganizationUser_Restored = 1512,
70 OrganizationUser_ApprovedAuthRequest = 1513,
71 OrganizationUser_RejectedAuthRequest = 1514,
72 OrganizationUser_Deleted = 1515,
73 OrganizationUser_Left = 1516,
74 OrganizationUser_AutomaticallyConfirmed = 1517,
75 OrganizationUser_SelfRevoked = 1518,
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 Organization_CollectionManagement_LimitCollectionCreationEnabled = 1610,
87 Organization_CollectionManagement_LimitCollectionCreationDisabled = 1611,
88 Organization_CollectionManagement_LimitCollectionDeletionEnabled = 1612,
89 Organization_CollectionManagement_LimitCollectionDeletionDisabled = 1613,
90 Organization_CollectionManagement_LimitItemDeletionEnabled = 1614,
91 Organization_CollectionManagement_LimitItemDeletionDisabled = 1615,
92 Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled = 1616,
93 Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled = 1617,
94 Organization_ItemOrganization_Accepted = 1618,
95 Organization_ItemOrganization_Declined = 1619,
96 Policy_Updated = 1700,
97 ProviderUser_Invited = 1800,
98 ProviderUser_Confirmed = 1801,
99 ProviderUser_Updated = 1802,
100 ProviderUser_Removed = 1803,
101 ProviderOrganization_Created = 1900,
102 ProviderOrganization_Added = 1901,
103 ProviderOrganization_Removed = 1902,
104 ProviderOrganization_VaultAccessed = 1903,
105 OrganizationDomain_Added = 2000,
106 OrganizationDomain_Removed = 2001,
107 OrganizationDomain_Verified = 2002,
108 OrganizationDomain_NotVerified = 2003,
109 Secret_Retrieved = 2100,
110 Secret_Created = 2101,
111 Secret_Edited = 2102,
112 Secret_Deleted = 2103,
113 Secret_Permanently_Deleted = 2104,
114 Secret_Restored = 2105,
115 Project_Retrieved = 2200,
116 Project_Created = 2201,
117 Project_Edited = 2202,
118 Project_Deleted = 2203,
119 ServiceAccount_UserAdded = 2300,
120 ServiceAccount_UserRemoved = 2301,
121 ServiceAccount_GroupAdded = 2302,
122 ServiceAccount_GroupRemoved = 2303,
123 ServiceAccount_Created = 2304,
124 ServiceAccount_Deleted = 2305,
125}
126
127impl std::fmt::Display for EventType {
128 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
129 write!(f, "{}", match self {
130 Self::User_LoggedIn => "1000",
131 Self::User_ChangedPassword => "1001",
132 Self::User_Updated2fa => "1002",
133 Self::User_Disabled2fa => "1003",
134 Self::User_Recovered2fa => "1004",
135 Self::User_FailedLogIn => "1005",
136 Self::User_FailedLogIn2fa => "1006",
137 Self::User_ClientExportedVault => "1007",
138 Self::User_UpdatedTempPassword => "1008",
139 Self::User_MigratedKeyToKeyConnector => "1009",
140 Self::User_RequestedDeviceApproval => "1010",
141 Self::User_TdeOffboardingPasswordSet => "1011",
142 Self::Cipher_Created => "1100",
143 Self::Cipher_Updated => "1101",
144 Self::Cipher_Deleted => "1102",
145 Self::Cipher_AttachmentCreated => "1103",
146 Self::Cipher_AttachmentDeleted => "1104",
147 Self::Cipher_Shared => "1105",
148 Self::Cipher_UpdatedCollections => "1106",
149 Self::Cipher_ClientViewed => "1107",
150 Self::Cipher_ClientToggledPasswordVisible => "1108",
151 Self::Cipher_ClientToggledHiddenFieldVisible => "1109",
152 Self::Cipher_ClientToggledCardCodeVisible => "1110",
153 Self::Cipher_ClientCopiedPassword => "1111",
154 Self::Cipher_ClientCopiedHiddenField => "1112",
155 Self::Cipher_ClientCopiedCardCode => "1113",
156 Self::Cipher_ClientAutofilled => "1114",
157 Self::Cipher_SoftDeleted => "1115",
158 Self::Cipher_Restored => "1116",
159 Self::Cipher_ClientToggledCardNumberVisible => "1117",
160 Self::Collection_Created => "1300",
161 Self::Collection_Updated => "1301",
162 Self::Collection_Deleted => "1302",
163 Self::Group_Created => "1400",
164 Self::Group_Updated => "1401",
165 Self::Group_Deleted => "1402",
166 Self::OrganizationUser_Invited => "1500",
167 Self::OrganizationUser_Confirmed => "1501",
168 Self::OrganizationUser_Updated => "1502",
169 Self::OrganizationUser_Removed => "1503",
170 Self::OrganizationUser_UpdatedGroups => "1504",
171 Self::OrganizationUser_UnlinkedSso => "1505",
172 Self::OrganizationUser_ResetPassword_Enroll => "1506",
173 Self::OrganizationUser_ResetPassword_Withdraw => "1507",
174 Self::OrganizationUser_AdminResetPassword => "1508",
175 Self::OrganizationUser_ResetSsoLink => "1509",
176 Self::OrganizationUser_FirstSsoLogin => "1510",
177 Self::OrganizationUser_Revoked => "1511",
178 Self::OrganizationUser_Restored => "1512",
179 Self::OrganizationUser_ApprovedAuthRequest => "1513",
180 Self::OrganizationUser_RejectedAuthRequest => "1514",
181 Self::OrganizationUser_Deleted => "1515",
182 Self::OrganizationUser_Left => "1516",
183 Self::OrganizationUser_AutomaticallyConfirmed => "1517",
184 Self::OrganizationUser_SelfRevoked => "1518",
185 Self::Organization_Updated => "1600",
186 Self::Organization_PurgedVault => "1601",
187 Self::Organization_ClientExportedVault => "1602",
188 Self::Organization_VaultAccessed => "1603",
189 Self::Organization_EnabledSso => "1604",
190 Self::Organization_DisabledSso => "1605",
191 Self::Organization_EnabledKeyConnector => "1606",
192 Self::Organization_DisabledKeyConnector => "1607",
193 Self::Organization_SponsorshipsSynced => "1608",
194 Self::Organization_CollectionManagement_Updated => "1609",
195 Self::Organization_CollectionManagement_LimitCollectionCreationEnabled => "1610",
196 Self::Organization_CollectionManagement_LimitCollectionCreationDisabled => "1611",
197 Self::Organization_CollectionManagement_LimitCollectionDeletionEnabled => "1612",
198 Self::Organization_CollectionManagement_LimitCollectionDeletionDisabled => "1613",
199 Self::Organization_CollectionManagement_LimitItemDeletionEnabled => "1614",
200 Self::Organization_CollectionManagement_LimitItemDeletionDisabled => "1615",
201 Self::Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled => "1616",
202 Self::Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled => "1617",
203 Self::Organization_ItemOrganization_Accepted => "1618",
204 Self::Organization_ItemOrganization_Declined => "1619",
205 Self::Policy_Updated => "1700",
206 Self::ProviderUser_Invited => "1800",
207 Self::ProviderUser_Confirmed => "1801",
208 Self::ProviderUser_Updated => "1802",
209 Self::ProviderUser_Removed => "1803",
210 Self::ProviderOrganization_Created => "1900",
211 Self::ProviderOrganization_Added => "1901",
212 Self::ProviderOrganization_Removed => "1902",
213 Self::ProviderOrganization_VaultAccessed => "1903",
214 Self::OrganizationDomain_Added => "2000",
215 Self::OrganizationDomain_Removed => "2001",
216 Self::OrganizationDomain_Verified => "2002",
217 Self::OrganizationDomain_NotVerified => "2003",
218 Self::Secret_Retrieved => "2100",
219 Self::Secret_Created => "2101",
220 Self::Secret_Edited => "2102",
221 Self::Secret_Deleted => "2103",
222 Self::Secret_Permanently_Deleted => "2104",
223 Self::Secret_Restored => "2105",
224 Self::Project_Retrieved => "2200",
225 Self::Project_Created => "2201",
226 Self::Project_Edited => "2202",
227 Self::Project_Deleted => "2203",
228 Self::ServiceAccount_UserAdded => "2300",
229 Self::ServiceAccount_UserRemoved => "2301",
230 Self::ServiceAccount_GroupAdded => "2302",
231 Self::ServiceAccount_GroupRemoved => "2303",
232 Self::ServiceAccount_Created => "2304",
233 Self::ServiceAccount_Deleted => "2305",
234 })
235 }
236}
237impl Default for EventType {
238 fn default() -> EventType {
239 Self::User_LoggedIn
240 }
241}