Skip to main content

bitwarden_api_api/models/
event_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, Deserializer, Serialize, Serializer, de::Visitor};
12
13use crate::models;
14///
15#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
16pub enum EventType {
17    User_LoggedIn,
18    User_ChangedPassword,
19    User_Updated2fa,
20    User_Disabled2fa,
21    User_Recovered2fa,
22    User_FailedLogIn,
23    User_FailedLogIn2fa,
24    User_ClientExportedVault,
25    User_UpdatedTempPassword,
26    User_MigratedKeyToKeyConnector,
27    User_RequestedDeviceApproval,
28    User_TdeOffboardingPasswordSet,
29    Cipher_Created,
30    Cipher_Updated,
31    Cipher_Deleted,
32    Cipher_AttachmentCreated,
33    Cipher_AttachmentDeleted,
34    Cipher_Shared,
35    Cipher_UpdatedCollections,
36    Cipher_ClientViewed,
37    Cipher_ClientToggledPasswordVisible,
38    Cipher_ClientToggledHiddenFieldVisible,
39    Cipher_ClientToggledCardCodeVisible,
40    Cipher_ClientCopiedPassword,
41    Cipher_ClientCopiedHiddenField,
42    Cipher_ClientCopiedCardCode,
43    Cipher_ClientAutofilled,
44    Cipher_SoftDeleted,
45    Cipher_Restored,
46    Cipher_ClientToggledCardNumberVisible,
47    Cipher_ClientToggledTOTPSeedVisible,
48    Cipher_ClientCopiedBankAccountNumber,
49    Cipher_ClientCopiedBankAccountPin,
50    Cipher_ClientToggledBankAccountNumberVisible,
51    Cipher_ClientToggledBankAccountPinVisible,
52    Cipher_ClientCopiedLicenseNumber,
53    Cipher_ClientToggledLicenseNumberVisible,
54    Cipher_ClientCopiedPassportNumber,
55    Cipher_ClientToggledPassportNumberVisible,
56    Cipher_ClientCopiedSwiftCode,
57    Cipher_ClientToggledSwiftCodeVisible,
58    Cipher_ClientCopiedIban,
59    Cipher_ClientToggledIbanVisible,
60    Cipher_ClientCopiedNationalIdentificationNumber,
61    Cipher_ClientToggledNationalIdentificationNumberVisible,
62    Cipher_ClientHttpAuthReleased,
63    Collection_Created,
64    Collection_Updated,
65    Collection_Deleted,
66    Group_Created,
67    Group_Updated,
68    Group_Deleted,
69    OrganizationUser_Invited,
70    OrganizationUser_Confirmed,
71    OrganizationUser_Updated,
72    OrganizationUser_Removed,
73    OrganizationUser_UpdatedGroups,
74    OrganizationUser_UnlinkedSso,
75    OrganizationUser_ResetPassword_Enroll,
76    OrganizationUser_ResetPassword_Withdraw,
77    OrganizationUser_AdminResetPassword,
78    OrganizationUser_ResetSsoLink,
79    OrganizationUser_FirstSsoLogin,
80    OrganizationUser_Revoked,
81    OrganizationUser_Restored,
82    OrganizationUser_ApprovedAuthRequest,
83    OrganizationUser_RejectedAuthRequest,
84    OrganizationUser_Deleted,
85    OrganizationUser_Left,
86    OrganizationUser_AutomaticallyConfirmed,
87    OrganizationUser_SelfRevoked,
88    OrganizationUser_AdminResetTwoFactor,
89    OrganizationUser_Revoked_TwoFactorNonCompliance,
90    OrganizationUser_Revoked_SingleOrganizationNonCompliance,
91    OrganizationUser_NotificationBannerActionClicked,
92    OrganizationUser_Staged,
93    OrganizationUser_InviteLinkAccepted,
94    OrganizationUser_AdminChangedEmail,
95    OrganizationUser_InviteLinkConfirmed,
96    Organization_Updated,
97    Organization_PurgedVault,
98    Organization_ClientExportedVault,
99    Organization_VaultAccessed,
100    Organization_EnabledSso,
101    Organization_DisabledSso,
102    Organization_EnabledKeyConnector,
103    Organization_DisabledKeyConnector,
104    Organization_SponsorshipsSynced,
105    Organization_CollectionManagement_Updated,
106    Organization_CollectionManagement_LimitCollectionCreationEnabled,
107    Organization_CollectionManagement_LimitCollectionCreationDisabled,
108    Organization_CollectionManagement_LimitCollectionDeletionEnabled,
109    Organization_CollectionManagement_LimitCollectionDeletionDisabled,
110    Organization_CollectionManagement_LimitItemDeletionEnabled,
111    Organization_CollectionManagement_LimitItemDeletionDisabled,
112    Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled,
113    Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled,
114    Organization_ItemOrganization_Accepted,
115    Organization_ItemOrganization_Declined,
116    Organization_AutoConfirmEnabled_Admin,
117    Organization_AutoConfirmDisabled_Admin,
118    Organization_AutoConfirmEnabled_Portal,
119    Organization_AutoConfirmDisabled_Portal,
120    Organization_InviteLinkCreated,
121    Organization_InviteLinkDomainsEdited,
122    Organization_InviteLinkDeleted,
123    Organization_InviteLinkClientCopied,
124    Organization_InviteLinkRefreshed,
125    Organization_InviteLinkConfirmEnabled,
126    Organization_InviteLinkConfirmDisabled,
127    Policy_Updated,
128    ProviderUser_Invited,
129    ProviderUser_Confirmed,
130    ProviderUser_Updated,
131    ProviderUser_Removed,
132    ProviderOrganization_Created,
133    ProviderOrganization_Added,
134    ProviderOrganization_Removed,
135    ProviderOrganization_VaultAccessed,
136    OrganizationDomain_Added,
137    OrganizationDomain_Removed,
138    OrganizationDomain_Verified,
139    OrganizationDomain_NotVerified,
140    Secret_Retrieved,
141    Secret_Created,
142    Secret_Edited,
143    Secret_Deleted,
144    Secret_Permanently_Deleted,
145    Secret_Restored,
146    Project_Retrieved,
147    Project_Created,
148    Project_Edited,
149    Project_Deleted,
150    ServiceAccount_UserAdded,
151    ServiceAccount_UserRemoved,
152    ServiceAccount_GroupAdded,
153    ServiceAccount_GroupRemoved,
154    ServiceAccount_Created,
155    ServiceAccount_Deleted,
156    PhishingBlocker_SiteAccessed,
157    PhishingBlocker_SiteExited,
158    PhishingBlocker_Bypassed,
159    Send_Created_Text,
160    Send_Created_Text_WithEmailVerification,
161    Send_Created_Text_WithPasswordProtection,
162    Send_Created_File,
163    Send_Created_File_WithEmailVerification,
164    Send_Created_File_WithPasswordProtection,
165    Send_Edited_Text,
166    Send_Edited_File,
167    Send_Deleted_Text,
168    Send_Deleted_File,
169    Send_Accessed_Text,
170    Send_Accessed_File,
171    Send_PolicyDisabled,
172    Send_PolicyEnabled,
173
174    /// Unknown value returned from the server. This is used to handle forward compatibility.
175    __Unknown(i64),
176}
177
178impl EventType {
179    pub fn as_i64(&self) -> i64 {
180        match self {
181            Self::User_LoggedIn => 1000,
182            Self::User_ChangedPassword => 1001,
183            Self::User_Updated2fa => 1002,
184            Self::User_Disabled2fa => 1003,
185            Self::User_Recovered2fa => 1004,
186            Self::User_FailedLogIn => 1005,
187            Self::User_FailedLogIn2fa => 1006,
188            Self::User_ClientExportedVault => 1007,
189            Self::User_UpdatedTempPassword => 1008,
190            Self::User_MigratedKeyToKeyConnector => 1009,
191            Self::User_RequestedDeviceApproval => 1010,
192            Self::User_TdeOffboardingPasswordSet => 1011,
193            Self::Cipher_Created => 1100,
194            Self::Cipher_Updated => 1101,
195            Self::Cipher_Deleted => 1102,
196            Self::Cipher_AttachmentCreated => 1103,
197            Self::Cipher_AttachmentDeleted => 1104,
198            Self::Cipher_Shared => 1105,
199            Self::Cipher_UpdatedCollections => 1106,
200            Self::Cipher_ClientViewed => 1107,
201            Self::Cipher_ClientToggledPasswordVisible => 1108,
202            Self::Cipher_ClientToggledHiddenFieldVisible => 1109,
203            Self::Cipher_ClientToggledCardCodeVisible => 1110,
204            Self::Cipher_ClientCopiedPassword => 1111,
205            Self::Cipher_ClientCopiedHiddenField => 1112,
206            Self::Cipher_ClientCopiedCardCode => 1113,
207            Self::Cipher_ClientAutofilled => 1114,
208            Self::Cipher_SoftDeleted => 1115,
209            Self::Cipher_Restored => 1116,
210            Self::Cipher_ClientToggledCardNumberVisible => 1117,
211            Self::Cipher_ClientToggledTOTPSeedVisible => 1118,
212            Self::Cipher_ClientCopiedBankAccountNumber => 1119,
213            Self::Cipher_ClientCopiedBankAccountPin => 1120,
214            Self::Cipher_ClientToggledBankAccountNumberVisible => 1121,
215            Self::Cipher_ClientToggledBankAccountPinVisible => 1122,
216            Self::Cipher_ClientCopiedLicenseNumber => 1123,
217            Self::Cipher_ClientToggledLicenseNumberVisible => 1124,
218            Self::Cipher_ClientCopiedPassportNumber => 1125,
219            Self::Cipher_ClientToggledPassportNumberVisible => 1126,
220            Self::Cipher_ClientCopiedSwiftCode => 1127,
221            Self::Cipher_ClientToggledSwiftCodeVisible => 1128,
222            Self::Cipher_ClientCopiedIban => 1129,
223            Self::Cipher_ClientToggledIbanVisible => 1130,
224            Self::Cipher_ClientCopiedNationalIdentificationNumber => 1131,
225            Self::Cipher_ClientToggledNationalIdentificationNumberVisible => 1132,
226            Self::Cipher_ClientHttpAuthReleased => 1133,
227            Self::Collection_Created => 1300,
228            Self::Collection_Updated => 1301,
229            Self::Collection_Deleted => 1302,
230            Self::Group_Created => 1400,
231            Self::Group_Updated => 1401,
232            Self::Group_Deleted => 1402,
233            Self::OrganizationUser_Invited => 1500,
234            Self::OrganizationUser_Confirmed => 1501,
235            Self::OrganizationUser_Updated => 1502,
236            Self::OrganizationUser_Removed => 1503,
237            Self::OrganizationUser_UpdatedGroups => 1504,
238            Self::OrganizationUser_UnlinkedSso => 1505,
239            Self::OrganizationUser_ResetPassword_Enroll => 1506,
240            Self::OrganizationUser_ResetPassword_Withdraw => 1507,
241            Self::OrganizationUser_AdminResetPassword => 1508,
242            Self::OrganizationUser_ResetSsoLink => 1509,
243            Self::OrganizationUser_FirstSsoLogin => 1510,
244            Self::OrganizationUser_Revoked => 1511,
245            Self::OrganizationUser_Restored => 1512,
246            Self::OrganizationUser_ApprovedAuthRequest => 1513,
247            Self::OrganizationUser_RejectedAuthRequest => 1514,
248            Self::OrganizationUser_Deleted => 1515,
249            Self::OrganizationUser_Left => 1516,
250            Self::OrganizationUser_AutomaticallyConfirmed => 1517,
251            Self::OrganizationUser_SelfRevoked => 1518,
252            Self::OrganizationUser_AdminResetTwoFactor => 1519,
253            Self::OrganizationUser_Revoked_TwoFactorNonCompliance => 1520,
254            Self::OrganizationUser_Revoked_SingleOrganizationNonCompliance => 1521,
255            Self::OrganizationUser_NotificationBannerActionClicked => 1522,
256            Self::OrganizationUser_Staged => 1523,
257            Self::OrganizationUser_InviteLinkAccepted => 1524,
258            Self::OrganizationUser_AdminChangedEmail => 1525,
259            Self::OrganizationUser_InviteLinkConfirmed => 1526,
260            Self::Organization_Updated => 1600,
261            Self::Organization_PurgedVault => 1601,
262            Self::Organization_ClientExportedVault => 1602,
263            Self::Organization_VaultAccessed => 1603,
264            Self::Organization_EnabledSso => 1604,
265            Self::Organization_DisabledSso => 1605,
266            Self::Organization_EnabledKeyConnector => 1606,
267            Self::Organization_DisabledKeyConnector => 1607,
268            Self::Organization_SponsorshipsSynced => 1608,
269            Self::Organization_CollectionManagement_Updated => 1609,
270            Self::Organization_CollectionManagement_LimitCollectionCreationEnabled => 1610,
271            Self::Organization_CollectionManagement_LimitCollectionCreationDisabled => 1611,
272            Self::Organization_CollectionManagement_LimitCollectionDeletionEnabled => 1612,
273            Self::Organization_CollectionManagement_LimitCollectionDeletionDisabled => 1613,
274            Self::Organization_CollectionManagement_LimitItemDeletionEnabled => 1614,
275            Self::Organization_CollectionManagement_LimitItemDeletionDisabled => 1615,
276            Self::Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled => 1616,
277            Self::Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled => 1617,
278            Self::Organization_ItemOrganization_Accepted => 1618,
279            Self::Organization_ItemOrganization_Declined => 1619,
280            Self::Organization_AutoConfirmEnabled_Admin => 1620,
281            Self::Organization_AutoConfirmDisabled_Admin => 1621,
282            Self::Organization_AutoConfirmEnabled_Portal => 1622,
283            Self::Organization_AutoConfirmDisabled_Portal => 1623,
284            Self::Organization_InviteLinkCreated => 1624,
285            Self::Organization_InviteLinkDomainsEdited => 1625,
286            Self::Organization_InviteLinkDeleted => 1626,
287            Self::Organization_InviteLinkClientCopied => 1627,
288            Self::Organization_InviteLinkRefreshed => 1628,
289            Self::Organization_InviteLinkConfirmEnabled => 1629,
290            Self::Organization_InviteLinkConfirmDisabled => 1630,
291            Self::Policy_Updated => 1700,
292            Self::ProviderUser_Invited => 1800,
293            Self::ProviderUser_Confirmed => 1801,
294            Self::ProviderUser_Updated => 1802,
295            Self::ProviderUser_Removed => 1803,
296            Self::ProviderOrganization_Created => 1900,
297            Self::ProviderOrganization_Added => 1901,
298            Self::ProviderOrganization_Removed => 1902,
299            Self::ProviderOrganization_VaultAccessed => 1903,
300            Self::OrganizationDomain_Added => 2000,
301            Self::OrganizationDomain_Removed => 2001,
302            Self::OrganizationDomain_Verified => 2002,
303            Self::OrganizationDomain_NotVerified => 2003,
304            Self::Secret_Retrieved => 2100,
305            Self::Secret_Created => 2101,
306            Self::Secret_Edited => 2102,
307            Self::Secret_Deleted => 2103,
308            Self::Secret_Permanently_Deleted => 2104,
309            Self::Secret_Restored => 2105,
310            Self::Project_Retrieved => 2200,
311            Self::Project_Created => 2201,
312            Self::Project_Edited => 2202,
313            Self::Project_Deleted => 2203,
314            Self::ServiceAccount_UserAdded => 2300,
315            Self::ServiceAccount_UserRemoved => 2301,
316            Self::ServiceAccount_GroupAdded => 2302,
317            Self::ServiceAccount_GroupRemoved => 2303,
318            Self::ServiceAccount_Created => 2304,
319            Self::ServiceAccount_Deleted => 2305,
320            Self::PhishingBlocker_SiteAccessed => 2400,
321            Self::PhishingBlocker_SiteExited => 2401,
322            Self::PhishingBlocker_Bypassed => 2402,
323            Self::Send_Created_Text => 2500,
324            Self::Send_Created_Text_WithEmailVerification => 2501,
325            Self::Send_Created_Text_WithPasswordProtection => 2502,
326            Self::Send_Created_File => 2503,
327            Self::Send_Created_File_WithEmailVerification => 2504,
328            Self::Send_Created_File_WithPasswordProtection => 2505,
329            Self::Send_Edited_Text => 2506,
330            Self::Send_Edited_File => 2507,
331            Self::Send_Deleted_Text => 2508,
332            Self::Send_Deleted_File => 2509,
333            Self::Send_Accessed_Text => 2510,
334            Self::Send_Accessed_File => 2511,
335            Self::Send_PolicyDisabled => 2512,
336            Self::Send_PolicyEnabled => 2513,
337            Self::__Unknown(v) => *v,
338        }
339    }
340
341    pub fn from_i64(value: i64) -> Self {
342        match value {
343            1000 => Self::User_LoggedIn,
344            1001 => Self::User_ChangedPassword,
345            1002 => Self::User_Updated2fa,
346            1003 => Self::User_Disabled2fa,
347            1004 => Self::User_Recovered2fa,
348            1005 => Self::User_FailedLogIn,
349            1006 => Self::User_FailedLogIn2fa,
350            1007 => Self::User_ClientExportedVault,
351            1008 => Self::User_UpdatedTempPassword,
352            1009 => Self::User_MigratedKeyToKeyConnector,
353            1010 => Self::User_RequestedDeviceApproval,
354            1011 => Self::User_TdeOffboardingPasswordSet,
355            1100 => Self::Cipher_Created,
356            1101 => Self::Cipher_Updated,
357            1102 => Self::Cipher_Deleted,
358            1103 => Self::Cipher_AttachmentCreated,
359            1104 => Self::Cipher_AttachmentDeleted,
360            1105 => Self::Cipher_Shared,
361            1106 => Self::Cipher_UpdatedCollections,
362            1107 => Self::Cipher_ClientViewed,
363            1108 => Self::Cipher_ClientToggledPasswordVisible,
364            1109 => Self::Cipher_ClientToggledHiddenFieldVisible,
365            1110 => Self::Cipher_ClientToggledCardCodeVisible,
366            1111 => Self::Cipher_ClientCopiedPassword,
367            1112 => Self::Cipher_ClientCopiedHiddenField,
368            1113 => Self::Cipher_ClientCopiedCardCode,
369            1114 => Self::Cipher_ClientAutofilled,
370            1115 => Self::Cipher_SoftDeleted,
371            1116 => Self::Cipher_Restored,
372            1117 => Self::Cipher_ClientToggledCardNumberVisible,
373            1118 => Self::Cipher_ClientToggledTOTPSeedVisible,
374            1119 => Self::Cipher_ClientCopiedBankAccountNumber,
375            1120 => Self::Cipher_ClientCopiedBankAccountPin,
376            1121 => Self::Cipher_ClientToggledBankAccountNumberVisible,
377            1122 => Self::Cipher_ClientToggledBankAccountPinVisible,
378            1123 => Self::Cipher_ClientCopiedLicenseNumber,
379            1124 => Self::Cipher_ClientToggledLicenseNumberVisible,
380            1125 => Self::Cipher_ClientCopiedPassportNumber,
381            1126 => Self::Cipher_ClientToggledPassportNumberVisible,
382            1127 => Self::Cipher_ClientCopiedSwiftCode,
383            1128 => Self::Cipher_ClientToggledSwiftCodeVisible,
384            1129 => Self::Cipher_ClientCopiedIban,
385            1130 => Self::Cipher_ClientToggledIbanVisible,
386            1131 => Self::Cipher_ClientCopiedNationalIdentificationNumber,
387            1132 => Self::Cipher_ClientToggledNationalIdentificationNumberVisible,
388            1133 => Self::Cipher_ClientHttpAuthReleased,
389            1300 => Self::Collection_Created,
390            1301 => Self::Collection_Updated,
391            1302 => Self::Collection_Deleted,
392            1400 => Self::Group_Created,
393            1401 => Self::Group_Updated,
394            1402 => Self::Group_Deleted,
395            1500 => Self::OrganizationUser_Invited,
396            1501 => Self::OrganizationUser_Confirmed,
397            1502 => Self::OrganizationUser_Updated,
398            1503 => Self::OrganizationUser_Removed,
399            1504 => Self::OrganizationUser_UpdatedGroups,
400            1505 => Self::OrganizationUser_UnlinkedSso,
401            1506 => Self::OrganizationUser_ResetPassword_Enroll,
402            1507 => Self::OrganizationUser_ResetPassword_Withdraw,
403            1508 => Self::OrganizationUser_AdminResetPassword,
404            1509 => Self::OrganizationUser_ResetSsoLink,
405            1510 => Self::OrganizationUser_FirstSsoLogin,
406            1511 => Self::OrganizationUser_Revoked,
407            1512 => Self::OrganizationUser_Restored,
408            1513 => Self::OrganizationUser_ApprovedAuthRequest,
409            1514 => Self::OrganizationUser_RejectedAuthRequest,
410            1515 => Self::OrganizationUser_Deleted,
411            1516 => Self::OrganizationUser_Left,
412            1517 => Self::OrganizationUser_AutomaticallyConfirmed,
413            1518 => Self::OrganizationUser_SelfRevoked,
414            1519 => Self::OrganizationUser_AdminResetTwoFactor,
415            1520 => Self::OrganizationUser_Revoked_TwoFactorNonCompliance,
416            1521 => Self::OrganizationUser_Revoked_SingleOrganizationNonCompliance,
417            1522 => Self::OrganizationUser_NotificationBannerActionClicked,
418            1523 => Self::OrganizationUser_Staged,
419            1524 => Self::OrganizationUser_InviteLinkAccepted,
420            1525 => Self::OrganizationUser_AdminChangedEmail,
421            1526 => Self::OrganizationUser_InviteLinkConfirmed,
422            1600 => Self::Organization_Updated,
423            1601 => Self::Organization_PurgedVault,
424            1602 => Self::Organization_ClientExportedVault,
425            1603 => Self::Organization_VaultAccessed,
426            1604 => Self::Organization_EnabledSso,
427            1605 => Self::Organization_DisabledSso,
428            1606 => Self::Organization_EnabledKeyConnector,
429            1607 => Self::Organization_DisabledKeyConnector,
430            1608 => Self::Organization_SponsorshipsSynced,
431            1609 => Self::Organization_CollectionManagement_Updated,
432            1610 => Self::Organization_CollectionManagement_LimitCollectionCreationEnabled,
433            1611 => Self::Organization_CollectionManagement_LimitCollectionCreationDisabled,
434            1612 => Self::Organization_CollectionManagement_LimitCollectionDeletionEnabled,
435            1613 => Self::Organization_CollectionManagement_LimitCollectionDeletionDisabled,
436            1614 => Self::Organization_CollectionManagement_LimitItemDeletionEnabled,
437            1615 => Self::Organization_CollectionManagement_LimitItemDeletionDisabled,
438            1616 => {
439                Self::Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled
440            }
441            1617 => {
442                Self::Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled
443            }
444            1618 => Self::Organization_ItemOrganization_Accepted,
445            1619 => Self::Organization_ItemOrganization_Declined,
446            1620 => Self::Organization_AutoConfirmEnabled_Admin,
447            1621 => Self::Organization_AutoConfirmDisabled_Admin,
448            1622 => Self::Organization_AutoConfirmEnabled_Portal,
449            1623 => Self::Organization_AutoConfirmDisabled_Portal,
450            1624 => Self::Organization_InviteLinkCreated,
451            1625 => Self::Organization_InviteLinkDomainsEdited,
452            1626 => Self::Organization_InviteLinkDeleted,
453            1627 => Self::Organization_InviteLinkClientCopied,
454            1628 => Self::Organization_InviteLinkRefreshed,
455            1629 => Self::Organization_InviteLinkConfirmEnabled,
456            1630 => Self::Organization_InviteLinkConfirmDisabled,
457            1700 => Self::Policy_Updated,
458            1800 => Self::ProviderUser_Invited,
459            1801 => Self::ProviderUser_Confirmed,
460            1802 => Self::ProviderUser_Updated,
461            1803 => Self::ProviderUser_Removed,
462            1900 => Self::ProviderOrganization_Created,
463            1901 => Self::ProviderOrganization_Added,
464            1902 => Self::ProviderOrganization_Removed,
465            1903 => Self::ProviderOrganization_VaultAccessed,
466            2000 => Self::OrganizationDomain_Added,
467            2001 => Self::OrganizationDomain_Removed,
468            2002 => Self::OrganizationDomain_Verified,
469            2003 => Self::OrganizationDomain_NotVerified,
470            2100 => Self::Secret_Retrieved,
471            2101 => Self::Secret_Created,
472            2102 => Self::Secret_Edited,
473            2103 => Self::Secret_Deleted,
474            2104 => Self::Secret_Permanently_Deleted,
475            2105 => Self::Secret_Restored,
476            2200 => Self::Project_Retrieved,
477            2201 => Self::Project_Created,
478            2202 => Self::Project_Edited,
479            2203 => Self::Project_Deleted,
480            2300 => Self::ServiceAccount_UserAdded,
481            2301 => Self::ServiceAccount_UserRemoved,
482            2302 => Self::ServiceAccount_GroupAdded,
483            2303 => Self::ServiceAccount_GroupRemoved,
484            2304 => Self::ServiceAccount_Created,
485            2305 => Self::ServiceAccount_Deleted,
486            2400 => Self::PhishingBlocker_SiteAccessed,
487            2401 => Self::PhishingBlocker_SiteExited,
488            2402 => Self::PhishingBlocker_Bypassed,
489            2500 => Self::Send_Created_Text,
490            2501 => Self::Send_Created_Text_WithEmailVerification,
491            2502 => Self::Send_Created_Text_WithPasswordProtection,
492            2503 => Self::Send_Created_File,
493            2504 => Self::Send_Created_File_WithEmailVerification,
494            2505 => Self::Send_Created_File_WithPasswordProtection,
495            2506 => Self::Send_Edited_Text,
496            2507 => Self::Send_Edited_File,
497            2508 => Self::Send_Deleted_Text,
498            2509 => Self::Send_Deleted_File,
499            2510 => Self::Send_Accessed_Text,
500            2511 => Self::Send_Accessed_File,
501            2512 => Self::Send_PolicyDisabled,
502            2513 => Self::Send_PolicyEnabled,
503            v => Self::__Unknown(v),
504        }
505    }
506}
507
508impl serde::Serialize for EventType {
509    fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
510        serializer.serialize_i64(self.as_i64())
511    }
512}
513
514impl<'de> serde::Deserialize<'de> for EventType {
515    fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
516        struct EventTypeVisitor;
517
518        impl Visitor<'_> for EventTypeVisitor {
519            type Value = EventType;
520
521            fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
522                f.write_str("an integer")
523            }
524
525            fn visit_i64<E: serde::de::Error>(self, v: i64) -> Result<Self::Value, E> {
526                Ok(EventType::from_i64(v))
527            }
528
529            fn visit_u64<E: serde::de::Error>(self, v: u64) -> Result<Self::Value, E> {
530                Ok(EventType::from_i64(v as i64))
531            }
532        }
533
534        deserializer.deserialize_i64(EventTypeVisitor)
535    }
536}
537
538impl std::fmt::Display for EventType {
539    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
540        write!(f, "{}", self.as_i64())
541    }
542}
543impl Default for EventType {
544    fn default() -> EventType {
545        Self::User_LoggedIn
546    }
547}