webhooks 0.0.1

Rust library for interacting with the Svix API and verifying webhook signatures.
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
/*
 * Svix API
 *
 * Welcome to the Svix API documentation!  Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/)  # Introduction  This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com).  ## Main concepts  In Svix you have four important entities you will be interacting with:  - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint.   ## Authentication  Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`.  <SecurityDefinitions />   ## Code samples  The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/).   ## Idempotency  Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response.  To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions.  Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result.  Please note that idempotency is only supported for `POST` requests.   ## Cross-Origin Resource Sharing  This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. 
 *
 * The version of the OpenAPI document: 1.4
 * 
 * Generated by: https://openapi-generator.tech
 */


use reqwest;

use crate::apis::ResponseContent;
use super::{Error, configuration};

/// struct for passing parameters to the method `create_endpoint_api_v1_app_app_id_endpoint_post`
#[derive(Clone, Debug)]
pub struct CreateEndpointApiV1AppAppIdEndpointPostParams {
    pub app_id: String,
    pub endpoint_in: crate::models::EndpointIn,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete`
#[derive(Clone, Debug)]
pub struct DeleteEndpointApiV1AppAppIdEndpointEndpointIdDeleteParams {
    pub endpoint_id: String,
    pub app_id: String,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get`
#[derive(Clone, Debug)]
pub struct GetEndpointApiV1AppAppIdEndpointEndpointIdGetParams {
    pub endpoint_id: String,
    pub app_id: String,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get`
#[derive(Clone, Debug)]
pub struct GetEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersGetParams {
    pub endpoint_id: String,
    pub app_id: String,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get`
#[derive(Clone, Debug)]
pub struct GetEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretGetParams {
    pub endpoint_id: String,
    pub app_id: String,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get`
#[derive(Clone, Debug)]
pub struct GetEndpointStatsApiV1AppAppIdEndpointEndpointIdStatsGetParams {
    pub endpoint_id: String,
    pub app_id: String,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `get_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_get`
#[derive(Clone, Debug)]
pub struct GetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationGetParams {
    pub endpoint_id: String,
    pub app_id: String,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `list_endpoints_api_v1_app_app_id_endpoint_get`
#[derive(Clone, Debug)]
pub struct ListEndpointsApiV1AppAppIdEndpointGetParams {
    pub app_id: String,
    pub iterator: Option<String>,
    pub limit: Option<i32>,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch`
#[derive(Clone, Debug)]
pub struct PatchEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPatchParams {
    pub app_id: String,
    pub endpoint_id: String,
    pub endpoint_headers_patch_in: crate::models::EndpointHeadersPatchIn,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post`
#[derive(Clone, Debug)]
pub struct RecoverFailedWebhooksApiV1AppAppIdEndpointEndpointIdRecoverPostParams {
    pub app_id: String,
    pub endpoint_id: String,
    pub recover_in: crate::models::RecoverIn,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post`
#[derive(Clone, Debug)]
pub struct RotateEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretRotatePostParams {
    pub endpoint_id: String,
    pub app_id: String,
    pub endpoint_secret_rotate_in: crate::models::EndpointSecretRotateIn,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post`
#[derive(Clone, Debug)]
pub struct SendEventTypeExampleMessageApiV1AppAppIdEndpointEndpointIdSendExamplePostParams {
    pub app_id: String,
    pub endpoint_id: String,
    pub event_example_in: crate::models::EventExampleIn,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `set_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_patch`
#[derive(Clone, Debug)]
pub struct SetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationPatchParams {
    pub app_id: String,
    pub endpoint_id: String,
    pub endpoint_transformation_in: crate::models::EndpointTransformationIn,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `simulate_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_simulate_post`
#[derive(Clone, Debug)]
pub struct SimulateEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationSimulatePostParams {
    pub endpoint_id: String,
    pub app_id: String,
    pub endpoint_transformation_simulate_in: crate::models::EndpointTransformationSimulateIn,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put`
#[derive(Clone, Debug)]
pub struct UpdateEndpointApiV1AppAppIdEndpointEndpointIdPutParams {
    pub endpoint_id: String,
    pub app_id: String,
    pub endpoint_update: crate::models::EndpointUpdate,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}

/// struct for passing parameters to the method `update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put`
#[derive(Clone, Debug)]
pub struct UpdateEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPutParams {
    pub app_id: String,
    pub endpoint_id: String,
    pub endpoint_headers_in: crate::models::EndpointHeadersIn,
    /// The request's idempotency key
    pub idempotency_key: Option<String>
}


/// struct for typed errors of method `create_endpoint_api_v1_app_app_id_endpoint_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateEndpointApiV1AppAppIdEndpointPostError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteEndpointApiV1AppAppIdEndpointEndpointIdDeleteError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEndpointApiV1AppAppIdEndpointEndpointIdGetError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersGetError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretGetError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEndpointStatsApiV1AppAppIdEndpointEndpointIdStatsGetError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `get_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_get`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationGetError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `list_endpoints_api_v1_app_app_id_endpoint_get`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ListEndpointsApiV1AppAppIdEndpointGetError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPatchError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RecoverFailedWebhooksApiV1AppAppIdEndpointEndpointIdRecoverPostError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RotateEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretRotatePostError {
    Status400(crate::models::HttpErrorOut),
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SendEventTypeExampleMessageApiV1AppAppIdEndpointEndpointIdSendExamplePostError {
    Status400(crate::models::HttpErrorOut),
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `set_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_patch`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationPatchError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `simulate_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_simulate_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SimulateEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationSimulatePostError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateEndpointApiV1AppAppIdEndpointEndpointIdPutError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}

/// struct for typed errors of method `update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPutError {
    Status401(crate::models::HttpErrorOut),
    Status403(crate::models::HttpErrorOut),
    Status404(crate::models::HttpErrorOut),
    Status409(crate::models::HttpErrorOut),
    Status422(crate::models::HttpValidationError),
    Status429(crate::models::HttpErrorOut),
    UnknownValue(serde_json::Value),
}


/// Create a new endpoint for the application.  When `secret` is `null` the secret is automatically generated (recommended)
pub async fn create_endpoint_api_v1_app_app_id_endpoint_post(configuration: &configuration::Configuration, params: CreateEndpointApiV1AppAppIdEndpointPostParams) -> Result<crate::models::EndpointOut, Error<CreateEndpointApiV1AppAppIdEndpointPostError>> {
    // unbox the parameters
    let app_id = params.app_id;
    let endpoint_in = params.endpoint_in;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/", configuration.base_path, app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&endpoint_in);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<CreateEndpointApiV1AppAppIdEndpointPostError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Delete an endpoint.
pub async fn delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete(configuration: &configuration::Configuration, params: DeleteEndpointApiV1AppAppIdEndpointEndpointIdDeleteParams) -> Result<(), Error<DeleteEndpointApiV1AppAppIdEndpointEndpointIdDeleteError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        Ok(())
    } else {
        let local_var_entity: Option<DeleteEndpointApiV1AppAppIdEndpointEndpointIdDeleteError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Get an application.
pub async fn get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get(configuration: &configuration::Configuration, params: GetEndpointApiV1AppAppIdEndpointEndpointIdGetParams) -> Result<crate::models::EndpointOut, Error<GetEndpointApiV1AppAppIdEndpointEndpointIdGetError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<GetEndpointApiV1AppAppIdEndpointEndpointIdGetError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Get the additional headers to be sent with the webhook
pub async fn get_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_get(configuration: &configuration::Configuration, params: GetEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersGetParams) -> Result<crate::models::EndpointHeadersOut, Error<GetEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersGetError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<GetEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersGetError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Get the endpoint's signing secret.  This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
pub async fn get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get(configuration: &configuration::Configuration, params: GetEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretGetParams) -> Result<crate::models::EndpointSecretOut, Error<GetEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretGetError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<GetEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretGetError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Get basic statistics for the endpoint.
pub async fn get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get(configuration: &configuration::Configuration, params: GetEndpointStatsApiV1AppAppIdEndpointEndpointIdStatsGetParams) -> Result<crate::models::EndpointStats, Error<GetEndpointStatsApiV1AppAppIdEndpointEndpointIdStatsGetError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<GetEndpointStatsApiV1AppAppIdEndpointEndpointIdStatsGetError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Get the transformation code associated with this endpoint
pub async fn get_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_get(configuration: &configuration::Configuration, params: GetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationGetParams) -> Result<crate::models::EndpointTransformationOut, Error<GetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationGetError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<GetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationGetError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// List the application's endpoints.
pub async fn list_endpoints_api_v1_app_app_id_endpoint_get(configuration: &configuration::Configuration, params: ListEndpointsApiV1AppAppIdEndpointGetParams) -> Result<crate::models::ListResponseEndpointOut, Error<ListEndpointsApiV1AppAppIdEndpointGetError>> {
    // unbox the parameters
    let app_id = params.app_id;
    let iterator = params.iterator;
    let limit = params.limit;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/", configuration.base_path, app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());

    if let Some(ref local_var_str) = iterator {
        local_var_req_builder = local_var_req_builder.query(&[("iterator", &local_var_str.to_string())]);
    }
    if let Some(ref local_var_str) = limit {
        local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
    }
    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<ListEndpointsApiV1AppAppIdEndpointGetError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Partially set the additional headers to be sent with the webhook
pub async fn patch_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_patch(configuration: &configuration::Configuration, params: PatchEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPatchParams) -> Result<(), Error<PatchEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPatchError>> {
    // unbox the parameters
    let app_id = params.app_id;
    let endpoint_id = params.endpoint_id;
    let endpoint_headers_patch_in = params.endpoint_headers_patch_in;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/", configuration.base_path, app_id=crate::apis::urlencode(app_id), endpoint_id=crate::apis::urlencode(endpoint_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&endpoint_headers_patch_in);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        Ok(())
    } else {
        let local_var_entity: Option<PatchEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPatchError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Resend all failed messages since a given time.
pub async fn recover_failed_webhooks_api_v1_app_app_id_endpoint_endpoint_id_recover_post(configuration: &configuration::Configuration, params: RecoverFailedWebhooksApiV1AppAppIdEndpointEndpointIdRecoverPostParams) -> Result<serde_json::Value, Error<RecoverFailedWebhooksApiV1AppAppIdEndpointEndpointIdRecoverPostError>> {
    // unbox the parameters
    let app_id = params.app_id;
    let endpoint_id = params.endpoint_id;
    let recover_in = params.recover_in;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover/", configuration.base_path, app_id=crate::apis::urlencode(app_id), endpoint_id=crate::apis::urlencode(endpoint_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&recover_in);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<RecoverFailedWebhooksApiV1AppAppIdEndpointEndpointIdRecoverPostError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Rotates the endpoint's signing secret.  The previous secret will be valid for the next 24 hours.
pub async fn rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post(configuration: &configuration::Configuration, params: RotateEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretRotatePostParams) -> Result<(), Error<RotateEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretRotatePostError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let endpoint_secret_rotate_in = params.endpoint_secret_rotate_in;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&endpoint_secret_rotate_in);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        Ok(())
    } else {
        let local_var_entity: Option<RotateEndpointSecretApiV1AppAppIdEndpointEndpointIdSecretRotatePostError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Send an example message for event
pub async fn send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post(configuration: &configuration::Configuration, params: SendEventTypeExampleMessageApiV1AppAppIdEndpointEndpointIdSendExamplePostParams) -> Result<crate::models::MessageOut, Error<SendEventTypeExampleMessageApiV1AppAppIdEndpointEndpointIdSendExamplePostError>> {
    // unbox the parameters
    let app_id = params.app_id;
    let endpoint_id = params.endpoint_id;
    let event_example_in = params.event_example_in;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/", configuration.base_path, app_id=crate::apis::urlencode(app_id), endpoint_id=crate::apis::urlencode(endpoint_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&event_example_in);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<SendEventTypeExampleMessageApiV1AppAppIdEndpointEndpointIdSendExamplePostError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Set or unset the transformation code associated with this endpoint
pub async fn set_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_patch(configuration: &configuration::Configuration, params: SetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationPatchParams) -> Result<(), Error<SetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationPatchError>> {
    // unbox the parameters
    let app_id = params.app_id;
    let endpoint_id = params.endpoint_id;
    let endpoint_transformation_in = params.endpoint_transformation_in;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/", configuration.base_path, app_id=crate::apis::urlencode(app_id), endpoint_id=crate::apis::urlencode(endpoint_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&endpoint_transformation_in);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        Ok(())
    } else {
        let local_var_entity: Option<SetEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationPatchError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Simulate running the transformation on the payload and code
pub async fn simulate_endpoint_transformation_api_v1_app_app_id_endpoint_endpoint_id_transformation_simulate_post(configuration: &configuration::Configuration, params: SimulateEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationSimulatePostParams) -> Result<crate::models::EndpointTransformationSimulateOut, Error<SimulateEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationSimulatePostError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let endpoint_transformation_simulate_in = params.endpoint_transformation_simulate_in;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&endpoint_transformation_simulate_in);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<SimulateEndpointTransformationApiV1AppAppIdEndpointEndpointIdTransformationSimulatePostError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Update an endpoint.
pub async fn update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put(configuration: &configuration::Configuration, params: UpdateEndpointApiV1AppAppIdEndpointEndpointIdPutParams) -> Result<crate::models::EndpointOut, Error<UpdateEndpointApiV1AppAppIdEndpointEndpointIdPutError>> {
    // unbox the parameters
    let endpoint_id = params.endpoint_id;
    let app_id = params.app_id;
    let endpoint_update = params.endpoint_update;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/", configuration.base_path, endpoint_id=crate::apis::urlencode(endpoint_id), app_id=crate::apis::urlencode(app_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&endpoint_update);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        serde_json::from_str(&local_var_content).map_err(Error::from)
    } else {
        let local_var_entity: Option<UpdateEndpointApiV1AppAppIdEndpointEndpointIdPutError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}

/// Set the additional headers to be sent with the webhook
pub async fn update_endpoint_headers_api_v1_app_app_id_endpoint_endpoint_id_headers_put(configuration: &configuration::Configuration, params: UpdateEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPutParams) -> Result<(), Error<UpdateEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPutError>> {
    // unbox the parameters
    let app_id = params.app_id;
    let endpoint_id = params.endpoint_id;
    let endpoint_headers_in = params.endpoint_headers_in;
    let idempotency_key = params.idempotency_key;


    let local_var_client = &configuration.client;

    let local_var_uri_str = format!("{}/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers/", configuration.base_path, app_id=crate::apis::urlencode(app_id), endpoint_id=crate::apis::urlencode(endpoint_id));
    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());

    if let Some(ref local_var_user_agent) = configuration.user_agent {
        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
    }
    if let Some(local_var_param_value) = idempotency_key {
        local_var_req_builder = local_var_req_builder.header("idempotency-key", local_var_param_value.to_string());
    }
    if let Some(ref local_var_token) = configuration.bearer_access_token {
        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
    };
    local_var_req_builder = local_var_req_builder.json(&endpoint_headers_in);

    let local_var_req = local_var_req_builder.build()?;
    let local_var_resp = local_var_client.execute(local_var_req).await?;

    let local_var_status = local_var_resp.status();
    let local_var_content = local_var_resp.text().await?;

    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
        Ok(())
    } else {
        let local_var_entity: Option<UpdateEndpointHeadersApiV1AppAppIdEndpointEndpointIdHeadersPutError> = serde_json::from_str(&local_var_content).ok();
        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
        Err(Error::ResponseError(local_var_error))
    }
}