diff options
author | David Blajda <blajda@hotmail.com> | 2019-05-08 15:38:37 +0000 |
---|---|---|
committer | David Blajda <blajda@hotmail.com> | 2019-05-08 15:38:37 +0000 |
commit | 98fb79b85e3cfbb547e5340b30623511daf09ef5 (patch) | |
tree | a03bd7a95c86a92eb7510409429f50433056d7ab /src/helix/namespaces/users.rs | |
parent | 0e09c2c06fc0b81f11d12985a4172c815233db17 (diff) |
:WIP: Move types to a different crate
Diffstat (limited to 'src/helix/namespaces/users.rs')
-rw-r--r-- | src/helix/namespaces/users.rs | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/helix/namespaces/users.rs b/src/helix/namespaces/users.rs deleted file mode 100644 index 2e922d6..0000000 --- a/src/helix/namespaces/users.rs +++ /dev/null @@ -1,44 +0,0 @@ -use super::*; -use super::models::{DataContainer, User}; -use std::string::ToString; - -pub struct Users {} -type UsersNamespace = Namespace<Users>; - -impl UsersNamespace { - pub fn users<S: ToString>(self, ids: &[S], logins: &[S]) -> ApiRequest<DataContainer<User>> { - use self::users; - users(self.client, ids, logins) - } -} - -impl Client { - pub fn users(&self) -> UsersNamespace { - UsersNamespace::new(self) - } -} - -pub fn users<S: ToString>( - client: Client, - ids: &[S], - logins: &[S], - ) -> ApiRequest<DataContainer<User>> { - let client = client.inner; - let url = - String::from("https://") + client.domain() + &String::from("/helix/users"); - - let mut params: BTreeMap<&str, &dyn ToString> = BTreeMap::new(); - for id in ids { - params.insert("id", id); - } - - for login in logins { - params.insert("login", login); - } - - ApiRequest::new(url, params, client, Method::GET, Some(RatelimitKey::Default)) -} - -pub fn authed_as(client: Client) -> ApiRequest<DataContainer<User>> { - users(client, &[""], &[""]) -} |