Implement LoginSchema

This commit is contained in:
bitfl0wer 2023-04-16 13:41:26 +02:00
parent d6ae03b656
commit 76dd665e91
No known key found for this signature in database
GPG Key ID: 84BBB60DF895ABF2
1 changed files with 21 additions and 1 deletions

View File

@ -95,7 +95,7 @@ pub mod schemas {
} }
} }
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub struct LoginSchema { pub struct LoginSchema {
login: String, login: String,
@ -106,6 +106,26 @@ pub mod schemas {
gift_code_sku_id: Option<String>, gift_code_sku_id: Option<String>,
} }
impl LoginSchema {
pub fn new(
login: String,
password: String,
undelete: Option<bool>,
captcha_key: Option<String>,
login_source: Option<String>,
gift_code_sku_id: Option<String>,
) -> LoginSchema {
LoginSchema {
login,
password,
undelete,
captcha_key,
login_source,
gift_code_sku_id,
}
}
}
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub struct TotpSchema { pub struct TotpSchema {