paypal_rust/resources/enums/
standard_entry_class_code.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
4pub enum StandardEntryClassCode {
5 #[serde(rename = "TEL")]
6 Tel,
7 #[serde(rename = "WEB")]
8 Web,
9 #[serde(rename = "CCD")]
10 Ccd,
11 #[serde(rename = "PPD")]
12 Ppd,
13}
14
15impl StandardEntryClassCode {
16 pub const fn as_str(self) -> &'static str {
17 match self {
18 Self::Tel => "TEL",
19 Self::Web => "WEB",
20 Self::Ccd => "CCD",
21 Self::Ppd => "PPD",
22 }
23 }
24}
25
26impl AsRef<str> for StandardEntryClassCode {
27 fn as_ref(&self) -> &str {
28 self.as_str()
29 }
30}
31
32impl std::fmt::Display for StandardEntryClassCode {
33 fn fmt(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
34 self.as_str().fmt(formatter)
35 }
36}