From 676f88c84381d4f4e654bd40ee0b3f19d7eaa5ef Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Tue, 20 Aug 2019 19:53:31 -0400 Subject: [PATCH] partial type definitions for login --- src/api/methods/login.rs | 29 +++++++++++++++++++++++++++++ src/api/methods/mod.rs | 1 + 2 files changed, 30 insertions(+) create mode 100644 src/api/methods/login.rs diff --git a/src/api/methods/login.rs b/src/api/methods/login.rs new file mode 100644 index 0000000..95633f1 --- /dev/null +++ b/src/api/methods/login.rs @@ -0,0 +1,29 @@ +use serde::Deserialize; + +/// Response for 5.4.1: GET /_matrix/client/r0/login +#[derive(Deserialize)] +pub struct ValidLoginFlows { + pub flows: Option, +} + +#[derive(Deserialize)] +pub struct LoginFlow { + pub r#type: Option, +} + +/// Request helper for 5.4.2: POST /_matrix/client/r0/login +pub struct LoginRequest { + +} + +/// Response object for a valid login from 5.4.2: POST /_matrix/client/r0/login +pub struct LoginResponse { + pub user_id: Option, + pub access_token: Option, + pub home_server: Option, + pub device_id: Option, + pub well_known: Option, +} + +pub struct DiscoveryInformation { +} diff --git a/src/api/methods/mod.rs b/src/api/methods/mod.rs index d086d5b..6c4fe46 100644 --- a/src/api/methods/mod.rs +++ b/src/api/methods/mod.rs @@ -1 +1,2 @@ +pub mod login; pub mod sync;