lightspark/objects/
account_to_api_tokens_connection.rs

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