hook0-client 2.0.3

Rust SDK for Hook0 Open-Source Webhooks as a service for SaaS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
// Generated by hook0-sdkgen from the OpenAPI snapshot the API crate commits.
// Do not edit by hand: run `UPDATE_SDK=rust cargo test -p hook0-sdkgen sdk_targets` and commit the result.
//! The types the API carries, one declaration per schema and per enumeration it names.

use chrono::DateTime;
use chrono::NaiveDate;
use chrono::Utc;
use serde_json::Value;
use std::collections::HashMap;
use url::Url;
use uuid::Uuid;

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum ApplicationInfoOnboardingStepsEvent {
    /// The `ToDo` the API answers with.
    #[serde(rename = "ToDo")]
    ToDo,
    /// The `Done` the API answers with.
    #[serde(rename = "Done")]
    Done,
}

impl ApplicationInfoOnboardingStepsEvent {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::ToDo => "ToDo",
            Self::Done => "Done",
        }
    }
}

impl std::fmt::Display for ApplicationInfoOnboardingStepsEvent {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum ApplicationInfoOnboardingStepsEventType {
    /// The `ToDo` the API answers with.
    #[serde(rename = "ToDo")]
    ToDo,
    /// The `Done` the API answers with.
    #[serde(rename = "Done")]
    Done,
}

impl ApplicationInfoOnboardingStepsEventType {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::ToDo => "ToDo",
            Self::Done => "Done",
        }
    }
}

impl std::fmt::Display for ApplicationInfoOnboardingStepsEventType {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum ApplicationInfoOnboardingStepsSubscription {
    /// The `ToDo` the API answers with.
    #[serde(rename = "ToDo")]
    ToDo,
    /// The `Done` the API answers with.
    #[serde(rename = "Done")]
    Done,
}

impl ApplicationInfoOnboardingStepsSubscription {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::ToDo => "ToDo",
            Self::Done => "Done",
        }
    }
}

impl std::fmt::Display for ApplicationInfoOnboardingStepsSubscription {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum OrganizationInfoOnboardingStepsApplication {
    /// The `ToDo` the API answers with.
    #[serde(rename = "ToDo")]
    ToDo,
    /// The `Done` the API answers with.
    #[serde(rename = "Done")]
    Done,
}

impl OrganizationInfoOnboardingStepsApplication {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::ToDo => "ToDo",
            Self::Done => "Done",
        }
    }
}

impl std::fmt::Display for OrganizationInfoOnboardingStepsApplication {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum OrganizationInfoOnboardingStepsEvent {
    /// The `ToDo` the API answers with.
    #[serde(rename = "ToDo")]
    ToDo,
    /// The `Done` the API answers with.
    #[serde(rename = "Done")]
    Done,
}

impl OrganizationInfoOnboardingStepsEvent {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::ToDo => "ToDo",
            Self::Done => "Done",
        }
    }
}

impl std::fmt::Display for OrganizationInfoOnboardingStepsEvent {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum OrganizationInfoOnboardingStepsEventType {
    /// The `ToDo` the API answers with.
    #[serde(rename = "ToDo")]
    ToDo,
    /// The `Done` the API answers with.
    #[serde(rename = "Done")]
    Done,
}

impl OrganizationInfoOnboardingStepsEventType {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::ToDo => "ToDo",
            Self::Done => "Done",
        }
    }
}

impl std::fmt::Display for OrganizationInfoOnboardingStepsEventType {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum OrganizationInfoOnboardingStepsSubscription {
    /// The `ToDo` the API answers with.
    #[serde(rename = "ToDo")]
    ToDo,
    /// The `Done` the API answers with.
    #[serde(rename = "Done")]
    Done,
}

impl OrganizationInfoOnboardingStepsSubscription {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::ToDo => "ToDo",
            Self::Done => "Done",
        }
    }
}

impl std::fmt::Display for OrganizationInfoOnboardingStepsSubscription {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum ProblemId {
    /// The `OrganizationNameMissing` the API answers with.
    #[serde(rename = "OrganizationNameMissing")]
    OrganizationNameMissing,
    /// The `UserAlreadyExist` the API answers with.
    #[serde(rename = "UserAlreadyExist")]
    UserAlreadyExist,
    /// The `RegistrationDisabled` the API answers with.
    #[serde(rename = "RegistrationDisabled")]
    RegistrationDisabled,
    /// The `PasswordTooShort` the API answers with.
    #[serde(rename = "PasswordTooShort")]
    PasswordTooShort,
    /// The `PasswordTooLong` the API answers with.
    #[serde(rename = "PasswordTooLong")]
    PasswordTooLong,
    /// The `PasswordSimilarToEmail` the API answers with.
    #[serde(rename = "PasswordSimilarToEmail")]
    PasswordSimilarToEmail,
    /// The `PasswordSimilarToName` the API answers with.
    #[serde(rename = "PasswordSimilarToName")]
    PasswordSimilarToName,
    /// The `PasswordTooCommon` the API answers with.
    #[serde(rename = "PasswordTooCommon")]
    PasswordTooCommon,
    /// The `PasswordNotDiverseEnough` the API answers with.
    #[serde(rename = "PasswordNotDiverseEnough")]
    PasswordNotDiverseEnough,
    /// The `OrganizationIsNotEmpty` the API answers with.
    #[serde(rename = "OrganizationIsNotEmpty")]
    OrganizationIsNotEmpty,
    /// The `InvitedUserDoesNotExist` the API answers with.
    #[serde(rename = "InvitedUserDoesNotExist")]
    InvitedUserDoesNotExist,
    /// The `InvitedUserAlreadyInOrganization` the API answers with.
    #[serde(rename = "InvitedUserAlreadyInOrganization")]
    InvitedUserAlreadyInOrganization,
    /// The `ApplicationNameMissing` the API answers with.
    #[serde(rename = "ApplicationNameMissing")]
    ApplicationNameMissing,
    /// The `InvalidRole` the API answers with.
    #[serde(rename = "InvalidRole")]
    InvalidRole,
    /// The `EventTypeAlreadyExist` the API answers with.
    #[serde(rename = "EventTypeAlreadyExist")]
    EventTypeAlreadyExist,
    /// The `EventTypeDoesNotExist` the API answers with.
    #[serde(rename = "EventTypeDoesNotExist")]
    EventTypeDoesNotExist,
    /// The `UnauthorizedWorkers` the API answers with.
    #[serde(rename = "UnauthorizedWorkers")]
    UnauthorizedWorkers,
    /// The `EventAlreadyIngested` the API answers with.
    #[serde(rename = "EventAlreadyIngested")]
    EventAlreadyIngested,
    /// The `EventInvalidPayloadContentType` the API answers with.
    #[serde(rename = "EventInvalidPayloadContentType")]
    EventInvalidPayloadContentType,
    /// The `EventInvalidBase64Payload` the API answers with.
    #[serde(rename = "EventInvalidBase64Payload")]
    EventInvalidBase64Payload,
    /// The `EventInvalidJsonPayload` the API answers with.
    #[serde(rename = "EventInvalidJsonPayload")]
    EventInvalidJsonPayload,
    /// The `LabelsAmbiguity` the API answers with.
    #[serde(rename = "LabelsAmbiguity")]
    LabelsAmbiguity,
    /// The `InvalidDateRange` the API answers with.
    #[serde(rename = "InvalidDateRange")]
    InvalidDateRange,
    /// The `AuthNoAuthorizationHeader` the API answers with.
    #[serde(rename = "AuthNoAuthorizationHeader")]
    AuthNoAuthorizationHeader,
    /// The `AuthInvalidAuthorizationHeader` the API answers with.
    #[serde(rename = "AuthInvalidAuthorizationHeader")]
    AuthInvalidAuthorizationHeader,
    /// The `AuthApplicationSecretLookupError` the API answers with.
    #[serde(rename = "AuthApplicationSecretLookupError")]
    AuthApplicationSecretLookupError,
    /// The `AuthInvalidApplicationSecret` the API answers with.
    #[serde(rename = "AuthInvalidApplicationSecret")]
    AuthInvalidApplicationSecret,
    /// The `AuthBiscuitLookupError` the API answers with.
    #[serde(rename = "AuthBiscuitLookupError")]
    AuthBiscuitLookupError,
    /// The `AuthInvalidBiscuit` the API answers with.
    #[serde(rename = "AuthInvalidBiscuit")]
    AuthInvalidBiscuit,
    /// The `AuthFailedLogin` the API answers with.
    #[serde(rename = "AuthFailedLogin")]
    AuthFailedLogin,
    /// The `AuthEmailNotVerified` the API answers with.
    #[serde(rename = "AuthEmailNotVerified")]
    AuthEmailNotVerified,
    /// The `AuthEmailAlreadyVerified` the API answers with.
    #[serde(rename = "AuthEmailAlreadyVerified")]
    AuthEmailAlreadyVerified,
    /// The `AuthFailedRefresh` the API answers with.
    #[serde(rename = "AuthFailedRefresh")]
    AuthFailedRefresh,
    /// The `AuthEmailExpired` the API answers with.
    #[serde(rename = "AuthEmailExpired")]
    AuthEmailExpired,
    /// The `TooManyMembersPerOrganization` the API answers with.
    #[serde(rename = "TooManyMembersPerOrganization")]
    TooManyMembersPerOrganization,
    /// The `TooManyApplicationsPerOrganization` the API answers with.
    #[serde(rename = "TooManyApplicationsPerOrganization")]
    TooManyApplicationsPerOrganization,
    /// The `TooManyEventsToday` the API answers with.
    #[serde(rename = "TooManyEventsToday")]
    TooManyEventsToday,
    /// The `TooManySubscriptionsPerApplication` the API answers with.
    #[serde(rename = "TooManySubscriptionsPerApplication")]
    TooManySubscriptionsPerApplication,
    /// The `TooManyEventTypesPerApplication` the API answers with.
    #[serde(rename = "TooManyEventTypesPerApplication")]
    TooManyEventTypesPerApplication,
    /// The `JsonPayload` the API answers with.
    #[serde(rename = "JsonPayload")]
    JsonPayload,
    /// The `Validation` the API answers with.
    #[serde(rename = "Validation")]
    Validation,
    /// The `NotFound` the API answers with.
    #[serde(rename = "NotFound")]
    NotFound,
    /// The `InternalServerError` the API answers with.
    #[serde(rename = "InternalServerError")]
    InternalServerError,
    /// The `Forbidden` the API answers with.
    #[serde(rename = "Forbidden")]
    Forbidden,
    /// The `RateLimited` the API answers with.
    #[serde(rename = "RateLimited")]
    RateLimited,
    /// The `ServiceUnavailable` the API answers with.
    #[serde(rename = "ServiceUnavailable")]
    ServiceUnavailable,
}

impl ProblemId {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::OrganizationNameMissing => "OrganizationNameMissing",
            Self::UserAlreadyExist => "UserAlreadyExist",
            Self::RegistrationDisabled => "RegistrationDisabled",
            Self::PasswordTooShort => "PasswordTooShort",
            Self::PasswordTooLong => "PasswordTooLong",
            Self::PasswordSimilarToEmail => "PasswordSimilarToEmail",
            Self::PasswordSimilarToName => "PasswordSimilarToName",
            Self::PasswordTooCommon => "PasswordTooCommon",
            Self::PasswordNotDiverseEnough => "PasswordNotDiverseEnough",
            Self::OrganizationIsNotEmpty => "OrganizationIsNotEmpty",
            Self::InvitedUserDoesNotExist => "InvitedUserDoesNotExist",
            Self::InvitedUserAlreadyInOrganization => "InvitedUserAlreadyInOrganization",
            Self::ApplicationNameMissing => "ApplicationNameMissing",
            Self::InvalidRole => "InvalidRole",
            Self::EventTypeAlreadyExist => "EventTypeAlreadyExist",
            Self::EventTypeDoesNotExist => "EventTypeDoesNotExist",
            Self::UnauthorizedWorkers => "UnauthorizedWorkers",
            Self::EventAlreadyIngested => "EventAlreadyIngested",
            Self::EventInvalidPayloadContentType => "EventInvalidPayloadContentType",
            Self::EventInvalidBase64Payload => "EventInvalidBase64Payload",
            Self::EventInvalidJsonPayload => "EventInvalidJsonPayload",
            Self::LabelsAmbiguity => "LabelsAmbiguity",
            Self::InvalidDateRange => "InvalidDateRange",
            Self::AuthNoAuthorizationHeader => "AuthNoAuthorizationHeader",
            Self::AuthInvalidAuthorizationHeader => "AuthInvalidAuthorizationHeader",
            Self::AuthApplicationSecretLookupError => "AuthApplicationSecretLookupError",
            Self::AuthInvalidApplicationSecret => "AuthInvalidApplicationSecret",
            Self::AuthBiscuitLookupError => "AuthBiscuitLookupError",
            Self::AuthInvalidBiscuit => "AuthInvalidBiscuit",
            Self::AuthFailedLogin => "AuthFailedLogin",
            Self::AuthEmailNotVerified => "AuthEmailNotVerified",
            Self::AuthEmailAlreadyVerified => "AuthEmailAlreadyVerified",
            Self::AuthFailedRefresh => "AuthFailedRefresh",
            Self::AuthEmailExpired => "AuthEmailExpired",
            Self::TooManyMembersPerOrganization => "TooManyMembersPerOrganization",
            Self::TooManyApplicationsPerOrganization => "TooManyApplicationsPerOrganization",
            Self::TooManyEventsToday => "TooManyEventsToday",
            Self::TooManySubscriptionsPerApplication => "TooManySubscriptionsPerApplication",
            Self::TooManyEventTypesPerApplication => "TooManyEventTypesPerApplication",
            Self::JsonPayload => "JsonPayload",
            Self::Validation => "Validation",
            Self::NotFound => "NotFound",
            Self::InternalServerError => "InternalServerError",
            Self::Forbidden => "Forbidden",
            Self::RateLimited => "RateLimited",
            Self::ServiceUnavailable => "ServiceUnavailable",
        }
    }
}

impl std::fmt::Display for ProblemId {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// One of the values the API answers with.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum RequestAttemptStatusType {
    /// The `waiting` the API answers with.
    #[serde(rename = "waiting")]
    Waiting,
    /// The `pending` the API answers with.
    #[serde(rename = "pending")]
    Pending,
    /// The `in_progress` the API answers with.
    #[serde(rename = "in_progress")]
    InProgress,
    /// The `successful` the API answers with.
    #[serde(rename = "successful")]
    Successful,
    /// The `failed` the API answers with.
    #[serde(rename = "failed")]
    Failed,
}

impl RequestAttemptStatusType {
    /// The text this value travels as.
    pub const fn as_str(&self) -> &'static str {
        match self {
            Self::Waiting => "waiting",
            Self::Pending => "pending",
            Self::InProgress => "in_progress",
            Self::Successful => "successful",
            Self::Failed => "failed",
        }
    }
}

impl std::fmt::Display for RequestAttemptStatusType {
    fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        formatter.write_str(self.as_str())
    }
}

/// The `Application` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Application {
    /// `application_id`: Unique identifier of the application.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `name`: Name of the application. Length: 2-50 characters.
    #[serde(rename = "name")]
    pub name: String,
    /// `organization_id`: UUID of the organization this application belongs to.
    #[serde(rename = "organization_id")]
    pub organization_id: Uuid,
}

/// The `ApplicationInfo` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationInfo {
    /// `application_id`: Unique identifier of the application.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `consumption`: Current consumption metrics for this application.
    #[serde(rename = "consumption")]
    pub consumption: ApplicationInfoConsumption,
    /// `name`: Name of the application. Length: 2-50 characters.
    #[serde(rename = "name")]
    pub name: String,
    /// `onboarding_steps`: Onboarding completion status for this application.
    #[serde(rename = "onboarding_steps")]
    pub onboarding_steps: ApplicationInfoOnboardingSteps,
    /// `organization_id`: UUID of the organization this application belongs to.
    #[serde(rename = "organization_id")]
    pub organization_id: Uuid,
    /// `quotas`: Quota limits for this application.
    #[serde(rename = "quotas")]
    pub quotas: ApplicationInfoQuotas,
}

/// The `ApplicationInfoConsumption` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationInfoConsumption {
    /// `events_per_day`.
    #[serde(rename = "events_per_day")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub events_per_day: Option<i32>,
}

/// The `ApplicationInfoOnboardingSteps` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationInfoOnboardingSteps {
    /// `event`.
    #[serde(rename = "event")]
    pub event: ApplicationInfoOnboardingStepsEvent,
    /// `event_type`.
    #[serde(rename = "event_type")]
    pub event_type: ApplicationInfoOnboardingStepsEventType,
    /// `subscription`.
    #[serde(rename = "subscription")]
    pub subscription: ApplicationInfoOnboardingStepsSubscription,
}

/// The `ApplicationInfoQuotas` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationInfoQuotas {
    /// `days_of_events_retention_limit`.
    #[serde(rename = "days_of_events_retention_limit")]
    pub days_of_events_retention_limit: i32,
    /// `events_per_day_limit`.
    #[serde(rename = "events_per_day_limit")]
    pub events_per_day_limit: i32,
}

/// The `ApplicationPost` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationPost {
    /// `name`: Name of the application. Length: 2-50 characters.
    #[serde(rename = "name")]
    pub name: String,
    /// `organization_id`: UUID of the organization this application belongs to.
    #[serde(rename = "organization_id")]
    pub organization_id: Uuid,
}

/// The `ApplicationSecret` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationSecret {
    /// `created_at`.
    #[serde(rename = "created_at")]
    pub created_at: DateTime<Utc>,
    /// `deleted_at`.
    #[serde(rename = "deleted_at")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub deleted_at: Option<DateTime<Utc>>,
    /// `name`.
    #[serde(rename = "name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// `token`.
    #[serde(rename = "token")]
    pub token: Uuid,
}

/// The `ApplicationSecretPost` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationSecretPost {
    /// `application_id`.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `name`.
    #[serde(rename = "name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}

/// The `Event` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Event {
    /// `event_id`.
    #[serde(rename = "event_id")]
    pub event_id: Uuid,
    /// `event_type_name`.
    #[serde(rename = "event_type_name")]
    pub event_type_name: String,
    /// `ip`.
    #[serde(rename = "ip")]
    pub ip: String,
    /// `labels`.
    #[serde(rename = "labels")]
    pub labels: Value,
    /// `metadata`.
    #[serde(rename = "metadata")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Value>,
    /// `occurred_at`.
    #[serde(rename = "occurred_at")]
    pub occurred_at: DateTime<Utc>,
    /// `payload_content_type`.
    #[serde(rename = "payload_content_type")]
    pub payload_content_type: String,
    /// `received_at`.
    #[serde(rename = "received_at")]
    pub received_at: DateTime<Utc>,
}

/// The `EventPost` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventPost {
    /// `application_id`: UUID of the application this event belongs to.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `event_id`: Optional unique identifier for this event (client-generated UUID). If not provided, a UUIDv7 will be generated by the server.
    #[serde(rename = "event_id")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event_id: Option<Uuid>,
    /// `event_type`: The type of event (e.g., 'user.created', 'order.completed'). Length: 1-200 characters.
    #[serde(rename = "event_type")]
    pub event_type: String,
    /// `labels`: Labels for event filtering and routing to subscriptions.
    #[serde(rename = "labels")]
    pub labels: HashMap<String, String>,
    /// `metadata`: Optional metadata key-value pairs associated with the event.
    #[serde(rename = "metadata")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<HashMap<String, String>>,
    /// `occurred_at`: Timestamp when the event occurred.
    #[serde(rename = "occurred_at")]
    pub occurred_at: DateTime<Utc>,
    /// `payload`: The event payload. For binary content, use base64 encoding. Max length: 699050 characters (512 KiB base64-encoded).
    #[serde(rename = "payload")]
    pub payload: String,
    /// `payload_content_type`: Content type of the payload. Valid values: text/plain, application/json, application/octet-stream+base64. Length: 1-100 characters.
    #[serde(rename = "payload_content_type")]
    pub payload_content_type: String,
}

/// The `EventType` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventType {
    /// `event_type_name`.
    #[serde(rename = "event_type_name")]
    pub event_type_name: String,
    /// `resource_type_name`.
    #[serde(rename = "resource_type_name")]
    pub resource_type_name: String,
    /// `service_name`.
    #[serde(rename = "service_name")]
    pub service_name: String,
    /// `verb_name`.
    #[serde(rename = "verb_name")]
    pub verb_name: String,
}

/// The `EventTypePost` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventTypePost {
    /// `application_id`.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `resource_type`.
    #[serde(rename = "resource_type")]
    pub resource_type: String,
    /// `service`.
    #[serde(rename = "service")]
    pub service: String,
    /// `verb`.
    #[serde(rename = "verb")]
    pub verb: String,
}

/// The `EventWithPayload` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventWithPayload {
    /// `event_id`.
    #[serde(rename = "event_id")]
    pub event_id: Uuid,
    /// `event_type_name`.
    #[serde(rename = "event_type_name")]
    pub event_type_name: String,
    /// `ip`.
    #[serde(rename = "ip")]
    pub ip: String,
    /// `labels`.
    #[serde(rename = "labels")]
    pub labels: Value,
    /// `metadata`.
    #[serde(rename = "metadata")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Value>,
    /// `occurred_at`.
    #[serde(rename = "occurred_at")]
    pub occurred_at: DateTime<Utc>,
    /// `payload`.
    #[serde(rename = "payload")]
    pub payload: String,
    /// `payload_content_type`.
    #[serde(rename = "payload_content_type")]
    pub payload_content_type: String,
    /// `received_at`.
    #[serde(rename = "received_at")]
    pub received_at: DateTime<Utc>,
}

/// The `EventsPerDayEntry` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventsPerDayEntry {
    /// `amount`.
    #[serde(rename = "amount")]
    pub amount: i32,
    /// `application_id`.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `application_name`.
    #[serde(rename = "application_name")]
    pub application_name: String,
    /// `date`.
    #[serde(rename = "date")]
    pub date: NaiveDate,
    /// `is_provisional`.
    #[serde(rename = "is_provisional")]
    pub is_provisional: bool,
}

/// The `IngestedEvent` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct IngestedEvent {
    /// `application_id`.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `event_id`.
    #[serde(rename = "event_id")]
    pub event_id: Uuid,
    /// `received_at`.
    #[serde(rename = "received_at")]
    pub received_at: DateTime<Utc>,
}

/// The `InstanceConfig` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct InstanceConfig {
    /// `application_secret_compatibility`.
    #[serde(rename = "application_secret_compatibility")]
    pub application_secret_compatibility: bool,
    /// `auto_db_migration`.
    #[serde(rename = "auto_db_migration")]
    pub auto_db_migration: bool,
    /// `biscuit_public_key`.
    #[serde(rename = "biscuit_public_key")]
    pub biscuit_public_key: String,
    /// `cloudflare_turnstile_site_key`.
    #[serde(rename = "cloudflare_turnstile_site_key")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cloudflare_turnstile_site_key: Option<String>,
    /// `formbricks`.
    #[serde(rename = "formbricks")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub formbricks: Option<InstanceConfigFormbricks>,
    /// `matomo`.
    #[serde(rename = "matomo")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub matomo: Option<InstanceConfigMatomo>,
    /// `password_minimum_length`.
    #[serde(rename = "password_minimum_length")]
    pub password_minimum_length: i32,
    /// `quota_enforcement`.
    #[serde(rename = "quota_enforcement")]
    pub quota_enforcement: bool,
    /// `registration_disabled`.
    #[serde(rename = "registration_disabled")]
    pub registration_disabled: bool,
    /// `support_email_address`.
    #[serde(rename = "support_email_address")]
    pub support_email_address: String,
}

/// The `InstanceConfigFormbricks` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct InstanceConfigFormbricks {
    /// `api_host`.
    #[serde(rename = "api_host")]
    pub api_host: String,
    /// `environment_id`.
    #[serde(rename = "environment_id")]
    pub environment_id: String,
}

/// The `InstanceConfigMatomo` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct InstanceConfigMatomo {
    /// `site_id`.
    #[serde(rename = "site_id")]
    pub site_id: i32,
    /// `url`.
    #[serde(rename = "url")]
    pub url: String,
}

/// The `Organization` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Organization {
    /// `name`.
    #[serde(rename = "name")]
    pub name: String,
    /// `organization_id`.
    #[serde(rename = "organization_id")]
    pub organization_id: Uuid,
    /// `plan`.
    #[serde(rename = "plan")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub plan: Option<OrganizationPlan>,
    /// `role`.
    #[serde(rename = "role")]
    pub role: String,
}

/// The `OrganizationInfo` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfo {
    /// `consumption`.
    #[serde(rename = "consumption")]
    pub consumption: OrganizationInfoConsumption,
    /// `name`.
    #[serde(rename = "name")]
    pub name: String,
    /// `onboarding_steps`.
    #[serde(rename = "onboarding_steps")]
    pub onboarding_steps: OrganizationInfoOnboardingSteps,
    /// `organization_id`.
    #[serde(rename = "organization_id")]
    pub organization_id: Uuid,
    /// `plan`.
    #[serde(rename = "plan")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub plan: Option<OrganizationInfoPlan>,
    /// `quotas`.
    #[serde(rename = "quotas")]
    pub quotas: OrganizationInfoQuotas,
    /// `users`.
    #[serde(rename = "users")]
    pub users: Vec<OrganizationInfoUsers>,
}

/// The `OrganizationInfoConsumption` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoConsumption {
    /// `applications`.
    #[serde(rename = "applications")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub applications: Option<i64>,
    /// `events_per_day`.
    #[serde(rename = "events_per_day")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub events_per_day: Option<i64>,
    /// `members`.
    #[serde(rename = "members")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub members: Option<i64>,
}

/// The `OrganizationInfoOnboardingSteps` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoOnboardingSteps {
    /// `application`.
    #[serde(rename = "application")]
    pub application: OrganizationInfoOnboardingStepsApplication,
    /// `event`.
    #[serde(rename = "event")]
    pub event: OrganizationInfoOnboardingStepsEvent,
    /// `event_type`.
    #[serde(rename = "event_type")]
    pub event_type: OrganizationInfoOnboardingStepsEventType,
    /// `subscription`.
    #[serde(rename = "subscription")]
    pub subscription: OrganizationInfoOnboardingStepsSubscription,
}

/// The `OrganizationInfoPlan` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoPlan {
    /// `label`.
    #[serde(rename = "label")]
    pub label: String,
    /// `name`.
    #[serde(rename = "name")]
    pub name: String,
}

/// The `OrganizationInfoQuotas` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoQuotas {
    /// `applications_per_organization_limit`.
    #[serde(rename = "applications_per_organization_limit")]
    pub applications_per_organization_limit: i32,
    /// `days_of_events_retention_limit`.
    #[serde(rename = "days_of_events_retention_limit")]
    pub days_of_events_retention_limit: i32,
    /// `events_per_day_limit`.
    #[serde(rename = "events_per_day_limit")]
    pub events_per_day_limit: i32,
    /// `members_per_organization_limit`.
    #[serde(rename = "members_per_organization_limit")]
    pub members_per_organization_limit: i32,
}

/// The `OrganizationInfoUsers` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoUsers {
    /// `email`.
    #[serde(rename = "email")]
    pub email: String,
    /// `first_name`.
    #[serde(rename = "first_name")]
    pub first_name: String,
    /// `last_name`.
    #[serde(rename = "last_name")]
    pub last_name: String,
    /// `role`.
    #[serde(rename = "role")]
    pub role: String,
    /// `user_id`.
    #[serde(rename = "user_id")]
    pub user_id: Uuid,
}

/// The `OrganizationPlan` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationPlan {
    /// `label`.
    #[serde(rename = "label")]
    pub label: String,
    /// `name`.
    #[serde(rename = "name")]
    pub name: String,
}

/// The `Problem` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Problem {
    /// `detail`.
    #[serde(rename = "detail")]
    pub detail: String,
    /// `id`: Identifier of the problem that occurred, stable across releases
    #[serde(rename = "id")]
    pub id: ProblemId,
    /// `status`.
    #[serde(rename = "status")]
    pub status: i32,
    /// `title`.
    #[serde(rename = "title")]
    pub title: String,
    /// `type`: Documentation page of this problem, which is also what distinguishes one problem type from another as RFC 7807 asks. Prefer matching on `id`: it says the same thing without parsing a URL.
    #[serde(rename = "type")]
    pub type_: String,
    /// `validation`: Which submitted values were rejected and why, keyed by the name of the field they were submitted under. Carried by validation failures (`Validation`, status 422) and `null` for every other problem, as
    #[serde(rename = "validation")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub validation: Option<Value>,
}

/// The `QuotasResponse` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct QuotasResponse {
    /// `enabled`.
    #[serde(rename = "enabled")]
    pub enabled: bool,
    /// `limits`.
    #[serde(rename = "limits")]
    pub limits: QuotasResponseLimits,
}

/// The `QuotasResponseLimits` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct QuotasResponseLimits {
    /// `global_applications_per_organization_limit`.
    #[serde(rename = "global_applications_per_organization_limit")]
    pub global_applications_per_organization_limit: i32,
    /// `global_days_of_events_retention_limit`.
    #[serde(rename = "global_days_of_events_retention_limit")]
    pub global_days_of_events_retention_limit: i32,
    /// `global_event_types_per_application_limit`.
    #[serde(rename = "global_event_types_per_application_limit")]
    pub global_event_types_per_application_limit: i32,
    /// `global_events_per_day_limit`.
    #[serde(rename = "global_events_per_day_limit")]
    pub global_events_per_day_limit: i32,
    /// `global_members_per_organization_limit`.
    #[serde(rename = "global_members_per_organization_limit")]
    pub global_members_per_organization_limit: i32,
    /// `global_subscriptions_per_application_limit`.
    #[serde(rename = "global_subscriptions_per_application_limit")]
    pub global_subscriptions_per_application_limit: i32,
}

/// The `ReplayEvent` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ReplayEvent {
    /// `application_id`.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
}

/// The `RequestAttempt` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct RequestAttempt {
    /// `created_at`.
    #[serde(rename = "created_at")]
    pub created_at: DateTime<Utc>,
    /// `delay_until`.
    #[serde(rename = "delay_until")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub delay_until: Option<DateTime<Utc>>,
    /// `event`.
    #[serde(rename = "event")]
    pub event: RequestAttemptEvent,
    /// `event_id`.
    #[serde(rename = "event_id")]
    pub event_id: Uuid,
    /// `failed_at`.
    #[serde(rename = "failed_at")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub failed_at: Option<DateTime<Utc>>,
    /// `http_response_status`.
    #[serde(rename = "http_response_status")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub http_response_status: Option<i32>,
    /// `picked_at`.
    #[serde(rename = "picked_at")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub picked_at: Option<DateTime<Utc>>,
    /// `request_attempt_id`.
    #[serde(rename = "request_attempt_id")]
    pub request_attempt_id: Uuid,
    /// `response_id`.
    #[serde(rename = "response_id")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub response_id: Option<Uuid>,
    /// `retry_count`.
    #[serde(rename = "retry_count")]
    pub retry_count: i32,
    /// `status`: Status of a request attempt. The 'type' field indicates the status variant. - waiting: {type, since, until} - Scheduled for future delivery - pending: {type, since} - Ready to be processed - in_progre
    #[serde(rename = "status")]
    pub status: RequestAttemptStatus,
    /// `subscription`.
    #[serde(rename = "subscription")]
    pub subscription: RequestAttemptSubscription,
    /// `succeeded_at`.
    #[serde(rename = "succeeded_at")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub succeeded_at: Option<DateTime<Utc>>,
}

/// The `RequestAttemptEvent` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct RequestAttemptEvent {
    /// `event_id`.
    #[serde(rename = "event_id")]
    pub event_id: Uuid,
    /// `event_type_name`.
    #[serde(rename = "event_type_name")]
    pub event_type_name: String,
}

/// The `RequestAttemptStatus` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct RequestAttemptStatus {
    /// `at`: Timestamp when completed (present in successful, failed)
    #[serde(rename = "at")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub at: Option<DateTime<Utc>>,
    /// `full_processing_ms`: Total processing time in milliseconds (present in successful, failed)
    #[serde(rename = "full_processing_ms")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub full_processing_ms: Option<i64>,
    /// `since`: Timestamp when the status started (present in waiting, pending, in_progress)
    #[serde(rename = "since")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub since: Option<DateTime<Utc>>,
    /// `type`: Status type discriminator. One of: waiting, pending, in_progress, successful, failed
    #[serde(rename = "type")]
    pub type_: RequestAttemptStatusType,
    /// `until`: Timestamp until which waiting (only present in waiting status)
    #[serde(rename = "until")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub until: Option<DateTime<Utc>>,
}

/// The `RequestAttemptSubscription` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct RequestAttemptSubscription {
    /// `description`.
    #[serde(rename = "description")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// `subscription_id`.
    #[serde(rename = "subscription_id")]
    pub subscription_id: Uuid,
}

/// The `Response` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Response {
    /// `body`.
    #[serde(rename = "body")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub body: Option<String>,
    /// `elapsed_time_ms`.
    #[serde(rename = "elapsed_time_ms")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub elapsed_time_ms: Option<i32>,
    /// `headers`.
    #[serde(rename = "headers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub headers: Option<HashMap<String, String>>,
    /// `http_code`.
    #[serde(rename = "http_code")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub http_code: Option<i32>,
    /// `response_error_name`.
    #[serde(rename = "response_error_name")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub response_error_name: Option<String>,
    /// `response_id`.
    #[serde(rename = "response_id")]
    pub response_id: Uuid,
}

/// The `ServiceToken` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ServiceToken {
    /// `biscuit`.
    #[serde(rename = "biscuit")]
    pub biscuit: String,
    /// `created_at`.
    #[serde(rename = "created_at")]
    pub created_at: DateTime<Utc>,
    /// `name`.
    #[serde(rename = "name")]
    pub name: String,
    /// `token_id`.
    #[serde(rename = "token_id")]
    pub token_id: Uuid,
}

/// The `ServiceTokenPost` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ServiceTokenPost {
    /// `name`.
    #[serde(rename = "name")]
    pub name: String,
    /// `organization_id`.
    #[serde(rename = "organization_id")]
    pub organization_id: Uuid,
}

/// The `Subscription` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Subscription {
    /// `application_id`.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `created_at`.
    #[serde(rename = "created_at")]
    pub created_at: DateTime<Utc>,
    /// `dedicated_workers`.
    #[serde(rename = "dedicated_workers")]
    pub dedicated_workers: Vec<String>,
    /// `description`.
    #[serde(rename = "description")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// `event_types`.
    #[serde(rename = "event_types")]
    pub event_types: Vec<String>,
    /// `is_enabled`.
    #[serde(rename = "is_enabled")]
    pub is_enabled: bool,
    /// `label_key`: _Kept for backward compatibility, you should use `labels`_
    #[serde(rename = "label_key")]
    pub label_key: String,
    /// `label_value`: _Kept for backward compatibility, you should use `labels`_
    #[serde(rename = "label_value")]
    pub label_value: String,
    /// `labels`.
    #[serde(rename = "labels")]
    pub labels: HashMap<String, String>,
    /// `metadata`.
    #[serde(rename = "metadata")]
    pub metadata: HashMap<String, String>,
    /// `secret`.
    #[serde(rename = "secret")]
    pub secret: Uuid,
    /// `subscription_id`.
    #[serde(rename = "subscription_id")]
    pub subscription_id: Uuid,
    /// `target`.
    #[serde(rename = "target")]
    pub target: SubscriptionTarget,
    /// `updated_at`.
    #[serde(rename = "updated_at")]
    pub updated_at: DateTime<Utc>,
}

/// The `SubscriptionPost` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct SubscriptionPost {
    /// `application_id`.
    #[serde(rename = "application_id")]
    pub application_id: Uuid,
    /// `dedicated_workers`.
    #[serde(rename = "dedicated_workers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dedicated_workers: Option<Vec<String>>,
    /// `description`.
    #[serde(rename = "description")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// `event_types`.
    #[serde(rename = "event_types")]
    pub event_types: Vec<String>,
    /// `is_enabled`.
    #[serde(rename = "is_enabled")]
    pub is_enabled: bool,
    /// `label_key`: _Kept for backward compatibility, you should use `labels`_
    #[serde(rename = "label_key")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub label_key: Option<String>,
    /// `label_value`: _Kept for backward compatibility, you should use `labels`_
    #[serde(rename = "label_value")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub label_value: Option<String>,
    /// `labels`.
    #[serde(rename = "labels")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<HashMap<String, String>>,
    /// `metadata`.
    #[serde(rename = "metadata")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<HashMap<String, String>>,
    /// `target`.
    #[serde(rename = "target")]
    pub target: SubscriptionPostTarget,
}

/// The `SubscriptionPostTarget` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct SubscriptionPostTarget {
    /// `headers`.
    #[serde(rename = "headers")]
    pub headers: Value,
    /// `method`.
    #[serde(rename = "method")]
    pub method: String,
    /// `type`.
    #[serde(rename = "type")]
    pub type_: String,
    /// `url`.
    #[serde(rename = "url")]
    pub url: Url,
}

/// The `SubscriptionTarget` the API declares.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct SubscriptionTarget {
    /// `headers`.
    #[serde(rename = "headers")]
    pub headers: Value,
    /// `method`.
    #[serde(rename = "method")]
    pub method: String,
    /// `type`.
    #[serde(rename = "type")]
    pub type_: String,
    /// `url`.
    #[serde(rename = "url")]
    pub url: Url,
}