summaryrefslogtreecommitdiff
path: root/twitch_api/src/kraken/namespaces/users.rs
blob: 1d5e4cb30509cc799a98c7bc88208999f94c3ea2 (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
use std::collections::BTreeMap;
use super::super::models::{User};
use super::super::Client; 
use crate::client::{RatelimitKey, ClientTrait, ApiRequest};
use reqwest::Method;
use super::Namespace;

pub struct Users {}
type UsersNamespace = Namespace<Users>;

impl UsersNamespace {
    pub fn by_id(self, id: &str) -> ApiRequest<User> {
        by_id(self.client, id)
    }
}

impl Client {
    pub fn users(&self) -> UsersNamespace {
        UsersNamespace::new(self)
    }
}

pub fn by_id(client: Client, id: &str) 
    -> ApiRequest<User>
{
    let client = client.inner;
    let url = String::from("https://") + client.domain() + "/kraken/users/" + id;
    let params  = BTreeMap::new();

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