diff --git a/src/api/schemas.rs b/src/api/schemas.rs index 5a27a46..d53cd76 100644 --- a/src/api/schemas.rs +++ b/src/api/schemas.rs @@ -95,7 +95,7 @@ pub mod schemas { } } - #[derive(Debug, Serialize, Deserialize)] + #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "snake_case")] pub struct LoginSchema { login: String, @@ -106,6 +106,26 @@ pub mod schemas { gift_code_sku_id: Option, } + impl LoginSchema { + pub fn new( + login: String, + password: String, + undelete: Option, + captcha_key: Option, + login_source: Option, + gift_code_sku_id: Option, + ) -> LoginSchema { + LoginSchema { + login, + password, + undelete, + captcha_key, + login_source, + gift_code_sku_id, + } + } + } + #[derive(Debug, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub struct TotpSchema {