summaryrefslogtreecommitdiff
path: root/src/kraken/endpoints.rs
blob: 2dbc8d17f2ac10e872ce527cb8e919d3b1966c6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use futures::Future;
use super::models::Clip;
use super::Client;

use super::API_DOMAIN;

impl Client {
    pub fn clip(&self, id: &str) 
        -> impl Future<Item=Clip, Error=reqwest::Error> 
    {
        let url = String::from("https://") + API_DOMAIN + "/kraken/clips/" + id;
        let client = self.create_reqwest_client();

        client
            .get(&url)
            .send()
            .map(|mut res| res.json::<Clip>())
            .and_then(|json| json)
    }
}