/
achievements.clj
143 lines (121 loc) · 4.44 KB
/
achievements.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
(ns happygapi.gamesManagement.achievements
"Google Play Game Services Management API: achievements.
The Management API for Google Play Game Services.
See: https://developers.google.com/games/servicesapi/reference/rest/v1management/achievements"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn reset$
"https://developers.google.com/games/servicesapi/reference/rest/v1management/achievements/reset
Required parameters: achievementId
Optional parameters: none
Resets the achievement with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:achievementId})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/games/v1management/"
"achievements/{achievementId}/reset"
#{:achievementId}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn resetAll$
"https://developers.google.com/games/servicesapi/reference/rest/v1management/achievements/resetAll
Required parameters: none
Optional parameters: none
Resets all achievements for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/games/v1management/"
"achievements/reset"
#{}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn resetAllForAllPlayers$
"https://developers.google.com/games/servicesapi/reference/rest/v1management/achievements/resetAllForAllPlayers
Required parameters: none
Optional parameters: none
Resets all draft achievements for all players. This method is only available to user accounts for your developer console."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/games/v1management/"
"achievements/resetAllForAllPlayers"
#{}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn resetForAllPlayers$
"https://developers.google.com/games/servicesapi/reference/rest/v1management/achievements/resetForAllPlayers
Required parameters: achievementId
Optional parameters: none
Resets the achievement with the given ID for all players. This method is only available to user accounts for your developer console. Only draft achievements can be reset."
{:scopes ["https://www.googleapis.com/auth/games"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:achievementId})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/games/v1management/"
"achievements/{achievementId}/resetForAllPlayers"
#{:achievementId}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn resetMultipleForAllPlayers$
"https://developers.google.com/games/servicesapi/reference/rest/v1management/achievements/resetMultipleForAllPlayers
Required parameters: none
Optional parameters: none
Body:
{:achievement_ids [string], :kind string}
Resets achievements with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft achievements may be reset."
{: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/v1management/"
"achievements/resetMultipleForAllPlayers"
#{}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))