use crate::objects::connection::Connection;
use crate::objects::currency_amount::CurrencyAmount;
use crate::objects::page_info::PageInfo;
use crate::objects::transaction::TransactionEnum;
use serde::{Deserialize, Serialize};
use std::vec::Vec;
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct AccountToTransactionsConnection {
#[serde(rename = "account_to_transactions_connection_count")]
pub count: i64,
#[serde(rename = "account_to_transactions_connection_page_info")]
pub page_info: PageInfo,
#[serde(rename = "account_to_transactions_connection_profit_loss")]
pub profit_loss: Option<CurrencyAmount>,
#[serde(rename = "account_to_transactions_connection_average_fee_earned")]
pub average_fee_earned: Option<CurrencyAmount>,
#[serde(rename = "account_to_transactions_connection_total_amount_transacted")]
pub total_amount_transacted: Option<CurrencyAmount>,
#[serde(rename = "account_to_transactions_connection_entities")]
pub entities: Vec<TransactionEnum>,
#[serde(rename = "__typename")]
pub typename: String,
}
impl Connection for AccountToTransactionsConnection {
fn get_count(&self) -> i64 {
self.count
}
fn get_page_info(&self) -> PageInfo {
self.page_info.clone()
}
fn type_name(&self) -> &'static str {
"AccountToTransactionsConnection"
}
}
pub const FRAGMENT: &str = "
fragment AccountToTransactionsConnectionFragment on AccountToTransactionsConnection {
__typename
account_to_transactions_connection_count: count
account_to_transactions_connection_page_info: page_info {
__typename
page_info_has_next_page: has_next_page
page_info_has_previous_page: has_previous_page
page_info_start_cursor: start_cursor
page_info_end_cursor: end_cursor
}
account_to_transactions_connection_profit_loss: profit_loss {
__typename
currency_amount_original_value: original_value
currency_amount_original_unit: original_unit
currency_amount_preferred_currency_unit: preferred_currency_unit
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
account_to_transactions_connection_average_fee_earned: average_fee_earned {
__typename
currency_amount_original_value: original_value
currency_amount_original_unit: original_unit
currency_amount_preferred_currency_unit: preferred_currency_unit
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
account_to_transactions_connection_total_amount_transacted: total_amount_transacted {
__typename
currency_amount_original_value: original_value
currency_amount_original_unit: original_unit
currency_amount_preferred_currency_unit: preferred_currency_unit
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
}
account_to_transactions_connection_entities: entities {
id
}
}
";