stripe/resources/
issuing_card_ext.rs

1use serde::{Deserialize, Serialize};
2
3/// An enum representing the possible values of an `IssuingCardPin`'s `status` field.
4#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
5#[serde(rename_all = "snake_case")]
6pub enum IssuingCardPinStatus {
7    Active,
8    Blocked,
9}
10
11impl IssuingCardPinStatus {
12    pub fn as_str(self) -> &'static str {
13        match self {
14            IssuingCardPinStatus::Active => "active",
15            IssuingCardPinStatus::Blocked => "blocked",
16        }
17    }
18}
19
20impl AsRef<str> for IssuingCardPinStatus {
21    fn as_ref(&self) -> &str {
22        self.as_str()
23    }
24}
25
26impl std::fmt::Display for IssuingCardPinStatus {
27    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
28        self.as_str().fmt(f)
29    }
30}
31
32/// An enum representing the possible values of an `IssuingCardShipping`'s `status` field.
33#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
34#[serde(rename_all = "snake_case")]
35pub enum IssuingCardShippingStatus {
36    Canceled,
37    Delivered,
38    Failure,
39    Pending,
40    Returned,
41    Shipped,
42}
43
44impl IssuingCardShippingStatus {
45    pub fn as_str(self) -> &'static str {
46        match self {
47            IssuingCardShippingStatus::Canceled => "canceled",
48            IssuingCardShippingStatus::Delivered => "delivered",
49            IssuingCardShippingStatus::Failure => "failure",
50            IssuingCardShippingStatus::Pending => "pending",
51            IssuingCardShippingStatus::Returned => "returned",
52            IssuingCardShippingStatus::Shipped => "shipped",
53        }
54    }
55}
56
57impl AsRef<str> for IssuingCardShippingStatus {
58    fn as_ref(&self) -> &str {
59        self.as_str()
60    }
61}
62
63impl std::fmt::Display for IssuingCardShippingStatus {
64    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
65        self.as_str().fmt(f)
66    }
67}
68
69/// An enum representing the possible values of an `IssuingCardShipping`'s `type` field.
70#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
71#[serde(rename_all = "snake_case")]
72pub enum IssuingCardShippingType {
73    Bulk,
74    Individual,
75}
76
77impl IssuingCardShippingType {
78    pub fn as_str(self) -> &'static str {
79        match self {
80            IssuingCardShippingType::Bulk => "bulk",
81            IssuingCardShippingType::Individual => "individual",
82        }
83    }
84}
85
86impl AsRef<str> for IssuingCardShippingType {
87    fn as_ref(&self) -> &str {
88        self.as_str()
89    }
90}
91
92impl std::fmt::Display for IssuingCardShippingType {
93    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
94        self.as_str().fmt(f)
95    }
96}
97
98impl std::default::Default for IssuingCardShippingType {
99    fn default() -> Self {
100        Self::Individual
101    }
102}
103
104/// An enum representing the possible values of an `IssuingCard`'s `type` field.
105#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
106#[serde(rename_all = "snake_case")]
107pub enum IssuingCardType {
108    Physical,
109    Virtual,
110}
111
112impl IssuingCardType {
113    pub fn as_str(self) -> &'static str {
114        match self {
115            IssuingCardType::Physical => "physical",
116            IssuingCardType::Virtual => "virtual",
117        }
118    }
119}
120
121impl AsRef<str> for IssuingCardType {
122    fn as_ref(&self) -> &str {
123        self.as_str()
124    }
125}
126
127impl std::fmt::Display for IssuingCardType {
128    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
129        self.as_str().fmt(f)
130    }
131}
132
133impl std::default::Default for IssuingCardType {
134    fn default() -> Self {
135        Self::Physical
136    }
137}