windmill_api/models/login.rs
1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.895.1
7 * Contact: contact@windmill.dev
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 Login {
16 #[serde(rename = "email")]
17 pub email: String,
18 #[serde(rename = "password")]
19 pub password: String,
20 /// Current code of the account's authenticator app, or one of its recovery codes. Required once the account has two-factor authentication enabled; the login answers \"Two-factor code required\" when it is missing and the password is correct.
21 #[serde(rename = "totp_code", skip_serializing_if = "Option::is_none")]
22 pub totp_code: Option<String>,
23}
24
25impl Login {
26 pub fn new(email: String, password: String) -> Login {
27 Login {
28 email,
29 password,
30 totp_code: None,
31 }
32 }
33}
34