summaryrefslogtreecommitdiff
path: root/src/helix/namespaces/clips.rs
blob: 1de2e33a692ae86aabbb9b485554977893b425b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use super::*;
use super::models::{DataContainer, Clip};
use crate::types::ClipId;

pub struct Clips {}
type ClipsNamespace = Namespace<Clips>;

impl ClipsNamespace {
    pub fn clip(self, id: &ClipId) -> ApiRequest<DataContainer<Clip>> {
        use self::clip;
        clip(self.client, id)
    }
}

impl Client {
    pub fn clips(&self) -> ClipsNamespace {
        ClipsNamespace::new(self)
    }
}


pub fn clip(client: Client, id: &ClipId) 
    -> ApiRequest<DataContainer<Clip>>
{
    let client = client.inner;
    let url =
        String::from("https://") + 
        client.domain() + "/helix/clips" + "?id=" + id.as_ref();

    let params  = BTreeMap::new();

    ApiRequest::new(url, params, client, Method::GET, Some(RatelimitKey::Default))
}