diff options
author | David Blajda <blajda@hotmail.com> | 2018-12-27 22:03:23 +0000 |
---|---|---|
committer | David Blajda <blajda@hotmail.com> | 2018-12-27 22:03:23 +0000 |
commit | 678e3d3f28cb8594204dc5e2b7597ae66a4582c7 (patch) | |
tree | 55b563cfdc09dab8f18c1f4d688ebf0c2187985c /src/helix/namespaces/clips.rs | |
parent | cb1b144e48ee357a76f551433d4886f092d259c8 (diff) |
Use Id types for endpoints and implement kraken headers
Diffstat (limited to 'src/helix/namespaces/clips.rs')
-rw-r--r-- | src/helix/namespaces/clips.rs | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/helix/namespaces/clips.rs b/src/helix/namespaces/clips.rs index 28b66f7..1de2e33 100644 --- a/src/helix/namespaces/clips.rs +++ b/src/helix/namespaces/clips.rs @@ -1,36 +1,31 @@ -use std::collections::BTreeMap; -use super::super::models::{DataContainer, Clip}; -use super::super::Client; -use super::Namespace; - -use crate::client::{RatelimitKey, ClientTrait, ApiRequest}; +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: &str) -> ApiRequest<DataContainer<Clip>> { + 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) } } -use reqwest::Method; -pub fn clip(client: Client, id: &str) +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; + client.domain() + "/helix/clips" + "?id=" + id.as_ref(); let params = BTreeMap::new(); |