-
Notifications
You must be signed in to change notification settings - Fork 4
/
users.clj
65 lines (58 loc) · 1.97 KB
/
users.clj
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
(ns happygapi.poly.users
"Poly API: users.
The Poly API provides read access to assets hosted on <a href=\"https://poly.google.com\">poly.google.com</a> to all, and upload access to <a href=\"https://poly.google.com\">poly.google.com</a> for whitelisted accounts.
See: https://developers.google.com/poly/api/reference/rest/v1/users"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn likedassets-list$
"https://developers.google.com/poly/api/reference/rest/v1/users/likedassets/list
Required parameters: name
Optional parameters: orderBy, pageToken, pageSize, format
Lists assets that the user has liked. Only the value 'me', representing
the currently-authenticated user, is supported. May include assets with an
access level of UNLISTED."
{:scopes nil}
[auth args]
{:pre [(util/has-keys? args #{:name})]}
(util/get-response
(http/get
(util/get-url
"https://poly.googleapis.com/"
"v1/{+name}/likedassets"
#{:name}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn assets-list$
"https://developers.google.com/poly/api/reference/rest/v1/users/assets/list
Required parameters: name
Optional parameters: pageToken, pageSize, visibility, orderBy, format
Lists assets authored by the given user. Only the value 'me', representing
the currently-authenticated user, is supported. May include assets with an
access level of PRIVATE or
UNLISTED and assets which are
All Rights Reserved for the
currently-authenticated user."
{:scopes nil}
[auth args]
{:pre [(util/has-keys? args #{:name})]}
(util/get-response
(http/get
(util/get-url
"https://poly.googleapis.com/"
"v1/{+name}/assets"
#{:name}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))