summaryrefslogtreecommitdiff
path: root/src/kraken/models.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2019-05-08 15:38:37 +0000
committerDavid Blajda <blajda@hotmail.com>2019-05-08 15:38:37 +0000
commit98fb79b85e3cfbb547e5340b30623511daf09ef5 (patch)
treea03bd7a95c86a92eb7510409429f50433056d7ab /src/kraken/models.rs
parent0e09c2c06fc0b81f11d12985a4172c815233db17 (diff)
:WIP: Move types to a different crate
Diffstat (limited to 'src/kraken/models.rs')
-rw-r--r--src/kraken/models.rs79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/kraken/models.rs b/src/kraken/models.rs
deleted file mode 100644
index 931f849..0000000
--- a/src/kraken/models.rs
+++ /dev/null
@@ -1,79 +0,0 @@
-extern crate serde_json;
-extern crate chrono;
-extern crate url;
-
-use url::Url;
-use chrono::{DateTime, Utc};
-use super::types::{UserId, VideoId};
-use crate::client::PaginationTrait;
-
-#[derive(Debug, Deserialize, Serialize)]
-pub struct User {
- pub _id: String,
- pub bio: String,
- pub created_at: DateTime<Utc>,
- pub display_name: String,
- #[serde(with = "url_serde")]
- pub logo: Url,
- pub name: String,
- #[serde(rename = "type")]
- pub user_type: String,
- pub updated_at: DateTime<Utc>,
-}
-
-#[derive(Debug, Deserialize, Serialize)]
-pub struct Clip {
- pub slug: String,
- pub tracking_id: String,
- #[serde(with = "url_serde")]
- pub url: Url,
- #[serde(with = "url_serde")]
- pub embed_url: Url,
- pub embed_html: String,
- pub broadcaster: UserData,
- pub curator: UserData,
- pub vod: Vod,
- pub game: String,
- pub language: String,
- pub title: String,
- pub views: i32,
- pub duration: f32,
- pub created_at: DateTime<Utc>,
- pub thumbnails: Thumbnails,
-}
-
-impl PaginationTrait for Clip {
- fn cursor<'a>(&'a self) -> Option<&'a str> { None }
-}
-
-impl PaginationTrait for User {
- fn cursor<'a>(&'a self) -> Option<&'a str> { None }
-}
-
-
-#[derive(Debug, Deserialize, Serialize)]
-pub struct Thumbnails {
- #[serde(with = "url_serde")]
- pub medium: Url,
- #[serde(with = "url_serde")]
- pub small: Url,
- #[serde(with = "url_serde")]
- pub tiny: Url,
-}
-
-#[derive(Debug, Deserialize, Serialize)]
-pub struct UserData {
- pub id: UserId,
- pub name: String,
- pub display_name: String,
- #[serde(with = "url_serde")]
- pub channel_url: Url,
- pub logo: String,
-}
-
-#[derive(Debug, Deserialize, Serialize)]
-pub struct Vod {
- pub id: VideoId,
- #[serde(with = "url_serde")]
- pub url: Url,
-}