clerk_sdk_rust_community/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.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, 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<i32>>,
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<i32>>,
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    #[serde(rename = "ticket")]
62    Ticket,
63}
64
65impl Default for Strategy {
66    fn default() -> Strategy {
67        Self::Admin
68    }
69}