1use crate::helpers::{from_u16_helper::FromU16, to_u16_helper::ToU16};
3use num_enum::{IntoPrimitive, TryFromPrimitive};
4use strum::EnumProperty;
5use strum_macros::{Display, EnumIter, EnumProperty};
6
7#[derive(
8 Display, IntoPrimitive, TryFromPrimitive, EnumProperty, EnumIter, Debug, Copy, Clone, PartialEq,
9)]
10#[repr(u16)]
11
12pub enum ResponsesLocalApiCodes {
13 #[strum(props(Description = "The operation was approved and no further action is needed"))]
14 ApprovedNoActionRequired = 900,
15 #[strum(props(Description = "The operation was successfully approved"))]
16 Approved = 901,
17 #[strum(props(
18 Description = "The transaction ID is a duplicate; the transaction has already been processed"
19 ))]
20 DuplicatedTransactionId = 902,
21 #[strum(props(
22 Description = "Validation errors occurred. Please verify the provided values and try again"
23 ))]
24 ValidationErrorsProvided = 903,
25 #[strum(props(Description = "The requested operation is not permitted"))]
26 OperationNotAllowed = 904,
27 #[strum(props(Description = "The requested operation is not supported by the system"))]
28 OperationNotSupported = 905,
29 #[strum(props(
30 Description = "The transaction could not be completed due to a timeout (e.g., an authorization expired before capture)"
31 ))]
32 TransactionTimeout = 906,
33 #[strum(props(Description = "Authentication failed due to incorrect or missing credentials"))]
34 AuthentificationFailed = 907,
35 #[strum(props(
36 Description = "General decline with no specific reason provided, or insufficient funds"
37 ))]
38 DoNotHonor = 908,
39 #[strum(props(
40 Description = "The account does not have enough funds to complete the transaction"
41 ))]
42 InsufficientFunds = 909,
43 #[strum(props(Description = "The provided PIN is incorrect"))]
44 IncorrectPIN = 910,
45 #[strum(props(Description = "The transaction request is invalid or unsupported"))]
46 InvalidTransaction = 911,
47 #[strum(props(Description = "The specified amount is invalid"))]
48 InvalidAmount = 912,
49 #[strum(props(
50 Description = "The card number (PAN) is invalid or the card type is not accepted"
51 ))]
52 InvalidCardNumber = 913,
53 #[strum(props(Description = "The provided CVV code is invalid"))]
54 InvalidCVV = 914,
55 #[strum(props(Description = "The expiration date (MMYY) is invalid or in the past"))]
56 InvalidCardHolderName = 915,
57 #[strum(props(Description = "The cardholder's last name is invalid"))]
58 InvalidCardHolderLastName = 916,
59 #[strum(props(Description = "The cardholder's first name is invalid"))]
60 InvalidCardHolderFirstName = 917,
61 #[strum(props(Description = "The cardholder's ID number is invalid"))]
62 InvalidCardHolderIdNumber = 918,
63 #[strum(props(Description = "The cardholder's phone number is invalid"))]
64 InvalidCardHolderPhoneNumber = 919,
65 #[strum(props(Description = "The card is already active and cannot be reactivated"))]
66 CardAlreadyActive = 920,
67 #[strum(props(Description = "The card is not active or cannot be found"))]
68 CardNotActive = 921,
69 #[strum(props(Description = "The card has expired and cannot be used"))]
70 ExpiredCard = 922,
71 #[strum(props(Description = "The card has been reported lost and cannot be used"))]
72 LostCard = 923,
73 #[strum(props(Description = "The card has been reported stolen and cannot be used"))]
74 StolenCard = 924,
75 #[strum(props(Description = "The last name provided is invalid"))]
76 InvalidLastName = 925,
77 #[strum(props(Description = "The first name provided is invalid"))]
78 InvalidFirstName = 926,
79 #[strum(props(Description = "The ID number provided is invalid"))]
80 InvalidIdNumber = 927,
81 #[strum(props(Description = "The phone number provided is invalid"))]
82 InvalidPhoneNumber = 928,
83 #[strum(props(Description = "The email address provided is invalid"))]
84 InvalidEmail = 929,
85 #[strum(props(Description = "The initials provided are invalid"))]
86 InvalidInitials = 930,
87 #[strum(props(Description = "The address provided is invalid"))]
88 InvalidAddress = 931,
89 #[strum(props(Description = "The city provided is invalid"))]
90 InvalidCity = 932,
91 #[strum(props(Description = "The postal code provided is invalid"))]
92 InvalidPostalCode = 933,
93 #[strum(props(Description = "The country provided is invalid"))]
94 InvalidCountry = 934,
95 #[strum(props(Description = "The password provided is invalid"))]
96 InvalidPassword = 935,
97 #[strum(props(Description = "The username provided is invalid"))]
98 InvalidUsername = 936,
99 #[strum(props(Description = "The role specified is invalid"))]
100 InvalidRole = 937,
101 #[strum(props(Description = "The status specified is invalid"))]
102 InvalidStatus = 938,
103 #[strum(props(Description = "The date of birth provided is invalid"))]
104 InvalidDateOfBirth = 939,
105 #[strum(props(Description = "The majority information provided is invalid"))]
106 InvalidMajority = 940,
107 #[strum(props(Description = "The marital status provided is invalid"))]
108 InvalidMaritalStatus = 941,
109 #[strum(props(Description = "The nationality provided is invalid"))]
110 InvalidNationality = 942,
111 #[strum(props(Description = "The language provided is invalid"))]
112 InvalidLanguage = 943,
113 #[strum(props(Description = "The currency provided is invalid"))]
114 InvalidCurrency = 944,
115 #[strum(props(Description = "The time zone specified is invalid"))]
116 InvalidTimeZone = 945,
117 #[strum(props(Description = "The profile picture is invalid or unsupported"))]
118 InvalidProfilePicture = 946,
119 #[strum(props(Description = "The cover picture is invalid or unsupported"))]
120 InvalidCoverPicture = 947,
121 #[strum(props(Description = "The bio provided is invalid"))]
122 InvalidBio = 948,
123 #[strum(props(Description = "The website URL provided is invalid"))]
124 InvalidWebsite = 949,
125 #[strum(props(Description = "The Facebook profile URL provided is invalid"))]
126 InvalidFacebook = 950,
127 #[strum(props(Description = "The Twitter handle provided is invalid"))]
128 InvalidTwitter = 951,
129 #[strum(props(Description = "The Instagram profile provided is invalid"))]
130 InvalidInstagram = 952,
131 #[strum(props(Description = "The LinkedIn profile provided is invalid"))]
132 InvalidLinkedIn = 953,
133 #[strum(props(Description = "The GitHub profile provided is invalid"))]
134 InvalidGitHub = 954,
135 #[strum(props(Description = "The GitLab profile provided is invalid"))]
136 InvalidGitLab = 955,
137 #[strum(props(Description = "The Bitbucket profile provided is invalid"))]
138 InvalidBitbucket = 956,
139 #[strum(props(Description = "The Google profile provided is invalid"))]
140 InvalidGoogle = 957,
141 #[strum(props(Description = "The YouTube profile provided is invalid"))]
142 InvalidYouTube = 958,
143 #[strum(props(Description = "The Twitch profile provided is invalid"))]
144 InvalidTwitch = 959,
145 #[strum(props(Description = "The Discord handle provided is invalid"))]
146 InvalidDiscord = 960,
147 #[strum(props(Description = "The Slack workspace or handle provided is invalid"))]
148 InvalidSlack = 961,
149 #[strum(props(Description = "The Telegram handle provided is invalid"))]
150 InvalidTelegram = 962,
151 #[strum(props(Description = "The WhatsApp number provided is invalid"))]
152 InvalidWhatsApp = 963,
153 #[strum(props(Description = "The Skype ID provided is invalid"))]
154 InvalidSkype = 964,
155 #[strum(props(Description = "The Snapchat handle provided is invalid"))]
156 InvalidSnapchat = 965,
157 #[strum(props(Description = "The Pinterest profile provided is invalid"))]
158 InvalidPinterest = 966,
159 #[strum(props(Description = "The Tumblr profile provided is invalid"))]
160 InvalidTumblr = 967,
161 #[strum(props(Description = "The Flickr profile provided is invalid"))]
162 InvalidFlickr = 968,
163 #[strum(props(Description = "The Vimeo profile provided is invalid"))]
164 InvalidVimeo = 969,
165 #[strum(props(Description = "The SoundCloud profile provided is invalid"))]
166 InvalidSoundCloud = 970,
167 #[strum(props(Description = "The Spotify profile provided is invalid"))]
168 InvalidSpotify = 971,
169 #[strum(props(Description = "The TikTok profile provided is invalid"))]
170 InvalidTikTok = 972,
171 #[strum(props(Description = "The Vine profile provided is invalid"))]
172 InvalidVine = 973,
173 #[strum(props(Description = "The Periscope profile provided is invalid"))]
174 InvalidPeriscope = 974,
175 #[strum(props(Description = "The expiration date (MMYY) is invalid or in the past"))]
176 InvalidExpirationDate = 975,
177 #[strum(props(Description = "The session key is missing from the request header"))]
178 SessionKeyNotPresentInHeader = 976,
179 #[strum(props(Description = "The session key provided is invalid, corrupted, or unparsable"))]
180 SessionKeyPresentAndNotDecryptableParsable = 977,
181 #[strum(props(Description = "The reference provided does not have any linked cards"))]
182 ReferenceHasNoLinkedCards = 978,
183 #[strum(props(
184 Description = "The card is already linked to a different reference and cannot be re-linked"
185 ))]
186 CardAlreadyLinkedToADifferentReference = 979,
187 #[strum(props(Description = "The uploaded file type is not allowed"))]
188 ExcludedByFileTypeExclusions = 980,
189 #[strum(props(Description = "The card information provided is invalid"))]
190 InvalidCardInformation = 981,
191 #[strum(props(Description = "The operation to disable a physical card is not allowed"))]
192 CannotDisablePhysicalCard = 982,
193 #[strum(props(Description = "The token is missing from the request"))]
194 MissingToken = 983,
195 #[strum(props(Description = "User not found"))]
196 UserNotFound = 984,
197 #[strum(props(Description = "User already exists"))]
198 AlreadyExists = 985,
199 #[strum(props(Description = "Database error"))]
200 DatabaseError = 986,
201 #[strum(props(Description = "Password hashing error"))]
202 HashingError = 987,
203 #[strum(props(Description = "Invalid login"))]
204 InvalidLogin = 988,
205 #[strum(props(Description = "Invalid user"))]
206 InvalidUser = 989,
207 #[strum(props(Description = "Invalid user ID"))]
208 InvalidUserId = 990,
209 #[strum(props(Description = "Invalid user role"))]
210 InvalidUserRole = 991,
211 #[strum(props(Description = "Invalid credentials"))]
212 InvalidCredentials = 992,
213 #[strum(props(Description = "User already exists"))]
214 UserAlreadyExists = 993,
215 #[strum(props(Description = "Invalid pseudonym"))]
216 InvalidPseudonym = 994,
217 #[strum(props(Description = "Invalid tag"))]
218 InvalidTag = 995,
219 #[strum(props(Description = "Invalid authorization code"))]
220 InvalidAuthorizationCode = 996,
221 #[strum(props(
222 Description = "Unofficial HTTP status code LinkedIn that is returned by the server as a generic, or catch-all error code. The reason for the HTTP response varies based on the service or host"
223 ))]
224 RequestDenied = 999,
225}
226
227impl ToU16 for ResponsesLocalApiCodes {
228 fn to_u16(self) -> u16 {
229 self.into() }
231}
232
233impl FromU16 for ResponsesLocalApiCodes {
234 fn from_u16(code: u16) -> Option<Self> {
235 Self::try_from(code).ok() }
237}
238
239impl Into<(u16, &'static str)> for ResponsesLocalApiCodes {
240 fn into(self) -> (u16, &'static str) {
241 let code: u16 = self.to_u16();
242 let description = self.get_str("Description").unwrap_or("No description");
243 (code, description) }
245}
246
247pub fn approved_no_action_required() -> (u16, &'static str) {
248 (900, "The operation was approved and no further action is needed")
249}
250
251pub fn approved() -> (u16, &'static str) {
252 (901, "The operation was successfully approved")
253}
254
255pub fn duplicated_transaction_id() -> (u16, &'static str) {
256 (902, "The transaction ID is a duplicate; the transaction has already been processed")
257}
258
259pub fn validation_errors_provided() -> (u16, &'static str) {
260 (903, "Validation errors occurred. Please verify the provided values and try again")
261}
262
263pub fn operation_not_allowed() -> (u16, &'static str) {
264 (904, "The requested operation is not permitted")
265}
266
267pub fn operation_not_supported() -> (u16, &'static str) {
268 (905, "The requested operation is not supported by the system")
269}
270
271pub fn transaction_timeout() -> (u16, &'static str) {
272 (906, "The transaction could not be completed due to a timeout (e.g., an authorization expired before capture)")
273}
274
275pub fn authentification_failed() -> (u16, &'static str) {
276 (907, "Authentication failed due to incorrect or missing credentials")
277}
278
279pub fn do_not_honor() -> (u16, &'static str) {
280 (908, "General decline with no specific reason provided, or insufficient funds")
281}
282
283pub fn insufficient_funds() -> (u16, &'static str) {
284 (909, "The account does not have enough funds to complete the transaction")
285}
286
287pub fn incorrect_pin() -> (u16, &'static str) {
288 (910, "The provided PIN is incorrect")
289}
290
291pub fn invalid_transaction() -> (u16, &'static str) {
292 (911, "The transaction request is invalid or unsupported")
293}
294
295pub fn invalid_amount() -> (u16, &'static str) {
296 (912, "The specified amount is invalid")
297}
298
299pub fn invalid_card_number() -> (u16, &'static str) {
300 (913, "The card number (PAN) is invalid or the card type is not accepted")
301}
302
303pub fn invalid_cvv() -> (u16, &'static str) {
304 (914, "The provided CVV code is invalid")
305}
306
307pub fn invalid_card_holder_name() -> (u16, &'static str) {
308 (915, "The expiration date (MMYY) is invalid or in the past")
309}
310
311pub fn invalid_card_holder_last_name() -> (u16, &'static str) {
312 (916, "The cardholder's last name is invalid")
313}
314
315pub fn invalid_card_holder_first_name() -> (u16, &'static str) {
316 (917, "The cardholder's first name is invalid")
317}
318
319pub fn invalid_card_holder_id_number() -> (u16, &'static str) {
320 (918, "The cardholder's ID number is invalid")
321}
322
323pub fn invalid_card_holder_phone_number() -> (u16, &'static str) {
324 (919, "The cardholder's phone number is invalid")
325}
326
327pub fn card_already_active() -> (u16, &'static str) {
328 (920, "The card is already active and cannot be reactivated")
329}
330
331pub fn card_not_active() -> (u16, &'static str) {
332 (921, "The card is not active or cannot be found")
333}
334
335pub fn expired_card() -> (u16, &'static str) {
336 (922, "The card has expired and cannot be used")
337}
338
339pub fn lost_card() -> (u16, &'static str) {
340 (923, "The card has been reported lost and cannot be used")
341}
342
343pub fn stolen_card() -> (u16, &'static str) {
344 (924, "The card has been reported stolen and cannot be used")
345}
346
347pub fn invalid_last_name() -> (u16, &'static str) {
348 (925, "The last name provided is invalid")
349}
350
351pub fn invalid_first_name() -> (u16, &'static str) {
352 (926, "The first name provided is invalid")
353}
354
355pub fn invalid_id_number() -> (u16, &'static str) {
356 (927, "The ID number provided is invalid")
357}
358
359pub fn invalid_phone_number() -> (u16, &'static str) {
360 (928, "The phone number provided is invalid")
361}
362
363pub fn invalid_email() -> (u16, &'static str) {
364 (929, "The email address provided is invalid")
365}
366
367pub fn invalid_initials() -> (u16, &'static str) {
368 (930, "The initials provided are invalid")
369}
370
371pub fn invalid_address() -> (u16, &'static str) {
372 (931, "The address provided is invalid")
373}
374
375pub fn invalid_city() -> (u16, &'static str) {
376 (932, "The city provided is invalid")
377}
378
379pub fn invalid_postal_code() -> (u16, &'static str) {
380 (933, "The postal code provided is invalid")
381}
382
383pub fn invalid_country() -> (u16, &'static str) {
384 (934, "The country provided is invalid")
385}
386
387pub fn invalid_password() -> (u16, &'static str) {
388 (935, "The password provided is invalid")
389}
390
391pub fn invalid_username() -> (u16, &'static str) {
392 (936, "The username provided is invalid")
393}
394
395pub fn invalid_role() -> (u16, &'static str) {
396 (937, "The role specified is invalid")
397}
398
399pub fn invalid_status() -> (u16, &'static str) {
400 (938, "The status specified is invalid")
401}
402
403pub fn invalid_date_of_birth() -> (u16, &'static str) {
404 (939, "The date of birth provided is invalid")
405}
406
407pub fn invalid_majority() -> (u16, &'static str) {
408 (940, "The majority information provided is invalid")
409}
410
411pub fn invalid_marital_status() -> (u16, &'static str) {
412 (941, "The marital status provided is invalid")
413}
414
415pub fn invalid_nationality() -> (u16, &'static str) {
416 (942, "The nationality provided is invalid")
417}
418
419pub fn invalid_language() -> (u16, &'static str) {
420 (943, "The language provided is invalid")
421}
422
423pub fn invalid_currency() -> (u16, &'static str) {
424 (944, "The currency provided is invalid")
425}
426
427pub fn invalid_time_zone() -> (u16, &'static str) {
428 (945, "The time zone specified is invalid")
429}
430
431pub fn invalid_profile_picture() -> (u16, &'static str) {
432 (946, "The profile picture is invalid or unsupported")
433}
434
435pub fn invalid_cover_picture() -> (u16, &'static str) {
436 (947, "The cover picture is invalid or unsupported")
437}
438
439pub fn invalid_bio() -> (u16, &'static str) {
440 (948, "The bio provided is invalid")
441}
442
443pub fn invalid_website() -> (u16, &'static str) {
444 (949, "The website URL provided is invalid")
445}
446
447pub fn invalid_facebook() -> (u16, &'static str) {
448 (950, "The Facebook profile URL provided is invalid")
449}
450
451pub fn invalid_twitter() -> (u16, &'static str) {
452 (951, "The Twitter handle provided is invalid")
453}
454
455pub fn invalid_instagram() -> (u16, &'static str) {
456 (952, "The Instagram profile provided is invalid")
457}
458
459pub fn invalid_linked_in() -> (u16, &'static str) {
460 (953, "The LinkedIn profile provided is invalid")
461}
462
463pub fn invalid_git_hub() -> (u16, &'static str) {
464 (954, "The GitHub profile provided is invalid")
465}
466
467pub fn invalid_git_lab() -> (u16, &'static str) {
468 (955, "The GitLab profile provided is invalid")
469}
470
471pub fn invalid_bit_bucket() -> (u16, &'static str) {
472 (956, "The Bitbucket profile provided is invalid")
473}
474
475pub fn invalid_google() -> (u16, &'static str) {
476 (957, "The Google profile provided is invalid")
477}
478
479pub fn invalid_you_tube() -> (u16, &'static str) {
480 (958, "The YouTube profile provided is invalid")
481}
482
483pub fn invalid_twitch() -> (u16, &'static str) {
484 (959, "The Twitch profile provided is invalid")
485}
486
487pub fn invalid_discord() -> (u16, &'static str) {
488 (960, "The Discord handle provided is invalid")
489}
490
491pub fn invalid_slack() -> (u16, &'static str) {
492 (961, "The Slack workspace or handle provided is invalid")
493}
494
495pub fn invalid_telegram() -> (u16, &'static str) {
496 (962, "The Telegram handle provided is invalid")
497}
498
499pub fn invalid_whats_app() -> (u16, &'static str) {
500 (963, "The WhatsApp number provided is invalid")
501}
502
503pub fn invalid_skype() -> (u16, &'static str) {
504 (964, "The Skype ID provided is invalid")
505}
506
507pub fn invalid_snapchat() -> (u16, &'static str) {
508 (965, "The Snapchat handle provided is invalid")
509}
510
511pub fn invalid_pinterest() -> (u16, &'static str) {
512 (966, "The Pinterest profile provided is invalid")
513}
514
515pub fn invalid_tumblr() -> (u16, &'static str) {
516 (967, "The Tumblr profile provided is invalid")
517}
518
519pub fn invalid_flickr() -> (u16, &'static str) {
520 (968, "The Flickr profile provided is invalid")
521}
522
523pub fn invalid_vimeo() -> (u16, &'static str) {
524 (969, "The Vimeo profile provided is invalid")
525}
526
527pub fn invalid_sound_cloud() -> (u16, &'static str) {
528 (970, "The SoundCloud profile provided is invalid")
529}
530
531pub fn invalid_spotify() -> (u16, &'static str) {
532 (971, "The Spotify profile provided is invalid")
533}
534
535pub fn invalid_tik_tok() -> (u16, &'static str) {
536 (972, "The TikTok profile provided is invalid")
537}
538
539pub fn invalid_vine() -> (u16, &'static str) {
540 (973, "The Vine profile provided is invalid")
541}
542
543pub fn invalid_periscope() -> (u16, &'static str) {
544 (974, "The Periscope profile provided is invalid")
545}
546
547pub fn invalid_expiration_date() -> (u16, &'static str) {
548 (975, "The expiration date (MMYY) is invalid or in the past")
549}
550
551pub fn session_key_not_present_in_header() -> (u16, &'static str) {
552 (976, "The session key is missing from the request header")
553}
554
555pub fn session_key_present_and_not_decryptable_parsable() -> (u16, &'static str) {
556 (977, "The session key provided is invalid, corrupted, or unparsable")
557}
558
559pub fn reference_has_no_linked_cards() -> (u16, &'static str) {
560 (978, "The reference provided does not have any linked cards")
561}
562
563pub fn card_already_linked_to_a_different_reference() -> (u16, &'static str) {
564 (979, "The card is already linked to a different reference and cannot be re-linked")
565}
566
567pub fn excluded_by_file_type_exclusions() -> (u16, &'static str) {
568 (980, "The uploaded file type is not allowed")
569}
570
571pub fn invalid_card_information() -> (u16, &'static str) {
572 (981, "The card information provided is invalid")
573}
574
575pub fn cannot_disable_physical_card() -> (u16, &'static str) {
576 (982, "The operation to disable a physical card is not allowed")
577}
578
579pub fn missing_token() -> (u16, &'static str) {
580 (983, "The token is missing from the request")
581}
582
583pub fn user_not_found() -> (u16, &'static str) {
584 (984, "User not found")
585}
586
587pub fn already_exists() -> (u16, &'static str) {
588 (985, "User already exists")
589}
590
591pub fn database_error() -> (u16, &'static str) {
592 (986, "Database error")
593}
594
595pub fn hashing_error() -> (u16, &'static str) {
596 (987, "Password hashing error")
597}
598
599pub fn invalid_login() -> (u16, &'static str) {
600 (988, "Invalid login")
601}
602
603pub fn invalid_user() -> (u16, &'static str) {
604 (989, "Invalid user")
605}
606
607pub fn invalid_user_id() -> (u16, &'static str) {
608 (990, "Invalid user ID")
609}
610
611pub fn invalid_user_role() -> (u16, &'static str) {
612 (991, "Invalid user role")
613}
614
615pub fn invalid_credentials() -> (u16, &'static str) {
616 (992, "Invalid credentials")
617}
618
619pub fn user_already_exists() -> (u16, &'static str) {
620 (993, "User already exists")
621}
622
623pub fn invalid_pseudonym() -> (u16, &'static str) {
624 (994, "Invalid pseudonym")
625}
626
627pub fn invalid_tag() -> (u16, &'static str) {
628 (995, "Invalid tag")
629}
630
631pub fn invalid_authorization_code() -> (u16, &'static str) {
632 (996, "Invalid authorization code")
633}
634
635pub fn request_denied() -> (u16, &'static str) {
636 (999, "Unofficial HTTP status code LinkedIn that is returned by the server as a generic, or catch-all error code. The reason for the HTTP response varies based on the service or host")
637}
638
639#[cfg(test)]
640mod tests {
641 use super::*;
642
643 #[test]
644 fn test_generated_function_approved_no_action_required() {
645 let response = ResponsesLocalApiCodes::ApprovedNoActionRequired;
646 let (code, description) = response.into();
647 assert_eq!(code, 900);
648 assert_eq!(description, "The operation was approved and no further action is needed");
649 }
650
651 #[test]
652 fn test_to_16_approved() {
653 let response = ResponsesLocalApiCodes::Approved;
654 let code = response.to_u16();
655 assert_eq!(code, 901);
656 }
657
658 #[test]
659 fn test_duplicated_transaction_id() {
660 assert_eq!(
661 duplicated_transaction_id(),
662 (902, "The transaction ID is a duplicate; the transaction has already been processed")
663 );
664 }
665
666 #[test]
667 fn test_from_u16_validation_errors_provided() {
668 let response = ResponsesLocalApiCodes::from_u16(903);
669 assert_eq!(response, Some(ResponsesLocalApiCodes::ValidationErrorsProvided));
670 }
671}