-
Notifications
You must be signed in to change notification settings - Fork 22
/
sign_up.rs
163 lines (158 loc) · 4.5 KB
/
sign_up.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*
* Clerk Backend API
*
* The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.
*
* The version of the OpenAPI document: v1
* Contact: support@clerk.com
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct SignUp {
#[serde(rename = "object")]
pub object: Object,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "status")]
pub status: Status,
#[serde(rename = "required_fields", skip_serializing_if = "Option::is_none")]
pub required_fields: Option<Vec<String>>,
#[serde(rename = "optional_fields", skip_serializing_if = "Option::is_none")]
pub optional_fields: Option<Vec<String>>,
#[serde(rename = "missing_fields", skip_serializing_if = "Option::is_none")]
pub missing_fields: Option<Vec<String>>,
#[serde(rename = "unverified_fields", skip_serializing_if = "Option::is_none")]
pub unverified_fields: Option<Vec<String>>,
#[serde(rename = "verifications", skip_serializing_if = "Option::is_none")]
pub verifications: Option<serde_json::Value>,
#[serde(
rename = "username",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub username: Option<Option<String>>,
#[serde(
rename = "email_address",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub email_address: Option<Option<String>>,
#[serde(
rename = "phone_number",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub phone_number: Option<Option<String>>,
#[serde(
rename = "web3_wallet",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub web3_wallet: Option<Option<String>>,
#[serde(rename = "password_enabled")]
pub password_enabled: bool,
#[serde(
rename = "first_name",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub first_name: Option<Option<String>>,
#[serde(
rename = "last_name",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_name: Option<Option<String>>,
#[serde(rename = "unsafe_metadata", skip_serializing_if = "Option::is_none")]
pub unsafe_metadata: Option<serde_json::Value>,
#[serde(rename = "public_metadata", skip_serializing_if = "Option::is_none")]
pub public_metadata: Option<serde_json::Value>,
#[serde(rename = "custom_action")]
pub custom_action: bool,
#[serde(
rename = "external_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub external_id: Option<Option<String>>,
#[serde(
rename = "created_session_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub created_session_id: Option<Option<String>>,
#[serde(
rename = "created_user_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub created_user_id: Option<Option<String>>,
#[serde(rename = "abandon_at")]
pub abandon_at: i32,
#[serde(rename = "external_account", skip_serializing_if = "Option::is_none")]
pub external_account: Option<serde_json::Value>,
}
impl SignUp {
pub fn new(object: Object, id: String, status: Status, password_enabled: bool, custom_action: bool, abandon_at: i32) -> SignUp {
SignUp {
object,
id,
status,
required_fields: None,
optional_fields: None,
missing_fields: None,
unverified_fields: None,
verifications: None,
username: None,
email_address: None,
phone_number: None,
web3_wallet: None,
password_enabled,
first_name: None,
last_name: None,
unsafe_metadata: None,
public_metadata: None,
custom_action,
external_id: None,
created_session_id: None,
created_user_id: None,
abandon_at,
external_account: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Object {
#[serde(rename = "sign_up_attempt")]
SignUpAttempt,
}
impl Default for Object {
fn default() -> Object {
Self::SignUpAttempt
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "missing_requirements")]
MissingRequirements,
#[serde(rename = "complete")]
Complete,
#[serde(rename = "abandoned")]
Abandoned,
}
impl Default for Status {
fn default() -> Status {
Self::MissingRequirements
}
}