use serde::{Serialize, Deserialize};
use super::{AccountBase, AuthGetNumbers, Item};
///AuthGetResponse defines the response schema for `/auth/get`
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AuthGetResponse {
///The `accounts` for which numbers are being retrieved.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub accounts: Vec<AccountBase>,
///Metadata about the Item.
pub item: Item,
///An object containing identifying numbers used for making electronic transfers to and from the `accounts`. The identifying number type (ACH, EFT, IBAN, or BACS) used will depend on the country of the account. An account may have more than one number type. If a particular identifying number type is not used by any `accounts` for which data has been requested, the array for that type will be empty.
pub numbers: AuthGetNumbers,
///A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.
pub request_id: String,
}
impl std::fmt::Display for AuthGetResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}