google-apis-games_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1181 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module GamesV1
23
+ # Google Play Game Services
24
+ #
25
+ # The Google Play games service allows developers to enhance games with social
26
+ # leaderboards, achievements, game state, sign-in with Google, and more.
27
+ #
28
+ # @example
29
+ # require 'google/apis/games_v1'
30
+ #
31
+ # Games = Google::Apis::GamesV1 # Alias the module
32
+ # service = Games::GamesService.new
33
+ #
34
+ # @see https://developers.google.com/games/
35
+ class GamesService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://games.googleapis.com/', '',
48
+ client_name: 'google-apis-games_v1',
49
+ client_version: Google::Apis::GamesV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Lists all the achievement definitions for your application.
54
+ # @param [String] language
55
+ # The preferred language to use for strings returned by this method.
56
+ # @param [Fixnum] max_results
57
+ # The maximum number of achievement resources to return in the response, used
58
+ # for paging. For any response, the actual number of achievement resources
59
+ # returned may be less than the specified `maxResults`.
60
+ # @param [String] page_token
61
+ # The token returned by the previous request.
62
+ # @param [String] fields
63
+ # Selector specifying which fields to include in a partial response.
64
+ # @param [String] quota_user
65
+ # Available to use for quota purposes for server-side applications. Can be any
66
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
67
+ # @param [Google::Apis::RequestOptions] options
68
+ # Request-specific options
69
+ #
70
+ # @yield [result, err] Result & error if block supplied
71
+ # @yieldparam result [Google::Apis::GamesV1::ListAchievementDefinitionsResponse] parsed result object
72
+ # @yieldparam err [StandardError] error object if request failed
73
+ #
74
+ # @return [Google::Apis::GamesV1::ListAchievementDefinitionsResponse]
75
+ #
76
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
77
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
78
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
79
+ def list_achievement_definitions(language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
80
+ command = make_simple_command(:get, 'games/v1/achievements', options)
81
+ command.response_representation = Google::Apis::GamesV1::ListAchievementDefinitionsResponse::Representation
82
+ command.response_class = Google::Apis::GamesV1::ListAchievementDefinitionsResponse
83
+ command.query['language'] = language unless language.nil?
84
+ command.query['maxResults'] = max_results unless max_results.nil?
85
+ command.query['pageToken'] = page_token unless page_token.nil?
86
+ command.query['fields'] = fields unless fields.nil?
87
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
88
+ execute_or_queue_command(command, &block)
89
+ end
90
+
91
+ # Increments the steps of the achievement with the given ID for the currently
92
+ # authenticated player.
93
+ # @param [String] achievement_id
94
+ # The ID of the achievement used by this method.
95
+ # @param [Fixnum] steps_to_increment
96
+ # The number of steps to increment.
97
+ # @param [Fixnum] request_id
98
+ # A randomly generated numeric ID for each request specified by the caller. This
99
+ # number is used at the server to ensure that the request is handled correctly
100
+ # across retries.
101
+ # @param [String] fields
102
+ # Selector specifying which fields to include in a partial response.
103
+ # @param [String] quota_user
104
+ # Available to use for quota purposes for server-side applications. Can be any
105
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
106
+ # @param [Google::Apis::RequestOptions] options
107
+ # Request-specific options
108
+ #
109
+ # @yield [result, err] Result & error if block supplied
110
+ # @yieldparam result [Google::Apis::GamesV1::AchievementIncrementResponse] parsed result object
111
+ # @yieldparam err [StandardError] error object if request failed
112
+ #
113
+ # @return [Google::Apis::GamesV1::AchievementIncrementResponse]
114
+ #
115
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
116
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
117
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
118
+ def increment_achievement(achievement_id, steps_to_increment, request_id: nil, fields: nil, quota_user: nil, options: nil, &block)
119
+ command = make_simple_command(:post, 'games/v1/achievements/{achievementId}/increment', options)
120
+ command.response_representation = Google::Apis::GamesV1::AchievementIncrementResponse::Representation
121
+ command.response_class = Google::Apis::GamesV1::AchievementIncrementResponse
122
+ command.params['achievementId'] = achievement_id unless achievement_id.nil?
123
+ command.query['requestId'] = request_id unless request_id.nil?
124
+ command.query['stepsToIncrement'] = steps_to_increment unless steps_to_increment.nil?
125
+ command.query['fields'] = fields unless fields.nil?
126
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
127
+ execute_or_queue_command(command, &block)
128
+ end
129
+
130
+ # Lists the progress for all your application's achievements for the currently
131
+ # authenticated player.
132
+ # @param [String] player_id
133
+ # A player ID. A value of `me` may be used in place of the authenticated player'
134
+ # s ID.
135
+ # @param [String] language
136
+ # The preferred language to use for strings returned by this method.
137
+ # @param [Fixnum] max_results
138
+ # The maximum number of achievement resources to return in the response, used
139
+ # for paging. For any response, the actual number of achievement resources
140
+ # returned may be less than the specified `maxResults`.
141
+ # @param [String] page_token
142
+ # The token returned by the previous request.
143
+ # @param [String] state
144
+ # Tells the server to return only achievements with the specified state. If this
145
+ # parameter isn't specified, all achievements are returned.
146
+ # @param [String] fields
147
+ # Selector specifying which fields to include in a partial response.
148
+ # @param [String] quota_user
149
+ # Available to use for quota purposes for server-side applications. Can be any
150
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
151
+ # @param [Google::Apis::RequestOptions] options
152
+ # Request-specific options
153
+ #
154
+ # @yield [result, err] Result & error if block supplied
155
+ # @yieldparam result [Google::Apis::GamesV1::ListPlayerAchievementResponse] parsed result object
156
+ # @yieldparam err [StandardError] error object if request failed
157
+ #
158
+ # @return [Google::Apis::GamesV1::ListPlayerAchievementResponse]
159
+ #
160
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
161
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
162
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
163
+ def list_achievements(player_id, language: nil, max_results: nil, page_token: nil, state: nil, fields: nil, quota_user: nil, options: nil, &block)
164
+ command = make_simple_command(:get, 'games/v1/players/{playerId}/achievements', options)
165
+ command.response_representation = Google::Apis::GamesV1::ListPlayerAchievementResponse::Representation
166
+ command.response_class = Google::Apis::GamesV1::ListPlayerAchievementResponse
167
+ command.params['playerId'] = player_id unless player_id.nil?
168
+ command.query['language'] = language unless language.nil?
169
+ command.query['maxResults'] = max_results unless max_results.nil?
170
+ command.query['pageToken'] = page_token unless page_token.nil?
171
+ command.query['state'] = state unless state.nil?
172
+ command.query['fields'] = fields unless fields.nil?
173
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
174
+ execute_or_queue_command(command, &block)
175
+ end
176
+
177
+ # Sets the state of the achievement with the given ID to `REVEALED` for the
178
+ # currently authenticated player.
179
+ # @param [String] achievement_id
180
+ # The ID of the achievement used by this method.
181
+ # @param [String] fields
182
+ # Selector specifying which fields to include in a partial response.
183
+ # @param [String] quota_user
184
+ # Available to use for quota purposes for server-side applications. Can be any
185
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
186
+ # @param [Google::Apis::RequestOptions] options
187
+ # Request-specific options
188
+ #
189
+ # @yield [result, err] Result & error if block supplied
190
+ # @yieldparam result [Google::Apis::GamesV1::AchievementRevealResponse] parsed result object
191
+ # @yieldparam err [StandardError] error object if request failed
192
+ #
193
+ # @return [Google::Apis::GamesV1::AchievementRevealResponse]
194
+ #
195
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
196
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
197
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
198
+ def reveal_achievement(achievement_id, fields: nil, quota_user: nil, options: nil, &block)
199
+ command = make_simple_command(:post, 'games/v1/achievements/{achievementId}/reveal', options)
200
+ command.response_representation = Google::Apis::GamesV1::AchievementRevealResponse::Representation
201
+ command.response_class = Google::Apis::GamesV1::AchievementRevealResponse
202
+ command.params['achievementId'] = achievement_id unless achievement_id.nil?
203
+ command.query['fields'] = fields unless fields.nil?
204
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
205
+ execute_or_queue_command(command, &block)
206
+ end
207
+
208
+ # Sets the steps for the currently authenticated player towards unlocking an
209
+ # achievement. If the steps parameter is less than the current number of steps
210
+ # that the player already gained for the achievement, the achievement is not
211
+ # modified.
212
+ # @param [String] achievement_id
213
+ # The ID of the achievement used by this method.
214
+ # @param [Fixnum] steps
215
+ # The minimum value to set the steps to.
216
+ # @param [String] fields
217
+ # Selector specifying which fields to include in a partial response.
218
+ # @param [String] quota_user
219
+ # Available to use for quota purposes for server-side applications. Can be any
220
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
221
+ # @param [Google::Apis::RequestOptions] options
222
+ # Request-specific options
223
+ #
224
+ # @yield [result, err] Result & error if block supplied
225
+ # @yieldparam result [Google::Apis::GamesV1::AchievementSetStepsAtLeastResponse] parsed result object
226
+ # @yieldparam err [StandardError] error object if request failed
227
+ #
228
+ # @return [Google::Apis::GamesV1::AchievementSetStepsAtLeastResponse]
229
+ #
230
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
231
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
232
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
233
+ def set_achievement_steps_at_least(achievement_id, steps, fields: nil, quota_user: nil, options: nil, &block)
234
+ command = make_simple_command(:post, 'games/v1/achievements/{achievementId}/setStepsAtLeast', options)
235
+ command.response_representation = Google::Apis::GamesV1::AchievementSetStepsAtLeastResponse::Representation
236
+ command.response_class = Google::Apis::GamesV1::AchievementSetStepsAtLeastResponse
237
+ command.params['achievementId'] = achievement_id unless achievement_id.nil?
238
+ command.query['steps'] = steps unless steps.nil?
239
+ command.query['fields'] = fields unless fields.nil?
240
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
241
+ execute_or_queue_command(command, &block)
242
+ end
243
+
244
+ # Unlocks this achievement for the currently authenticated player.
245
+ # @param [String] achievement_id
246
+ # The ID of the achievement used by this method.
247
+ # @param [String] fields
248
+ # Selector specifying which fields to include in a partial response.
249
+ # @param [String] quota_user
250
+ # Available to use for quota purposes for server-side applications. Can be any
251
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
252
+ # @param [Google::Apis::RequestOptions] options
253
+ # Request-specific options
254
+ #
255
+ # @yield [result, err] Result & error if block supplied
256
+ # @yieldparam result [Google::Apis::GamesV1::AchievementUnlockResponse] parsed result object
257
+ # @yieldparam err [StandardError] error object if request failed
258
+ #
259
+ # @return [Google::Apis::GamesV1::AchievementUnlockResponse]
260
+ #
261
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
262
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
263
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
264
+ def unlock_achievement(achievement_id, fields: nil, quota_user: nil, options: nil, &block)
265
+ command = make_simple_command(:post, 'games/v1/achievements/{achievementId}/unlock', options)
266
+ command.response_representation = Google::Apis::GamesV1::AchievementUnlockResponse::Representation
267
+ command.response_class = Google::Apis::GamesV1::AchievementUnlockResponse
268
+ command.params['achievementId'] = achievement_id unless achievement_id.nil?
269
+ command.query['fields'] = fields unless fields.nil?
270
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
271
+ execute_or_queue_command(command, &block)
272
+ end
273
+
274
+ # Updates multiple achievements for the currently authenticated player.
275
+ # @param [Google::Apis::GamesV1::AchievementUpdateMultipleRequest] achievement_update_multiple_request_object
276
+ # @param [String] fields
277
+ # Selector specifying which fields to include in a partial response.
278
+ # @param [String] quota_user
279
+ # Available to use for quota purposes for server-side applications. Can be any
280
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
281
+ # @param [Google::Apis::RequestOptions] options
282
+ # Request-specific options
283
+ #
284
+ # @yield [result, err] Result & error if block supplied
285
+ # @yieldparam result [Google::Apis::GamesV1::AchievementUpdateMultipleResponse] parsed result object
286
+ # @yieldparam err [StandardError] error object if request failed
287
+ #
288
+ # @return [Google::Apis::GamesV1::AchievementUpdateMultipleResponse]
289
+ #
290
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
291
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
292
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
293
+ def update_multiple_achievements(achievement_update_multiple_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
294
+ command = make_simple_command(:post, 'games/v1/achievements/updateMultiple', options)
295
+ command.request_representation = Google::Apis::GamesV1::AchievementUpdateMultipleRequest::Representation
296
+ command.request_object = achievement_update_multiple_request_object
297
+ command.response_representation = Google::Apis::GamesV1::AchievementUpdateMultipleResponse::Representation
298
+ command.response_class = Google::Apis::GamesV1::AchievementUpdateMultipleResponse
299
+ command.query['fields'] = fields unless fields.nil?
300
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
301
+ execute_or_queue_command(command, &block)
302
+ end
303
+
304
+ # Retrieves the metadata of the application with the given ID. If the requested
305
+ # application is not available for the specified `platformType`, the returned
306
+ # response will not include any instance data.
307
+ # @param [String] application_id
308
+ # The application ID from the Google Play developer console.
309
+ # @param [String] language
310
+ # The preferred language to use for strings returned by this method.
311
+ # @param [String] platform_type
312
+ # Restrict application details returned to the specific platform.
313
+ # @param [String] fields
314
+ # Selector specifying which fields to include in a partial response.
315
+ # @param [String] quota_user
316
+ # Available to use for quota purposes for server-side applications. Can be any
317
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
318
+ # @param [Google::Apis::RequestOptions] options
319
+ # Request-specific options
320
+ #
321
+ # @yield [result, err] Result & error if block supplied
322
+ # @yieldparam result [Google::Apis::GamesV1::Application] parsed result object
323
+ # @yieldparam err [StandardError] error object if request failed
324
+ #
325
+ # @return [Google::Apis::GamesV1::Application]
326
+ #
327
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
328
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
329
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
330
+ def get_application(application_id, language: nil, platform_type: nil, fields: nil, quota_user: nil, options: nil, &block)
331
+ command = make_simple_command(:get, 'games/v1/applications/{applicationId}', options)
332
+ command.response_representation = Google::Apis::GamesV1::Application::Representation
333
+ command.response_class = Google::Apis::GamesV1::Application
334
+ command.params['applicationId'] = application_id unless application_id.nil?
335
+ command.query['language'] = language unless language.nil?
336
+ command.query['platformType'] = platform_type unless platform_type.nil?
337
+ command.query['fields'] = fields unless fields.nil?
338
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
339
+ execute_or_queue_command(command, &block)
340
+ end
341
+
342
+ # Returns a URL for the requested end point type.
343
+ # @param [String] application_id
344
+ # The application ID from the Google Play developer console.
345
+ # @param [String] end_point_type
346
+ # Type of endpoint being requested.
347
+ # @param [String] fields
348
+ # Selector specifying which fields to include in a partial response.
349
+ # @param [String] quota_user
350
+ # Available to use for quota purposes for server-side applications. Can be any
351
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
352
+ # @param [Google::Apis::RequestOptions] options
353
+ # Request-specific options
354
+ #
355
+ # @yield [result, err] Result & error if block supplied
356
+ # @yieldparam result [Google::Apis::GamesV1::EndPoint] parsed result object
357
+ # @yieldparam err [StandardError] error object if request failed
358
+ #
359
+ # @return [Google::Apis::GamesV1::EndPoint]
360
+ #
361
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
362
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
363
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
364
+ def get_application_end_point(application_id: nil, end_point_type: nil, fields: nil, quota_user: nil, options: nil, &block)
365
+ command = make_simple_command(:post, 'games/v1/applications/getEndPoint', options)
366
+ command.response_representation = Google::Apis::GamesV1::EndPoint::Representation
367
+ command.response_class = Google::Apis::GamesV1::EndPoint
368
+ command.query['applicationId'] = application_id unless application_id.nil?
369
+ command.query['endPointType'] = end_point_type unless end_point_type.nil?
370
+ command.query['fields'] = fields unless fields.nil?
371
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
372
+ execute_or_queue_command(command, &block)
373
+ end
374
+
375
+ # Indicate that the currently authenticated user is playing your application.
376
+ # @param [String] fields
377
+ # Selector specifying which fields to include in a partial response.
378
+ # @param [String] quota_user
379
+ # Available to use for quota purposes for server-side applications. Can be any
380
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
381
+ # @param [Google::Apis::RequestOptions] options
382
+ # Request-specific options
383
+ #
384
+ # @yield [result, err] Result & error if block supplied
385
+ # @yieldparam result [NilClass] No result returned for this method
386
+ # @yieldparam err [StandardError] error object if request failed
387
+ #
388
+ # @return [void]
389
+ #
390
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
391
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
392
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
393
+ def played_application(fields: nil, quota_user: nil, options: nil, &block)
394
+ command = make_simple_command(:post, 'games/v1/applications/played', options)
395
+ command.query['fields'] = fields unless fields.nil?
396
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
397
+ execute_or_queue_command(command, &block)
398
+ end
399
+
400
+ # Verifies the auth token provided with this request is for the application with
401
+ # the specified ID, and returns the ID of the player it was granted for.
402
+ # @param [String] application_id
403
+ # The application ID from the Google Play developer console.
404
+ # @param [String] fields
405
+ # Selector specifying which fields to include in a partial response.
406
+ # @param [String] quota_user
407
+ # Available to use for quota purposes for server-side applications. Can be any
408
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
409
+ # @param [Google::Apis::RequestOptions] options
410
+ # Request-specific options
411
+ #
412
+ # @yield [result, err] Result & error if block supplied
413
+ # @yieldparam result [Google::Apis::GamesV1::ApplicationVerifyResponse] parsed result object
414
+ # @yieldparam err [StandardError] error object if request failed
415
+ #
416
+ # @return [Google::Apis::GamesV1::ApplicationVerifyResponse]
417
+ #
418
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
419
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
420
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
421
+ def verify_application(application_id, fields: nil, quota_user: nil, options: nil, &block)
422
+ command = make_simple_command(:get, 'games/v1/applications/{applicationId}/verify', options)
423
+ command.response_representation = Google::Apis::GamesV1::ApplicationVerifyResponse::Representation
424
+ command.response_class = Google::Apis::GamesV1::ApplicationVerifyResponse
425
+ command.params['applicationId'] = application_id unless application_id.nil?
426
+ command.query['fields'] = fields unless fields.nil?
427
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
428
+ execute_or_queue_command(command, &block)
429
+ end
430
+
431
+ # Returns a list showing the current progress on events in this application for
432
+ # the currently authenticated user.
433
+ # @param [String] language
434
+ # The preferred language to use for strings returned by this method.
435
+ # @param [Fixnum] max_results
436
+ # The maximum number of events to return in the response, used for paging. For
437
+ # any response, the actual number of events to return may be less than the
438
+ # specified maxResults.
439
+ # @param [String] page_token
440
+ # The token returned by the previous request.
441
+ # @param [String] fields
442
+ # Selector specifying which fields to include in a partial response.
443
+ # @param [String] quota_user
444
+ # Available to use for quota purposes for server-side applications. Can be any
445
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
446
+ # @param [Google::Apis::RequestOptions] options
447
+ # Request-specific options
448
+ #
449
+ # @yield [result, err] Result & error if block supplied
450
+ # @yieldparam result [Google::Apis::GamesV1::ListPlayerEventResponse] parsed result object
451
+ # @yieldparam err [StandardError] error object if request failed
452
+ #
453
+ # @return [Google::Apis::GamesV1::ListPlayerEventResponse]
454
+ #
455
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
456
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
457
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
458
+ def list_event_by_player(language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
459
+ command = make_simple_command(:get, 'games/v1/events', options)
460
+ command.response_representation = Google::Apis::GamesV1::ListPlayerEventResponse::Representation
461
+ command.response_class = Google::Apis::GamesV1::ListPlayerEventResponse
462
+ command.query['language'] = language unless language.nil?
463
+ command.query['maxResults'] = max_results unless max_results.nil?
464
+ command.query['pageToken'] = page_token unless page_token.nil?
465
+ command.query['fields'] = fields unless fields.nil?
466
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
467
+ execute_or_queue_command(command, &block)
468
+ end
469
+
470
+ # Returns a list of the event definitions in this application.
471
+ # @param [String] language
472
+ # The preferred language to use for strings returned by this method.
473
+ # @param [Fixnum] max_results
474
+ # The maximum number of event definitions to return in the response, used for
475
+ # paging. For any response, the actual number of event definitions to return may
476
+ # be less than the specified `maxResults`.
477
+ # @param [String] page_token
478
+ # The token returned by the previous request.
479
+ # @param [String] fields
480
+ # Selector specifying which fields to include in a partial response.
481
+ # @param [String] quota_user
482
+ # Available to use for quota purposes for server-side applications. Can be any
483
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
484
+ # @param [Google::Apis::RequestOptions] options
485
+ # Request-specific options
486
+ #
487
+ # @yield [result, err] Result & error if block supplied
488
+ # @yieldparam result [Google::Apis::GamesV1::ListEventDefinitionResponse] parsed result object
489
+ # @yieldparam err [StandardError] error object if request failed
490
+ #
491
+ # @return [Google::Apis::GamesV1::ListEventDefinitionResponse]
492
+ #
493
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
494
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
495
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
496
+ def list_event_definitions(language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
497
+ command = make_simple_command(:get, 'games/v1/eventDefinitions', options)
498
+ command.response_representation = Google::Apis::GamesV1::ListEventDefinitionResponse::Representation
499
+ command.response_class = Google::Apis::GamesV1::ListEventDefinitionResponse
500
+ command.query['language'] = language unless language.nil?
501
+ command.query['maxResults'] = max_results unless max_results.nil?
502
+ command.query['pageToken'] = page_token unless page_token.nil?
503
+ command.query['fields'] = fields unless fields.nil?
504
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
505
+ execute_or_queue_command(command, &block)
506
+ end
507
+
508
+ # Records a batch of changes to the number of times events have occurred for the
509
+ # currently authenticated user of this application.
510
+ # @param [Google::Apis::GamesV1::EventRecordRequest] event_record_request_object
511
+ # @param [String] language
512
+ # The preferred language to use for strings returned by this method.
513
+ # @param [String] fields
514
+ # Selector specifying which fields to include in a partial response.
515
+ # @param [String] quota_user
516
+ # Available to use for quota purposes for server-side applications. Can be any
517
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
518
+ # @param [Google::Apis::RequestOptions] options
519
+ # Request-specific options
520
+ #
521
+ # @yield [result, err] Result & error if block supplied
522
+ # @yieldparam result [Google::Apis::GamesV1::UpdateEventResponse] parsed result object
523
+ # @yieldparam err [StandardError] error object if request failed
524
+ #
525
+ # @return [Google::Apis::GamesV1::UpdateEventResponse]
526
+ #
527
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
528
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
529
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
530
+ def record_event(event_record_request_object = nil, language: nil, fields: nil, quota_user: nil, options: nil, &block)
531
+ command = make_simple_command(:post, 'games/v1/events', options)
532
+ command.request_representation = Google::Apis::GamesV1::EventRecordRequest::Representation
533
+ command.request_object = event_record_request_object
534
+ command.response_representation = Google::Apis::GamesV1::UpdateEventResponse::Representation
535
+ command.response_class = Google::Apis::GamesV1::UpdateEventResponse
536
+ command.query['language'] = language unless language.nil?
537
+ command.query['fields'] = fields unless fields.nil?
538
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
539
+ execute_or_queue_command(command, &block)
540
+ end
541
+
542
+ # Retrieves the metadata of the leaderboard with the given ID.
543
+ # @param [String] leaderboard_id
544
+ # The ID of the leaderboard.
545
+ # @param [String] language
546
+ # The preferred language to use for strings returned by this method.
547
+ # @param [String] fields
548
+ # Selector specifying which fields to include in a partial response.
549
+ # @param [String] quota_user
550
+ # Available to use for quota purposes for server-side applications. Can be any
551
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
552
+ # @param [Google::Apis::RequestOptions] options
553
+ # Request-specific options
554
+ #
555
+ # @yield [result, err] Result & error if block supplied
556
+ # @yieldparam result [Google::Apis::GamesV1::Leaderboard] parsed result object
557
+ # @yieldparam err [StandardError] error object if request failed
558
+ #
559
+ # @return [Google::Apis::GamesV1::Leaderboard]
560
+ #
561
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
562
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
563
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
564
+ def get_leaderboard(leaderboard_id, language: nil, fields: nil, quota_user: nil, options: nil, &block)
565
+ command = make_simple_command(:get, 'games/v1/leaderboards/{leaderboardId}', options)
566
+ command.response_representation = Google::Apis::GamesV1::Leaderboard::Representation
567
+ command.response_class = Google::Apis::GamesV1::Leaderboard
568
+ command.params['leaderboardId'] = leaderboard_id unless leaderboard_id.nil?
569
+ command.query['language'] = language unless language.nil?
570
+ command.query['fields'] = fields unless fields.nil?
571
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
572
+ execute_or_queue_command(command, &block)
573
+ end
574
+
575
+ # Lists all the leaderboard metadata for your application.
576
+ # @param [String] language
577
+ # The preferred language to use for strings returned by this method.
578
+ # @param [Fixnum] max_results
579
+ # The maximum number of leaderboards to return in the response. For any response,
580
+ # the actual number of leaderboards returned may be less than the specified `
581
+ # maxResults`.
582
+ # @param [String] page_token
583
+ # The token returned by the previous request.
584
+ # @param [String] fields
585
+ # Selector specifying which fields to include in a partial response.
586
+ # @param [String] quota_user
587
+ # Available to use for quota purposes for server-side applications. Can be any
588
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
589
+ # @param [Google::Apis::RequestOptions] options
590
+ # Request-specific options
591
+ #
592
+ # @yield [result, err] Result & error if block supplied
593
+ # @yieldparam result [Google::Apis::GamesV1::ListLeaderboardResponse] parsed result object
594
+ # @yieldparam err [StandardError] error object if request failed
595
+ #
596
+ # @return [Google::Apis::GamesV1::ListLeaderboardResponse]
597
+ #
598
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
599
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
600
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
601
+ def list_leaderboards(language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
602
+ command = make_simple_command(:get, 'games/v1/leaderboards', options)
603
+ command.response_representation = Google::Apis::GamesV1::ListLeaderboardResponse::Representation
604
+ command.response_class = Google::Apis::GamesV1::ListLeaderboardResponse
605
+ command.query['language'] = language unless language.nil?
606
+ command.query['maxResults'] = max_results unless max_results.nil?
607
+ command.query['pageToken'] = page_token unless page_token.nil?
608
+ command.query['fields'] = fields unless fields.nil?
609
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
610
+ execute_or_queue_command(command, &block)
611
+ end
612
+
613
+ # Return the metagame configuration data for the calling application.
614
+ # @param [String] fields
615
+ # Selector specifying which fields to include in a partial response.
616
+ # @param [String] quota_user
617
+ # Available to use for quota purposes for server-side applications. Can be any
618
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
619
+ # @param [Google::Apis::RequestOptions] options
620
+ # Request-specific options
621
+ #
622
+ # @yield [result, err] Result & error if block supplied
623
+ # @yieldparam result [Google::Apis::GamesV1::MetagameConfig] parsed result object
624
+ # @yieldparam err [StandardError] error object if request failed
625
+ #
626
+ # @return [Google::Apis::GamesV1::MetagameConfig]
627
+ #
628
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
629
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
630
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
631
+ def get_metagame_config(fields: nil, quota_user: nil, options: nil, &block)
632
+ command = make_simple_command(:get, 'games/v1/metagameConfig', options)
633
+ command.response_representation = Google::Apis::GamesV1::MetagameConfig::Representation
634
+ command.response_class = Google::Apis::GamesV1::MetagameConfig
635
+ command.query['fields'] = fields unless fields.nil?
636
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
637
+ execute_or_queue_command(command, &block)
638
+ end
639
+
640
+ # List play data aggregated per category for the player corresponding to `
641
+ # playerId`.
642
+ # @param [String] player_id
643
+ # A player ID. A value of `me` may be used in place of the authenticated player'
644
+ # s ID.
645
+ # @param [String] collection
646
+ # The collection of categories for which data will be returned.
647
+ # @param [String] language
648
+ # The preferred language to use for strings returned by this method.
649
+ # @param [Fixnum] max_results
650
+ # The maximum number of category resources to return in the response, used for
651
+ # paging. For any response, the actual number of category resources returned may
652
+ # be less than the specified `maxResults`.
653
+ # @param [String] page_token
654
+ # The token returned by the previous request.
655
+ # @param [String] fields
656
+ # Selector specifying which fields to include in a partial response.
657
+ # @param [String] quota_user
658
+ # Available to use for quota purposes for server-side applications. Can be any
659
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
660
+ # @param [Google::Apis::RequestOptions] options
661
+ # Request-specific options
662
+ #
663
+ # @yield [result, err] Result & error if block supplied
664
+ # @yieldparam result [Google::Apis::GamesV1::ListCategoryResponse] parsed result object
665
+ # @yieldparam err [StandardError] error object if request failed
666
+ #
667
+ # @return [Google::Apis::GamesV1::ListCategoryResponse]
668
+ #
669
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
670
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
671
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
672
+ def list_metagame_categories_by_player(player_id, collection, language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
673
+ command = make_simple_command(:get, 'games/v1/players/{playerId}/categories/{collection}', options)
674
+ command.response_representation = Google::Apis::GamesV1::ListCategoryResponse::Representation
675
+ command.response_class = Google::Apis::GamesV1::ListCategoryResponse
676
+ command.params['playerId'] = player_id unless player_id.nil?
677
+ command.params['collection'] = collection unless collection.nil?
678
+ command.query['language'] = language unless language.nil?
679
+ command.query['maxResults'] = max_results unless max_results.nil?
680
+ command.query['pageToken'] = page_token unless page_token.nil?
681
+ command.query['fields'] = fields unless fields.nil?
682
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
683
+ execute_or_queue_command(command, &block)
684
+ end
685
+
686
+ # Retrieves the Player resource with the given ID. To retrieve the player for
687
+ # the currently authenticated user, set `playerId` to `me`.
688
+ # @param [String] player_id
689
+ # A player ID. A value of `me` may be used in place of the authenticated player'
690
+ # s ID.
691
+ # @param [String] language
692
+ # The preferred language to use for strings returned by this method.
693
+ # @param [String] fields
694
+ # Selector specifying which fields to include in a partial response.
695
+ # @param [String] quota_user
696
+ # Available to use for quota purposes for server-side applications. Can be any
697
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
698
+ # @param [Google::Apis::RequestOptions] options
699
+ # Request-specific options
700
+ #
701
+ # @yield [result, err] Result & error if block supplied
702
+ # @yieldparam result [Google::Apis::GamesV1::Player] parsed result object
703
+ # @yieldparam err [StandardError] error object if request failed
704
+ #
705
+ # @return [Google::Apis::GamesV1::Player]
706
+ #
707
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
708
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
709
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
710
+ def get_player(player_id, language: nil, fields: nil, quota_user: nil, options: nil, &block)
711
+ command = make_simple_command(:get, 'games/v1/players/{playerId}', options)
712
+ command.response_representation = Google::Apis::GamesV1::Player::Representation
713
+ command.response_class = Google::Apis::GamesV1::Player
714
+ command.params['playerId'] = player_id unless player_id.nil?
715
+ command.query['language'] = language unless language.nil?
716
+ command.query['fields'] = fields unless fields.nil?
717
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
718
+ execute_or_queue_command(command, &block)
719
+ end
720
+
721
+ # Get the collection of players for the currently authenticated user.
722
+ # @param [String] collection
723
+ # Collection of players being retrieved
724
+ # @param [String] language
725
+ # The preferred language to use for strings returned by this method.
726
+ # @param [Fixnum] max_results
727
+ # The maximum number of player resources to return in the response, used for
728
+ # paging. For any response, the actual number of player resources returned may
729
+ # be less than the specified `maxResults`.
730
+ # @param [String] page_token
731
+ # The token returned by the previous request.
732
+ # @param [String] fields
733
+ # Selector specifying which fields to include in a partial response.
734
+ # @param [String] quota_user
735
+ # Available to use for quota purposes for server-side applications. Can be any
736
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
737
+ # @param [Google::Apis::RequestOptions] options
738
+ # Request-specific options
739
+ #
740
+ # @yield [result, err] Result & error if block supplied
741
+ # @yieldparam result [Google::Apis::GamesV1::ListPlayerResponse] parsed result object
742
+ # @yieldparam err [StandardError] error object if request failed
743
+ #
744
+ # @return [Google::Apis::GamesV1::ListPlayerResponse]
745
+ #
746
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
747
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
748
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
749
+ def list_players(collection, language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
750
+ command = make_simple_command(:get, 'games/v1/players/me/players/{collection}', options)
751
+ command.response_representation = Google::Apis::GamesV1::ListPlayerResponse::Representation
752
+ command.response_class = Google::Apis::GamesV1::ListPlayerResponse
753
+ command.params['collection'] = collection unless collection.nil?
754
+ command.query['language'] = language unless language.nil?
755
+ command.query['maxResults'] = max_results unless max_results.nil?
756
+ command.query['pageToken'] = page_token unless page_token.nil?
757
+ command.query['fields'] = fields unless fields.nil?
758
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
759
+ execute_or_queue_command(command, &block)
760
+ end
761
+
762
+ # Checks whether the games client is out of date.
763
+ # @param [String] client_revision
764
+ # The revision of the client SDK used by your application. Format: `[
765
+ # PLATFORM_TYPE]:[VERSION_NUMBER]`. Possible values of `PLATFORM_TYPE` are: * `
766
+ # ANDROID` - Client is running the Android SDK. * `IOS` - Client is running the
767
+ # iOS SDK. * `WEB_APP` - Client is running as a Web App.
768
+ # @param [String] fields
769
+ # Selector specifying which fields to include in a partial response.
770
+ # @param [String] quota_user
771
+ # Available to use for quota purposes for server-side applications. Can be any
772
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
773
+ # @param [Google::Apis::RequestOptions] options
774
+ # Request-specific options
775
+ #
776
+ # @yield [result, err] Result & error if block supplied
777
+ # @yieldparam result [Google::Apis::GamesV1::CheckRevisionResponse] parsed result object
778
+ # @yieldparam err [StandardError] error object if request failed
779
+ #
780
+ # @return [Google::Apis::GamesV1::CheckRevisionResponse]
781
+ #
782
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
783
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
784
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
785
+ def check_revision(client_revision, fields: nil, quota_user: nil, options: nil, &block)
786
+ command = make_simple_command(:get, 'games/v1/revisions/check', options)
787
+ command.response_representation = Google::Apis::GamesV1::CheckRevisionResponse::Representation
788
+ command.response_class = Google::Apis::GamesV1::CheckRevisionResponse
789
+ command.query['clientRevision'] = client_revision unless client_revision.nil?
790
+ command.query['fields'] = fields unless fields.nil?
791
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
792
+ execute_or_queue_command(command, &block)
793
+ end
794
+
795
+ # Get high scores, and optionally ranks, in leaderboards for the currently
796
+ # authenticated player. For a specific time span, `leaderboardId` can be set to `
797
+ # ALL` to retrieve data for all leaderboards in a given time span. `NOTE: You
798
+ # cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request;
799
+ # only one parameter may be set to 'ALL'.
800
+ # @param [String] player_id
801
+ # A player ID. A value of `me` may be used in place of the authenticated player'
802
+ # s ID.
803
+ # @param [String] leaderboard_id
804
+ # The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all
805
+ # leaderboards for this application.
806
+ # @param [String] time_span
807
+ # The time span for the scores and ranks you're requesting.
808
+ # @param [String] include_rank_type
809
+ # The types of ranks to return. If the parameter is omitted, no ranks will be
810
+ # returned.
811
+ # @param [String] language
812
+ # The preferred language to use for strings returned by this method.
813
+ # @param [Fixnum] max_results
814
+ # The maximum number of leaderboard scores to return in the response. For any
815
+ # response, the actual number of leaderboard scores returned may be less than
816
+ # the specified `maxResults`.
817
+ # @param [String] page_token
818
+ # The token returned by the previous request.
819
+ # @param [String] fields
820
+ # Selector specifying which fields to include in a partial response.
821
+ # @param [String] quota_user
822
+ # Available to use for quota purposes for server-side applications. Can be any
823
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
824
+ # @param [Google::Apis::RequestOptions] options
825
+ # Request-specific options
826
+ #
827
+ # @yield [result, err] Result & error if block supplied
828
+ # @yieldparam result [Google::Apis::GamesV1::ListPlayerLeaderboardScoreResponse] parsed result object
829
+ # @yieldparam err [StandardError] error object if request failed
830
+ #
831
+ # @return [Google::Apis::GamesV1::ListPlayerLeaderboardScoreResponse]
832
+ #
833
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
834
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
835
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
836
+ def get_score(player_id, leaderboard_id, time_span, include_rank_type: nil, language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
837
+ command = make_simple_command(:get, 'games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}', options)
838
+ command.response_representation = Google::Apis::GamesV1::ListPlayerLeaderboardScoreResponse::Representation
839
+ command.response_class = Google::Apis::GamesV1::ListPlayerLeaderboardScoreResponse
840
+ command.params['playerId'] = player_id unless player_id.nil?
841
+ command.params['leaderboardId'] = leaderboard_id unless leaderboard_id.nil?
842
+ command.params['timeSpan'] = time_span unless time_span.nil?
843
+ command.query['includeRankType'] = include_rank_type unless include_rank_type.nil?
844
+ command.query['language'] = language unless language.nil?
845
+ command.query['maxResults'] = max_results unless max_results.nil?
846
+ command.query['pageToken'] = page_token unless page_token.nil?
847
+ command.query['fields'] = fields unless fields.nil?
848
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
849
+ execute_or_queue_command(command, &block)
850
+ end
851
+
852
+ # Lists the scores in a leaderboard, starting from the top.
853
+ # @param [String] leaderboard_id
854
+ # The ID of the leaderboard.
855
+ # @param [String] collection
856
+ # The collection of scores you're requesting.
857
+ # @param [String] time_span
858
+ # The time span for the scores and ranks you're requesting.
859
+ # @param [String] language
860
+ # The preferred language to use for strings returned by this method.
861
+ # @param [Fixnum] max_results
862
+ # The maximum number of leaderboard scores to return in the response. For any
863
+ # response, the actual number of leaderboard scores returned may be less than
864
+ # the specified `maxResults`.
865
+ # @param [String] page_token
866
+ # The token returned by the previous request.
867
+ # @param [String] fields
868
+ # Selector specifying which fields to include in a partial response.
869
+ # @param [String] quota_user
870
+ # Available to use for quota purposes for server-side applications. Can be any
871
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
872
+ # @param [Google::Apis::RequestOptions] options
873
+ # Request-specific options
874
+ #
875
+ # @yield [result, err] Result & error if block supplied
876
+ # @yieldparam result [Google::Apis::GamesV1::LeaderboardScores] parsed result object
877
+ # @yieldparam err [StandardError] error object if request failed
878
+ #
879
+ # @return [Google::Apis::GamesV1::LeaderboardScores]
880
+ #
881
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
882
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
883
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
884
+ def list_scores(leaderboard_id, collection, time_span, language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
885
+ command = make_simple_command(:get, 'games/v1/leaderboards/{leaderboardId}/scores/{collection}', options)
886
+ command.response_representation = Google::Apis::GamesV1::LeaderboardScores::Representation
887
+ command.response_class = Google::Apis::GamesV1::LeaderboardScores
888
+ command.params['leaderboardId'] = leaderboard_id unless leaderboard_id.nil?
889
+ command.params['collection'] = collection unless collection.nil?
890
+ command.query['language'] = language unless language.nil?
891
+ command.query['maxResults'] = max_results unless max_results.nil?
892
+ command.query['pageToken'] = page_token unless page_token.nil?
893
+ command.query['timeSpan'] = time_span unless time_span.nil?
894
+ command.query['fields'] = fields unless fields.nil?
895
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
896
+ execute_or_queue_command(command, &block)
897
+ end
898
+
899
+ # Lists the scores in a leaderboard around (and including) a player's score.
900
+ # @param [String] leaderboard_id
901
+ # The ID of the leaderboard.
902
+ # @param [String] collection
903
+ # The collection of scores you're requesting.
904
+ # @param [String] time_span
905
+ # The time span for the scores and ranks you're requesting.
906
+ # @param [String] language
907
+ # The preferred language to use for strings returned by this method.
908
+ # @param [Fixnum] max_results
909
+ # The maximum number of leaderboard scores to return in the response. For any
910
+ # response, the actual number of leaderboard scores returned may be less than
911
+ # the specified `maxResults`.
912
+ # @param [String] page_token
913
+ # The token returned by the previous request.
914
+ # @param [Fixnum] results_above
915
+ # The preferred number of scores to return above the player's score. More scores
916
+ # may be returned if the player is at the bottom of the leaderboard; fewer may
917
+ # be returned if the player is at the top. Must be less than or equal to
918
+ # maxResults.
919
+ # @param [Boolean] return_top_if_absent
920
+ # True if the top scores should be returned when the player is not in the
921
+ # leaderboard. Defaults to true.
922
+ # @param [String] fields
923
+ # Selector specifying which fields to include in a partial response.
924
+ # @param [String] quota_user
925
+ # Available to use for quota purposes for server-side applications. Can be any
926
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
927
+ # @param [Google::Apis::RequestOptions] options
928
+ # Request-specific options
929
+ #
930
+ # @yield [result, err] Result & error if block supplied
931
+ # @yieldparam result [Google::Apis::GamesV1::LeaderboardScores] parsed result object
932
+ # @yieldparam err [StandardError] error object if request failed
933
+ #
934
+ # @return [Google::Apis::GamesV1::LeaderboardScores]
935
+ #
936
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
937
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
938
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
939
+ def list_score_window(leaderboard_id, collection, time_span, language: nil, max_results: nil, page_token: nil, results_above: nil, return_top_if_absent: nil, fields: nil, quota_user: nil, options: nil, &block)
940
+ command = make_simple_command(:get, 'games/v1/leaderboards/{leaderboardId}/window/{collection}', options)
941
+ command.response_representation = Google::Apis::GamesV1::LeaderboardScores::Representation
942
+ command.response_class = Google::Apis::GamesV1::LeaderboardScores
943
+ command.params['leaderboardId'] = leaderboard_id unless leaderboard_id.nil?
944
+ command.params['collection'] = collection unless collection.nil?
945
+ command.query['language'] = language unless language.nil?
946
+ command.query['maxResults'] = max_results unless max_results.nil?
947
+ command.query['pageToken'] = page_token unless page_token.nil?
948
+ command.query['resultsAbove'] = results_above unless results_above.nil?
949
+ command.query['returnTopIfAbsent'] = return_top_if_absent unless return_top_if_absent.nil?
950
+ command.query['timeSpan'] = time_span unless time_span.nil?
951
+ command.query['fields'] = fields unless fields.nil?
952
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
953
+ execute_or_queue_command(command, &block)
954
+ end
955
+
956
+ # Submits a score to the specified leaderboard.
957
+ # @param [String] leaderboard_id
958
+ # The ID of the leaderboard.
959
+ # @param [Fixnum] score
960
+ # The score you're submitting. The submitted score is ignored if it is worse
961
+ # than a previously submitted score, where worse depends on the leaderboard sort
962
+ # order. The meaning of the score value depends on the leaderboard format type.
963
+ # For fixed-point, the score represents the raw value. For time, the score
964
+ # represents elapsed time in milliseconds. For currency, the score represents a
965
+ # value in micro units.
966
+ # @param [String] language
967
+ # The preferred language to use for strings returned by this method.
968
+ # @param [String] score_tag
969
+ # Additional information about the score you're submitting. Values must contain
970
+ # no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.
971
+ # @param [String] fields
972
+ # Selector specifying which fields to include in a partial response.
973
+ # @param [String] quota_user
974
+ # Available to use for quota purposes for server-side applications. Can be any
975
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
976
+ # @param [Google::Apis::RequestOptions] options
977
+ # Request-specific options
978
+ #
979
+ # @yield [result, err] Result & error if block supplied
980
+ # @yieldparam result [Google::Apis::GamesV1::PlayerScoreResponse] parsed result object
981
+ # @yieldparam err [StandardError] error object if request failed
982
+ #
983
+ # @return [Google::Apis::GamesV1::PlayerScoreResponse]
984
+ #
985
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
986
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
987
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
988
+ def submit_score(leaderboard_id, score, language: nil, score_tag: nil, fields: nil, quota_user: nil, options: nil, &block)
989
+ command = make_simple_command(:post, 'games/v1/leaderboards/{leaderboardId}/scores', options)
990
+ command.response_representation = Google::Apis::GamesV1::PlayerScoreResponse::Representation
991
+ command.response_class = Google::Apis::GamesV1::PlayerScoreResponse
992
+ command.params['leaderboardId'] = leaderboard_id unless leaderboard_id.nil?
993
+ command.query['language'] = language unless language.nil?
994
+ command.query['score'] = score unless score.nil?
995
+ command.query['scoreTag'] = score_tag unless score_tag.nil?
996
+ command.query['fields'] = fields unless fields.nil?
997
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
998
+ execute_or_queue_command(command, &block)
999
+ end
1000
+
1001
+ # Submits multiple scores to leaderboards.
1002
+ # @param [Google::Apis::GamesV1::PlayerScoreSubmissionList] player_score_submission_list_object
1003
+ # @param [String] language
1004
+ # The preferred language to use for strings returned by this method.
1005
+ # @param [String] fields
1006
+ # Selector specifying which fields to include in a partial response.
1007
+ # @param [String] quota_user
1008
+ # Available to use for quota purposes for server-side applications. Can be any
1009
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1010
+ # @param [Google::Apis::RequestOptions] options
1011
+ # Request-specific options
1012
+ #
1013
+ # @yield [result, err] Result & error if block supplied
1014
+ # @yieldparam result [Google::Apis::GamesV1::ListPlayerScoreResponse] parsed result object
1015
+ # @yieldparam err [StandardError] error object if request failed
1016
+ #
1017
+ # @return [Google::Apis::GamesV1::ListPlayerScoreResponse]
1018
+ #
1019
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1020
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1021
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1022
+ def submit_score_multiple(player_score_submission_list_object = nil, language: nil, fields: nil, quota_user: nil, options: nil, &block)
1023
+ command = make_simple_command(:post, 'games/v1/leaderboards/scores', options)
1024
+ command.request_representation = Google::Apis::GamesV1::PlayerScoreSubmissionList::Representation
1025
+ command.request_object = player_score_submission_list_object
1026
+ command.response_representation = Google::Apis::GamesV1::ListPlayerScoreResponse::Representation
1027
+ command.response_class = Google::Apis::GamesV1::ListPlayerScoreResponse
1028
+ command.query['language'] = language unless language.nil?
1029
+ command.query['fields'] = fields unless fields.nil?
1030
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1031
+ execute_or_queue_command(command, &block)
1032
+ end
1033
+
1034
+ # Retrieves the metadata for a given snapshot ID.
1035
+ # @param [String] snapshot_id
1036
+ # The ID of the snapshot.
1037
+ # @param [String] language
1038
+ # The preferred language to use for strings returned by this method.
1039
+ # @param [String] fields
1040
+ # Selector specifying which fields to include in a partial response.
1041
+ # @param [String] quota_user
1042
+ # Available to use for quota purposes for server-side applications. Can be any
1043
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1044
+ # @param [Google::Apis::RequestOptions] options
1045
+ # Request-specific options
1046
+ #
1047
+ # @yield [result, err] Result & error if block supplied
1048
+ # @yieldparam result [Google::Apis::GamesV1::Snapshot] parsed result object
1049
+ # @yieldparam err [StandardError] error object if request failed
1050
+ #
1051
+ # @return [Google::Apis::GamesV1::Snapshot]
1052
+ #
1053
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1054
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1055
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1056
+ def get_snapshot(snapshot_id, language: nil, fields: nil, quota_user: nil, options: nil, &block)
1057
+ command = make_simple_command(:get, 'games/v1/snapshots/{snapshotId}', options)
1058
+ command.response_representation = Google::Apis::GamesV1::Snapshot::Representation
1059
+ command.response_class = Google::Apis::GamesV1::Snapshot
1060
+ command.params['snapshotId'] = snapshot_id unless snapshot_id.nil?
1061
+ command.query['language'] = language unless language.nil?
1062
+ command.query['fields'] = fields unless fields.nil?
1063
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1064
+ execute_or_queue_command(command, &block)
1065
+ end
1066
+
1067
+ # Retrieves a list of snapshots created by your application for the player
1068
+ # corresponding to the player ID.
1069
+ # @param [String] player_id
1070
+ # A player ID. A value of `me` may be used in place of the authenticated player'
1071
+ # s ID.
1072
+ # @param [String] language
1073
+ # The preferred language to use for strings returned by this method.
1074
+ # @param [Fixnum] max_results
1075
+ # The maximum number of snapshot resources to return in the response, used for
1076
+ # paging. For any response, the actual number of snapshot resources returned may
1077
+ # be less than the specified `maxResults`.
1078
+ # @param [String] page_token
1079
+ # The token returned by the previous request.
1080
+ # @param [String] fields
1081
+ # Selector specifying which fields to include in a partial response.
1082
+ # @param [String] quota_user
1083
+ # Available to use for quota purposes for server-side applications. Can be any
1084
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1085
+ # @param [Google::Apis::RequestOptions] options
1086
+ # Request-specific options
1087
+ #
1088
+ # @yield [result, err] Result & error if block supplied
1089
+ # @yieldparam result [Google::Apis::GamesV1::ListSnapshotResponse] parsed result object
1090
+ # @yieldparam err [StandardError] error object if request failed
1091
+ #
1092
+ # @return [Google::Apis::GamesV1::ListSnapshotResponse]
1093
+ #
1094
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1095
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1096
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1097
+ def list_snapshots(player_id, language: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1098
+ command = make_simple_command(:get, 'games/v1/players/{playerId}/snapshots', options)
1099
+ command.response_representation = Google::Apis::GamesV1::ListSnapshotResponse::Representation
1100
+ command.response_class = Google::Apis::GamesV1::ListSnapshotResponse
1101
+ command.params['playerId'] = player_id unless player_id.nil?
1102
+ command.query['language'] = language unless language.nil?
1103
+ command.query['maxResults'] = max_results unless max_results.nil?
1104
+ command.query['pageToken'] = page_token unless page_token.nil?
1105
+ command.query['fields'] = fields unless fields.nil?
1106
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1107
+ execute_or_queue_command(command, &block)
1108
+ end
1109
+
1110
+ # Resolves any potential conflicts according to the resolution policy specified
1111
+ # in the request and returns the snapshot head after the resolution.
1112
+ # @param [String] snapshot_name
1113
+ # Required. Name of the snapshot.
1114
+ # @param [Google::Apis::GamesV1::ResolveSnapshotHeadRequest] resolve_snapshot_head_request_object
1115
+ # @param [String] fields
1116
+ # Selector specifying which fields to include in a partial response.
1117
+ # @param [String] quota_user
1118
+ # Available to use for quota purposes for server-side applications. Can be any
1119
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1120
+ # @param [Google::Apis::RequestOptions] options
1121
+ # Request-specific options
1122
+ #
1123
+ # @yield [result, err] Result & error if block supplied
1124
+ # @yieldparam result [Google::Apis::GamesV1::ResolveSnapshotHeadResponse] parsed result object
1125
+ # @yieldparam err [StandardError] error object if request failed
1126
+ #
1127
+ # @return [Google::Apis::GamesV1::ResolveSnapshotHeadResponse]
1128
+ #
1129
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1130
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1131
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1132
+ def resolve_snapshots_extended_snapshot_head(snapshot_name, resolve_snapshot_head_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1133
+ command = make_simple_command(:post, 'games/v1/snapshotsExtended/{snapshotName}:resolveHead', options)
1134
+ command.request_representation = Google::Apis::GamesV1::ResolveSnapshotHeadRequest::Representation
1135
+ command.request_object = resolve_snapshot_head_request_object
1136
+ command.response_representation = Google::Apis::GamesV1::ResolveSnapshotHeadResponse::Representation
1137
+ command.response_class = Google::Apis::GamesV1::ResolveSnapshotHeadResponse
1138
+ command.params['snapshotName'] = snapshot_name unless snapshot_name.nil?
1139
+ command.query['fields'] = fields unless fields.nil?
1140
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1141
+ execute_or_queue_command(command, &block)
1142
+ end
1143
+
1144
+ # Returns engagement and spend statistics in this application for the currently
1145
+ # authenticated user.
1146
+ # @param [String] fields
1147
+ # Selector specifying which fields to include in a partial response.
1148
+ # @param [String] quota_user
1149
+ # Available to use for quota purposes for server-side applications. Can be any
1150
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1151
+ # @param [Google::Apis::RequestOptions] options
1152
+ # Request-specific options
1153
+ #
1154
+ # @yield [result, err] Result & error if block supplied
1155
+ # @yieldparam result [Google::Apis::GamesV1::StatsResponse] parsed result object
1156
+ # @yieldparam err [StandardError] error object if request failed
1157
+ #
1158
+ # @return [Google::Apis::GamesV1::StatsResponse]
1159
+ #
1160
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1161
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1162
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1163
+ def get_stat(fields: nil, quota_user: nil, options: nil, &block)
1164
+ command = make_simple_command(:get, 'games/v1/stats', options)
1165
+ command.response_representation = Google::Apis::GamesV1::StatsResponse::Representation
1166
+ command.response_class = Google::Apis::GamesV1::StatsResponse
1167
+ command.query['fields'] = fields unless fields.nil?
1168
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1169
+ execute_or_queue_command(command, &block)
1170
+ end
1171
+
1172
+ protected
1173
+
1174
+ def apply_command_defaults(command)
1175
+ command.query['key'] = key unless key.nil?
1176
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1177
+ end
1178
+ end
1179
+ end
1180
+ end
1181
+ end