clerk_rs/models/
email_address.rs

1/*
2 * Clerk Backend API
3 *
4 * The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: support@clerk.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[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	/// String representing the object's type. Objects of the same type share the same value.
16	#[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/// String representing the object's type. Objects of the same type share the same value.
48#[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}