summaryrefslogtreecommitdiff
path: root/src/helix/models.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2019-01-29 04:41:18 +0000
committerDavid Blajda <blajda@hotmail.com>2019-01-29 04:41:18 +0000
commit7804ad5f3de94ce63ee0acef72b725275f5f658b (patch)
treedfb3c53f3549e31e88b8cb9c563165937165eecd /src/helix/models.rs
parente2078919afbbdbd71422de4d0d834847975d0232 (diff)
Implement serialize for all models and for IntegerId
Diffstat (limited to 'src/helix/models.rs')
-rw-r--r--src/helix/models.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/helix/models.rs b/src/helix/models.rs
index af221bc..e63a9f4 100644
--- a/src/helix/models.rs
+++ b/src/helix/models.rs
@@ -7,7 +7,7 @@ use crate::types::{UserId, VideoId, ChannelId};
use crate::client::PaginationTrait;
-#[derive(Debug, Deserialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct DataContainer<T> {
pub data: Vec<T>
}
@@ -34,18 +34,18 @@ impl PaginationTrait for Credentials {
fn cursor<'a>(&'a self) -> Option<&'a str> { None }
}
-#[derive(Debug, Deserialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct PaginationContainer<T> {
pub data: Vec<T>,
pub pagination: Option<Cursor>
}
-#[derive(Debug, Deserialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct Cursor {
pub cursor: Option<String>
}
-#[derive(Debug, Deserialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct Video {
pub id: VideoId<'static>,
pub user_id: UserId<'static>,
@@ -70,7 +70,7 @@ pub struct Video {
pub duration: String,
}
-#[derive(Debug, Deserialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct User {
pub id: UserId<'static>,
pub login: String,
@@ -87,7 +87,7 @@ pub struct User {
pub email: Option<String>,
}
-#[derive(Debug, Deserialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct Clip {
pub id: String,
#[serde(with = "url_serde")]
@@ -108,7 +108,7 @@ pub struct Clip {
pub view_count: i32,
}
-#[derive(Debug, Deserialize)]
+#[derive(Debug, Deserialize, Serialize)]
pub struct Credentials {
pub access_token: String,
pub refresh_token: Option<String>,