From 4d29b508682a490e10d779578d28da8ff21b8c35 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Sat, 18 Dec 2021 20:10:32 -0500 Subject: [PATCH] added deserialization fields for users --- src/user.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/user.rs b/src/user.rs index e69de29..37d4b20 100644 --- a/src/user.rs +++ b/src/user.rs @@ -0,0 +1,33 @@ +use serde_derive::{Deserialize, Serialize}; + +pub struct User; + +pub struct MutlipleUsers { + pub data: Vec, + pub ok: bool, +} + +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct UserResponse { + #[serde(rename = "avatar_url")] + pub avatar_url: String, + pub created: String, + pub email: String, + #[serde(rename = "full_name")] + pub full_name: String, + pub id: i64, + #[serde(rename = "is_admin")] + pub is_admin: bool, + pub language: String, + #[serde(rename = "last_login")] + pub last_login: String, + pub login: String, + pub restricted: bool, +} + +impl User { + pub fn new() -> User { + User {} + } +} \ No newline at end of file