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
/*
* Revolt API
*
* Open source user-first chat platform.
*
* The version of the OpenAPI document: 0.6.5
* Contact: contact@revolt.chat
* Generated by: https://openapi-generator.tech
*/
/// ResponseVerifyAnyOfTicket : Authorised MFA ticket, can be used to log in
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ResponseVerifyAnyOfTicket {
/// Unique Id
#[serde(rename = "_id")]
pub _id: String,
/// Account Id
#[serde(rename = "account_id")]
pub account_id: String,
/// Unique Token
#[serde(rename = "token")]
pub token: String,
/// Whether this ticket has been validated (can be used for account actions)
#[serde(rename = "validated")]
pub validated: bool,
/// Whether this ticket is authorised (can be used to log a user in)
#[serde(rename = "authorised")]
pub authorised: bool,
/// TOTP code at time of ticket creation
#[serde(rename = "last_totp_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub last_totp_code: Option<Option<String>>,
}
impl ResponseVerifyAnyOfTicket {
/// Authorised MFA ticket, can be used to log in
pub fn new(_id: String, account_id: String, token: String, validated: bool, authorised: bool) -> ResponseVerifyAnyOfTicket {
ResponseVerifyAnyOfTicket {
_id,
account_id,
token,
validated,
authorised,
last_totp_code: None,
}
}
}