ynab_api/models/
account_type.rs

1/*
2 * YNAB API Endpoints
3 *
4 * Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body.  API Documentation is at https://api.ynab.com
5 *
6 * The version of the OpenAPI document: 1.72.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// AccountType : The type of account
15/// The type of account
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum AccountType {
18    #[serde(rename = "checking")]
19    Checking,
20    #[serde(rename = "savings")]
21    Savings,
22    #[serde(rename = "cash")]
23    Cash,
24    #[serde(rename = "creditCard")]
25    CreditCard,
26    #[serde(rename = "lineOfCredit")]
27    LineOfCredit,
28    #[serde(rename = "otherAsset")]
29    OtherAsset,
30    #[serde(rename = "otherLiability")]
31    OtherLiability,
32    #[serde(rename = "mortgage")]
33    Mortgage,
34    #[serde(rename = "autoLoan")]
35    AutoLoan,
36    #[serde(rename = "studentLoan")]
37    StudentLoan,
38    #[serde(rename = "personalLoan")]
39    PersonalLoan,
40    #[serde(rename = "medicalDebt")]
41    MedicalDebt,
42    #[serde(rename = "otherDebt")]
43    OtherDebt,
44
45}
46
47impl std::fmt::Display for AccountType {
48    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
49        match self {
50            Self::Checking => write!(f, "checking"),
51            Self::Savings => write!(f, "savings"),
52            Self::Cash => write!(f, "cash"),
53            Self::CreditCard => write!(f, "creditCard"),
54            Self::LineOfCredit => write!(f, "lineOfCredit"),
55            Self::OtherAsset => write!(f, "otherAsset"),
56            Self::OtherLiability => write!(f, "otherLiability"),
57            Self::Mortgage => write!(f, "mortgage"),
58            Self::AutoLoan => write!(f, "autoLoan"),
59            Self::StudentLoan => write!(f, "studentLoan"),
60            Self::PersonalLoan => write!(f, "personalLoan"),
61            Self::MedicalDebt => write!(f, "medicalDebt"),
62            Self::OtherDebt => write!(f, "otherDebt"),
63        }
64    }
65}
66
67impl Default for AccountType {
68    fn default() -> AccountType {
69        Self::Checking
70    }
71}
72