added deserialization fields for users

This commit is contained in:
Wyatt J. Miller 2021-12-18 20:10:32 -05:00
parent eb6ab00be4
commit 4d29b50868

View File

@ -0,0 +1,33 @@
use serde_derive::{Deserialize, Serialize};
pub struct User;
pub struct MutlipleUsers {
pub data: Vec<UserResponse>,
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 {}
}
}