ynab-api 4.0.0

OpenAPI-generated API bindings for the YNAB API
Documentation
/*
 * YNAB API Endpoints
 *
 * 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
 *
 * The version of the OpenAPI document: 1.72.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// AccountType : The type of account
/// The type of account
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AccountType {
    #[serde(rename = "checking")]
    Checking,
    #[serde(rename = "savings")]
    Savings,
    #[serde(rename = "cash")]
    Cash,
    #[serde(rename = "creditCard")]
    CreditCard,
    #[serde(rename = "lineOfCredit")]
    LineOfCredit,
    #[serde(rename = "otherAsset")]
    OtherAsset,
    #[serde(rename = "otherLiability")]
    OtherLiability,
    #[serde(rename = "mortgage")]
    Mortgage,
    #[serde(rename = "autoLoan")]
    AutoLoan,
    #[serde(rename = "studentLoan")]
    StudentLoan,
    #[serde(rename = "personalLoan")]
    PersonalLoan,
    #[serde(rename = "medicalDebt")]
    MedicalDebt,
    #[serde(rename = "otherDebt")]
    OtherDebt,

}

impl std::fmt::Display for AccountType {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Checking => write!(f, "checking"),
            Self::Savings => write!(f, "savings"),
            Self::Cash => write!(f, "cash"),
            Self::CreditCard => write!(f, "creditCard"),
            Self::LineOfCredit => write!(f, "lineOfCredit"),
            Self::OtherAsset => write!(f, "otherAsset"),
            Self::OtherLiability => write!(f, "otherLiability"),
            Self::Mortgage => write!(f, "mortgage"),
            Self::AutoLoan => write!(f, "autoLoan"),
            Self::StudentLoan => write!(f, "studentLoan"),
            Self::PersonalLoan => write!(f, "personalLoan"),
            Self::MedicalDebt => write!(f, "medicalDebt"),
            Self::OtherDebt => write!(f, "otherDebt"),
        }
    }
}

impl Default for AccountType {
    fn default() -> AccountType {
        Self::Checking
    }
}