-
Notifications
You must be signed in to change notification settings - Fork 4
/
applications.clj
82 lines (73 loc) · 2.47 KB
/
applications.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
(ns happygapi.games.applications
"Google Play Game Services API: applications.
The API for Google Play Game Services.
See: https://developers.google.com/games/services/api/reference/rest/v1/applications"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn get$
"https://developers.google.com/games/services/api/reference/rest/v1/applications/get
Required parameters: applicationId
Optional parameters: language, platformType
Retrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned response will not include any instance data."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth args]
{:pre [(util/has-keys? args #{:applicationId})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/games/v1/"
"applications/{applicationId}"
#{:applicationId}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn played$
"https://developers.google.com/games/services/api/reference/rest/v1/applications/played
Required parameters: none
Optional parameters: builtinGameId
Indicate that the the currently authenticated user is playing your application."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth args]
{:pre [(util/has-keys? args #{})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/games/v1/"
"applications/played"
#{}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn verify$
"https://developers.google.com/games/services/api/reference/rest/v1/applications/verify
Required parameters: applicationId
Optional parameters: none
Verifies the auth token provided with this request is for the application with the specified ID, and returns the ID of the player it was granted for."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth args]
{:pre [(util/has-keys? args #{:applicationId})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/games/v1/"
"applications/{applicationId}/verify"
#{:applicationId}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))