summaryrefslogtreecommitdiff
path: root/src/helix/models.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2018-12-13 20:56:55 +0000
committerDavid Blajda <blajda@hotmail.com>2018-12-13 20:56:55 +0000
commit8615cc2f030240ba2982dba893fe63f11a0c8a88 (patch)
tree30c7103625323404696331c2384130ce06f8bc96 /src/helix/models.rs
parent54bcdf63d941dbbd0b3e565259515f013f1ecd13 (diff)
Restructure project and included kraken endpoint
Diffstat (limited to 'src/helix/models.rs')
-rw-r--r--src/helix/models.rs76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/helix/models.rs b/src/helix/models.rs
new file mode 100644
index 0000000..2b01e7c
--- /dev/null
+++ b/src/helix/models.rs
@@ -0,0 +1,76 @@
+extern crate serde_json;
+extern crate chrono;
+
+use chrono::{Duration, DateTime, Utc};
+
+
+#[derive(Debug, Deserialize)]
+pub struct DataContainer<T> {
+ pub data: Vec<T>
+}
+
+#[derive(Debug, Deserialize)]
+pub struct Cursor {
+ cursor: String
+}
+
+#[derive(Debug, Deserialize)]
+pub struct PaginationContainer<T> {
+ pub data: Vec<T>,
+ pub pagination: Option<Cursor>
+}
+
+#[derive(Debug, Deserialize)]
+pub struct Video {
+ pub id: String,
+ pub user_id: String,
+ pub user_name: String,
+ pub title: String,
+ pub description: String,
+ //Should be converted to a DateTime
+ pub created_at: String,
+ pub published_at: String,
+ //Should be converted to a URL
+ pub url: String,
+ pub thumbnail_url: String,
+ pub viewable: String,
+ pub view_count: i32,
+ pub language: String,
+ #[serde(rename = "type")]
+ pub video_type: String,
+ //Should be converted to a Duration
+ pub duration: String,
+}
+
+#[derive(Debug, Deserialize)]
+pub struct User {
+ pub id: String,
+ pub login: String,
+ pub display_name: String,
+ #[serde(rename = "type")]
+ pub user_type: String,
+ pub broadcaster_type: String,
+ pub description: String,
+ pub profile_image_url: String,
+ pub offline_image_url: String,
+ pub view_count: u32,
+ pub email: Option<String>,
+}
+
+#[derive(Debug, Deserialize)]
+pub struct Clip {
+ pub id: String,
+ pub url: String,
+ pub embed_url: String,
+ pub broadcaster_id: String,
+ pub broadcaster_name: String,
+ pub creator_id: String,
+ pub creator_name: String,
+ pub video_id: String,
+ pub game_id: String,
+ pub language: String,
+ pub title: String,
+ pub created_at: String,
+ pub thumbnail_url: String,
+ pub view_count: i32,
+}