clerk_rs/models/
email_address.rs1#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct EmailAddress {
13 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
14 pub id: Option<String>,
15 #[serde(rename = "object")]
17 pub object: Object,
18 #[serde(rename = "email_address")]
19 pub email_address: String,
20 #[serde(rename = "reserved")]
21 pub reserved: bool,
22 #[serde(rename = "verification", deserialize_with = "Option::deserialize")]
23 pub verification: Option<Box<crate::models::EmailAddressVerification>>,
24 #[serde(rename = "linked_to")]
25 pub linked_to: Vec<crate::models::IdentificationLink>,
26}
27
28impl EmailAddress {
29 pub fn new(
30 object: Object,
31 email_address: String,
32 reserved: bool,
33 verification: Option<crate::models::EmailAddressVerification>,
34 linked_to: Vec<crate::models::IdentificationLink>,
35 ) -> EmailAddress {
36 EmailAddress {
37 id: None,
38 object,
39 email_address,
40 reserved,
41 verification: if let Some(x) = verification { Some(Box::new(x)) } else { None },
42 linked_to,
43 }
44 }
45}
46
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum Object {
50 #[serde(rename = "email_address")]
51 EmailAddress,
52}
53
54impl Default for Object {
55 fn default() -> Object {
56 Self::EmailAddress
57 }
58}