lightspark/objects/
incoming_payment_to_attempts_connection.rs

1// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2use crate::objects::connection::Connection;
3use crate::objects::incoming_payment_attempt::IncomingPaymentAttempt;
4use crate::objects::page_info::PageInfo;
5use serde::{Deserialize, Serialize};
6use std::vec::Vec;
7
8/// The connection from incoming payment to all attempts.
9#[derive(Debug, Clone, Deserialize, Serialize)]
10pub struct IncomingPaymentToAttemptsConnection {
11    /// The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field).
12    #[serde(rename = "incoming_payment_to_attempts_connection_count")]
13    pub count: i64,
14
15    /// An object that holds pagination information about the objects in this connection.
16    #[serde(rename = "incoming_payment_to_attempts_connection_page_info")]
17    pub page_info: PageInfo,
18
19    /// The incoming payment attempts for the current page of this connection.
20    #[serde(rename = "incoming_payment_to_attempts_connection_entities")]
21    pub entities: Vec<IncomingPaymentAttempt>,
22
23    /// The typename of the object
24    #[serde(rename = "__typename")]
25    pub typename: String,
26}
27
28impl Connection for IncomingPaymentToAttemptsConnection {
29    /// The total count of objects in this connection, using the current filters. It is different from the number of objects returned in the current page (in the `entities` field).
30    fn get_count(&self) -> i64 {
31        self.count
32    }
33
34    /// An object that holds pagination information about the objects in this connection.
35    fn get_page_info(&self) -> PageInfo {
36        self.page_info.clone()
37    }
38
39    fn type_name(&self) -> &'static str {
40        "IncomingPaymentToAttemptsConnection"
41    }
42}
43
44pub const FRAGMENT: &str = "
45fragment IncomingPaymentToAttemptsConnectionFragment on IncomingPaymentToAttemptsConnection {
46    __typename
47    incoming_payment_to_attempts_connection_count: count
48    incoming_payment_to_attempts_connection_page_info: page_info {
49        __typename
50        page_info_has_next_page: has_next_page
51        page_info_has_previous_page: has_previous_page
52        page_info_start_cursor: start_cursor
53        page_info_end_cursor: end_cursor
54    }
55    incoming_payment_to_attempts_connection_entities: entities {
56        id
57    }
58}
59";