clerk_rs/models/
admin.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 Admin {
13	#[serde(rename = "status")]
14	pub status: Status,
15	#[serde(rename = "strategy")]
16	pub strategy: Strategy,
17	#[serde(
18		rename = "attempts",
19		default,
20		with = "::serde_with::rust::double_option",
21		skip_serializing_if = "Option::is_none"
22	)]
23	pub attempts: Option<Option<i64>>,
24	#[serde(
25		rename = "expire_at",
26		default,
27		with = "::serde_with::rust::double_option",
28		skip_serializing_if = "Option::is_none"
29	)]
30	pub expire_at: Option<Option<i64>>,
31}
32
33impl Admin {
34	pub fn new(status: Status, strategy: Strategy) -> Admin {
35		Admin {
36			status,
37			strategy,
38			attempts: None,
39			expire_at: None,
40		}
41	}
42}
43
44///
45#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
46pub enum Status {
47	#[serde(rename = "verified")]
48	Verified,
49}
50
51impl Default for Status {
52	fn default() -> Status {
53		Self::Verified
54	}
55}
56///
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Strategy {
59	#[serde(rename = "admin")]
60	Admin,
61}
62
63impl Default for Strategy {
64	fn default() -> Strategy {
65		Self::Admin
66	}
67}