forked from Txio-labs/txio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.rs
More file actions
68 lines (60 loc) · 1.58 KB
/
Copy pathrequest.rs
File metadata and controls
68 lines (60 loc) · 1.58 KB
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
use serde::{Deserialize, Serialize};
use validator::Validate;
#[derive(Debug, Deserialize, Serialize, Validate)]
pub struct RegisterUserRequest {
#[validate(email)]
pub email: String,
#[validate(length(min = 8))]
pub password: String,
}
#[derive(Debug, Deserialize, Serialize, Validate)]
pub struct LoginRequest {
#[validate(email)]
pub email: String,
#[validate(length(min = 8))]
pub password: String,
}
#[derive(Debug, Deserialize, Validate)]
pub struct OTPRequest {
#[validate(email)]
pub email: String,
}
#[derive(Debug, Deserialize, Validate)]
pub struct VerifyOTPRequest {
#[validate(email)]
pub email: String,
#[validate(length(min = 6, max = 6))]
pub otp: String,
}
#[derive(Debug, Deserialize, Validate)]
pub struct ResetPasswordWithOTPRequest {
#[validate(email)]
pub email: String,
#[validate(length(min = 6, max = 6))]
pub otp: String,
#[validate(length(min = 8))]
pub new_password: String,
}
#[derive(Debug, Deserialize, Validate)]
pub struct UpdateEmailRequest {
#[validate(email)]
pub old_email: String,
#[validate(email)]
pub new_email: String,
}
#[derive(Debug, Deserialize, Validate)]
pub struct UpdatePasswordRequest {
#[validate(email)]
pub email: String,
#[validate(length(min = 8))]
pub new_password: String,
}
#[derive(Debug, Deserialize, Validate)]
pub struct SwitchNetworkRequest {
pub network: crate::model::user::SuiNetwork,
}
#[derive(Debug, Deserialize, Validate)]
pub struct TerminalCommandRequest {
#[validate(length(min = 1))]
pub command: String,
}