summaryrefslogtreecommitdiff
path: root/src/helix/namespaces/videos.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/helix/namespaces/videos.rs')
-rw-r--r--src/helix/namespaces/videos.rs54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/helix/namespaces/videos.rs b/src/helix/namespaces/videos.rs
new file mode 100644
index 0000000..ad5ca28
--- /dev/null
+++ b/src/helix/namespaces/videos.rs
@@ -0,0 +1,54 @@
+use futures::future::Future;
+use super::super::models::{DataContainer, PaginationContainer, User, Video, Clip};
+use super::super::Client;
+use std::collections::BTreeMap;
+const API_DOMAIN: &'static str = "api.twitch.tv";
+use super::super::Namespace;
+
+pub struct Videos {}
+type VideosNamespace = Namespace<Videos>;
+
+impl VideosNamespace {
+ /*
+ pub fn videos(self, video_id) -> impl Future<Item=DataContainer<User>, Error=reqwest::Error> {
+ use self::videos;
+ users(self.client, id, login)
+ }
+ */
+}
+
+impl Client {
+
+ pub fn videos(&self) -> VideosNamespace {
+ VideosNamespace::new(self)
+ }
+}
+
+/*
+pub fn videos(
+ client: Client,
+ video_id: Option<Vec<&str>>,
+ user_id: Option<&str>,
+ game_id: Option<&str>,
+) -> impl Future<Item = PaginationContainer<Video>, Error = reqwest::Error> {
+ let mut url =
+ String::from("https://") + &String::from(API_DOMAIN) + &String::from("/helix/videos");
+
+ let mut params = BTreeMap::new();
+ for user in user_id {
+ params.insert("user_id", user);
+ }
+
+ let request = client.client().get(&url);
+ let request = client.apply_standard_headers(request);
+ let request = request.query(&params);
+
+ request
+ .send()
+ .map(|mut res| {
+ res.json::<PaginationContainer<Video>>()
+ })
+ .and_then(|json| json)
+
+}
+*/