-
Notifications
You must be signed in to change notification settings - Fork 4
/
pushtokens.clj
76 lines (64 loc) · 2 KB
/
pushtokens.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
(ns happygapi.games.pushtokens
"Google Play Game Services API: pushtokens.
The API for Google Play Game Services.
See: https://developers.google.com/games/services/api/reference/rest/v1/pushtokens"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn remove$
"https://developers.google.com/games/services/api/reference/rest/v1/pushtokens/remove
Required parameters: none
Optional parameters: none
Body:
{:ios {:apns_device_token string, :apns_environment string},
:kind string}
Removes a push token for the current user and application. Removing a non-existent push token will report success."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/games/v1/"
"pushtokens/remove"
#{}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn update$
"https://developers.google.com/games/services/api/reference/rest/v1/pushtokens/update
Required parameters: none
Optional parameters: none
Body:
{:clientRevision string,
:id {:ios {:apns_device_token string, :apns_environment string},
:kind string},
:kind string,
:language string}
Registers a push token for the current user and application."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/put
(util/get-url
"https://www.googleapis.com/games/v1/"
"pushtokens"
#{}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))