clerk_rs/models/
saml_account.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 SamlAccount {
13	#[serde(rename = "id")]
14	pub id: 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 = "provider")]
19	pub provider: String,
20	#[serde(rename = "active")]
21	pub active: bool,
22	#[serde(rename = "email_address")]
23	pub email_address: String,
24	#[serde(
25		rename = "first_name",
26		default,
27		with = "::serde_with::rust::double_option",
28		skip_serializing_if = "Option::is_none"
29	)]
30	pub first_name: Option<Option<String>>,
31	#[serde(
32		rename = "last_name",
33		default,
34		with = "::serde_with::rust::double_option",
35		skip_serializing_if = "Option::is_none"
36	)]
37	pub last_name: Option<Option<String>>,
38	#[serde(
39		rename = "provider_user_id",
40		default,
41		with = "::serde_with::rust::double_option",
42		skip_serializing_if = "Option::is_none"
43	)]
44	pub provider_user_id: Option<Option<String>>,
45	#[serde(rename = "verification", deserialize_with = "Option::deserialize")]
46	pub verification: Option<Box<crate::models::SamlAccountVerification>>,
47}
48
49impl SamlAccount {
50	pub fn new(
51		id: String,
52		object: Object,
53		provider: String,
54		active: bool,
55		email_address: String,
56		verification: Option<crate::models::SamlAccountVerification>,
57	) -> SamlAccount {
58		SamlAccount {
59			id,
60			object,
61			provider,
62			active,
63			email_address,
64			first_name: None,
65			last_name: None,
66			provider_user_id: None,
67			verification: if let Some(x) = verification { Some(Box::new(x)) } else { None },
68		}
69	}
70}
71
72/// String representing the object's type. Objects of the same type share the same value.
73#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
74pub enum Object {
75	#[serde(rename = "saml_account")]
76	SamlAccount,
77}
78
79impl Default for Object {
80	fn default() -> Object {
81		Self::SamlAccount
82	}
83}