revolt_api/models/
response_verify_any_of_ticket.rs

1/*
2 * Revolt API
3 *
4 * Open source user-first chat platform.
5 *
6 * The version of the OpenAPI document: 0.6.5
7 * Contact: contact@revolt.chat
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// ResponseVerifyAnyOfTicket : Authorised MFA ticket, can be used to log in
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct ResponseVerifyAnyOfTicket {
17    /// Unique Id
18    #[serde(rename = "_id")]
19    pub _id: String,
20    /// Account Id
21    #[serde(rename = "account_id")]
22    pub account_id: String,
23    /// Unique Token
24    #[serde(rename = "token")]
25    pub token: String,
26    /// Whether this ticket has been validated (can be used for account actions)
27    #[serde(rename = "validated")]
28    pub validated: bool,
29    /// Whether this ticket is authorised (can be used to log a user in)
30    #[serde(rename = "authorised")]
31    pub authorised: bool,
32    /// TOTP code at time of ticket creation
33    #[serde(rename = "last_totp_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub last_totp_code: Option<Option<String>>,
35}
36
37impl ResponseVerifyAnyOfTicket {
38    /// Authorised MFA ticket, can be used to log in
39    pub fn new(_id: String, account_id: String, token: String, validated: bool, authorised: bool) -> ResponseVerifyAnyOfTicket {
40        ResponseVerifyAnyOfTicket {
41            _id,
42            account_id,
43            token,
44            validated,
45            authorised,
46            last_totp_code: None,
47        }
48    }
49}
50
51