bitwarden_api_api/models/
payment_method_type.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15///
16#[repr(i64)]
17#[derive(
18    Clone,
19    Copy,
20    Debug,
21    Eq,
22    PartialEq,
23    Ord,
24    PartialOrd,
25    Hash,
26    serde_repr::Serialize_repr,
27    serde_repr::Deserialize_repr,
28)]
29pub enum PaymentMethodType {
30    Card = 0,
31    BankAccount = 1,
32    PayPal = 2,
33    BitPay = 3,
34    Credit = 4,
35    WireTransfer = 5,
36    Check = 8,
37    None = 255,
38}
39
40impl std::fmt::Display for PaymentMethodType {
41    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
42        match self {
43            Self::Card => write!(f, "0"),
44            Self::BankAccount => write!(f, "1"),
45            Self::PayPal => write!(f, "2"),
46            Self::BitPay => write!(f, "3"),
47            Self::Credit => write!(f, "4"),
48            Self::WireTransfer => write!(f, "5"),
49            Self::Check => write!(f, "8"),
50            Self::None => write!(f, "255"),
51        }
52    }
53}
54
55impl Default for PaymentMethodType {
56    fn default() -> PaymentMethodType {
57        Self::Card
58    }
59}