-
Notifications
You must be signed in to change notification settings - Fork 4
/
metagame.clj
57 lines (51 loc) · 1.68 KB
/
metagame.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
(ns happygapi.games.metagame
"Google Play Game Services API: metagame.
The API for Google Play Game Services.
See: https://developers.google.com/games/services/api/reference/rest/v1/metagame"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn getMetagameConfig$
"https://developers.google.com/games/services/api/reference/rest/v1/metagame/getMetagameConfig
Required parameters: none
Optional parameters: none
Return the metagame configuration data for the calling application."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth args]
{:pre [(util/has-keys? args #{})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/games/v1/"
"metagameConfig"
#{}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn listCategoriesByPlayer$
"https://developers.google.com/games/services/api/reference/rest/v1/metagame/listCategoriesByPlayer
Required parameters: collection, playerId
Optional parameters: language, maxResults, pageToken
List play data aggregated per category for the player corresponding to playerId."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth args]
{:pre [(util/has-keys? args #{:playerId :collection})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/games/v1/"
"players/{playerId}/categories/{collection}"
#{:playerId :collection}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))