flutterwave_v3_models/transactions/
view_trans_timeline.rs

1use serde::{Deserialize, Serialize};
2use validator::Validate;
3
4use crate::fwcall::{FwCall, ToFwCall};
5
6#[derive(Debug, Serialize, Deserialize, Validate)]
7pub struct ViewTransTimelineReq {
8    pub id: i32
9}
10
11#[derive(Debug, Serialize, Deserialize)]
12pub struct ViewTransTimelineRes {
13    pub status: String,
14    pub message: String,
15    pub data: Vec<TimelineItem>
16}
17
18#[derive(Debug, Serialize, Deserialize)]
19pub struct TimelineItem {
20    pub note: String,
21    pub actor: String,
22    pub object: String,
23    pub action: String,
24    pub context: String,
25    pub created_at: String,
26}
27
28impl<'a> ToFwCall<'a> for ViewTransTimelineReq {
29    type ApiRequest = Self;
30
31    type ApiResponse = ViewTransTimelineRes;
32
33    fn get_call(self) -> crate::fwcall::FwCall<'a, Self::ApiRequest, Self::ApiResponse> {
34        FwCall::new(
35            std::borrow::Cow::Owned(format!("/v3/transactions/{}/events", self.id)),
36            reqwest::Method::GET,
37            None
38        )
39    }
40}