flutterwave_v3_models/transactions/
resend_failed_webhook.rs1use std::default::Default;
2
3use serde::{Deserialize, Serialize};
4use validator::Validate;
5
6use crate::fwcall::{FwCall, ToFwCall};
7
8#[derive(Debug, Serialize, Deserialize, Validate)]
9pub struct ResendFailedWebhookReq {
10 pub id: String,
11 pub query: Option<ResendHookQuery>
12}
13
14#[derive(Debug, Serialize, Deserialize, Validate)]
15pub struct ResendHookQuery {
16 pub wait: i32
17}
18
19impl Default for ResendHookQuery {
20 fn default() -> Self {
21 Self { wait: 1 }
22 }
23}
24
25#[derive(Debug, Serialize, Deserialize)]
26pub struct ResendFailedWebhookRes {
27 pub status: String,
28 pub message: String,
29 pub data: Option<String>
30}
31
32impl<'a> ToFwCall<'a> for ResendFailedWebhookReq {
33 type ApiRequest = Self;
34
35 type ApiResponse = ResendFailedWebhookRes;
36
37 fn get_call(self) -> crate::fwcall::FwCall<'a, Self::ApiRequest, Self::ApiResponse> {
38 FwCall::new(
39 std::borrow::Cow::Owned(format!("/v3/transactions/{}/resend-hook?{}", self.id, serde_qs::to_string(&self.query.unwrap_or_default()).unwrap())),
40 reqwest::Method::POST,
41 None
42 )
43 }
44}