use serde::Deserialize;
#[derive(Deserialize, Debug)]
#[must_use]
pub struct Balance {
pub balance: i64,
pub total_balance: i64,
pub currency: String,
pub spend_today: i64,
}
pub use get::Request as Get;
mod get {
use serde::Serialize;
use crate::endpoints::Endpoint;
pub struct Request<'a> {
query: Query<'a>,
}
impl<'a> Request<'a> {
pub(crate) const fn new(account_id: &'a str) -> Self {
let query = Query { account_id };
Self { query }
}
}
impl Endpoint for Request<'_> {
const METHOD: reqwest::Method = reqwest::Method::GET;
fn endpoint(&self) -> &'static str {
"/balance"
}
fn query(&self) -> Option<&dyn erased_serde::Serialize> {
Some(&self.query)
}
}
#[derive(Debug, Serialize)]
struct Query<'a> {
account_id: &'a str,
}
}