clerk_fapi_rs/models/
stubs_verification_backup_code.rs

1/*
2 * Clerk Frontend API
3 *
4 * The Clerk REST Frontend API, meant to be accessed from a browser or native environment.  This is a Form Based API and all the data must be sent and formatted according to the `application/x-www-form-urlencoded` content type.  ### Versions  When the API changes in a way that isn't compatible with older versions, a new version is released. Each version is identified by its release date, e.g. `2021-02-05`. For more information, please see [Clerk API Versions](https://clerk.com/docs/backend-requests/versioning/overview).  ### Using the Try It Console  The `Try It` feature of the docs only works for **Development Instances** when using the `DevBrowser` security scheme. To use it, first generate a dev instance token from the `/v1/dev_browser` endpoint.  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
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct StubsVerificationBackupCode {
16    #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
17    pub object: Option<Object>,
18    #[serde(rename = "status")]
19    pub status: Status,
20    #[serde(rename = "strategy")]
21    pub strategy: Strategy,
22    #[serde(
23        rename = "attempts",
24        default,
25        with = "::serde_with::rust::double_option",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub attempts: Option<Option<i64>>,
29    #[serde(
30        rename = "expire_at",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub expire_at: Option<Option<i64>>,
36}
37
38impl StubsVerificationBackupCode {
39    pub fn new(status: Status, strategy: Strategy) -> StubsVerificationBackupCode {
40        StubsVerificationBackupCode {
41            object: None,
42            status,
43            strategy,
44            attempts: None,
45            expire_at: None,
46        }
47    }
48}
49
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
51pub enum Object {
52    #[serde(rename = "verification_backup_code")]
53    VerificationBackupCode,
54}
55
56impl Default for Object {
57    fn default() -> Object {
58        Self::VerificationBackupCode
59    }
60}
61
62#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
63pub enum Status {
64    #[serde(rename = "unverified")]
65    Unverified,
66    #[serde(rename = "verified")]
67    Verified,
68}
69
70impl Default for Status {
71    fn default() -> Status {
72        Self::Unverified
73    }
74}
75
76#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
77pub enum Strategy {
78    #[serde(rename = "backup_code")]
79    BackupCode,
80}
81
82impl Default for Strategy {
83    fn default() -> Strategy {
84        Self::BackupCode
85    }
86}