OLD | NEW |
(Empty) | |
| 1 library googleapis.gamesManagement.v1management; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import "package:crypto/crypto.dart" as crypto; |
| 9 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; |
| 11 import '../common/common.dart' as common; |
| 12 |
| 13 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 |
| 16 /** The Management API for Google Play Game Services. */ |
| 17 class GamesManagementApi { |
| 18 /** |
| 19 * Share your Google+ profile information and view and manage your game |
| 20 * activity |
| 21 */ |
| 22 static const GamesScope = "https://www.googleapis.com/auth/games"; |
| 23 |
| 24 /** Know your basic profile info and list of people in your circles. */ |
| 25 static const PlusLoginScope = "https://www.googleapis.com/auth/plus.login"; |
| 26 |
| 27 |
| 28 final common_internal.ApiRequester _requester; |
| 29 |
| 30 AchievementsResourceApi get achievements => new AchievementsResourceApi(_reque
ster); |
| 31 ApplicationsResourceApi get applications => new ApplicationsResourceApi(_reque
ster); |
| 32 EventsResourceApi get events => new EventsResourceApi(_requester); |
| 33 PlayersResourceApi get players => new PlayersResourceApi(_requester); |
| 34 QuestsResourceApi get quests => new QuestsResourceApi(_requester); |
| 35 RoomsResourceApi get rooms => new RoomsResourceApi(_requester); |
| 36 ScoresResourceApi get scores => new ScoresResourceApi(_requester); |
| 37 TurnBasedMatchesResourceApi get turnBasedMatches => new TurnBasedMatchesResour
ceApi(_requester); |
| 38 |
| 39 GamesManagementApi(http.Client client) : |
| 40 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/games/v1management/"); |
| 41 } |
| 42 |
| 43 |
| 44 /** Not documented yet. */ |
| 45 class AchievementsResourceApi { |
| 46 final common_internal.ApiRequester _requester; |
| 47 |
| 48 AchievementsResourceApi(common_internal.ApiRequester client) : |
| 49 _requester = client; |
| 50 |
| 51 /** |
| 52 * Resets the achievement with the given ID for the currently authenticated |
| 53 * player. This method is only accessible to whitelisted tester accounts for |
| 54 * your application. |
| 55 * |
| 56 * Request parameters: |
| 57 * |
| 58 * [achievementId] - The ID of the achievement used by this method. |
| 59 * |
| 60 * Completes with a [AchievementResetResponse]. |
| 61 * |
| 62 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 63 * error. |
| 64 * |
| 65 * If the used [http.Client] completes with an error when making a REST call, |
| 66 * this method will complete with the same error. |
| 67 */ |
| 68 async.Future<AchievementResetResponse> reset(core.String achievementId) { |
| 69 var _url = null; |
| 70 var _queryParams = new core.Map(); |
| 71 var _uploadMedia = null; |
| 72 var _uploadOptions = null; |
| 73 var _downloadOptions = common.DownloadOptions.Metadata; |
| 74 var _body = null; |
| 75 |
| 76 if (achievementId == null) { |
| 77 throw new core.ArgumentError("Parameter achievementId is required."); |
| 78 } |
| 79 |
| 80 |
| 81 _url = 'achievements/' + common_internal.Escaper.ecapeVariable('$achievement
Id') + '/reset'; |
| 82 |
| 83 var _response = _requester.request(_url, |
| 84 "POST", |
| 85 body: _body, |
| 86 queryParams: _queryParams, |
| 87 uploadOptions: _uploadOptions, |
| 88 uploadMedia: _uploadMedia, |
| 89 downloadOptions: _downloadOptions); |
| 90 return _response.then((data) => new AchievementResetResponse.fromJson(data))
; |
| 91 } |
| 92 |
| 93 /** |
| 94 * Resets all achievements for the currently authenticated player for your |
| 95 * application. This method is only accessible to whitelisted tester accounts |
| 96 * for your application. |
| 97 * |
| 98 * Request parameters: |
| 99 * |
| 100 * Completes with a [AchievementResetAllResponse]. |
| 101 * |
| 102 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 103 * error. |
| 104 * |
| 105 * If the used [http.Client] completes with an error when making a REST call, |
| 106 * this method will complete with the same error. |
| 107 */ |
| 108 async.Future<AchievementResetAllResponse> resetAll() { |
| 109 var _url = null; |
| 110 var _queryParams = new core.Map(); |
| 111 var _uploadMedia = null; |
| 112 var _uploadOptions = null; |
| 113 var _downloadOptions = common.DownloadOptions.Metadata; |
| 114 var _body = null; |
| 115 |
| 116 |
| 117 |
| 118 _url = 'achievements/reset'; |
| 119 |
| 120 var _response = _requester.request(_url, |
| 121 "POST", |
| 122 body: _body, |
| 123 queryParams: _queryParams, |
| 124 uploadOptions: _uploadOptions, |
| 125 uploadMedia: _uploadMedia, |
| 126 downloadOptions: _downloadOptions); |
| 127 return _response.then((data) => new AchievementResetAllResponse.fromJson(dat
a)); |
| 128 } |
| 129 |
| 130 /** |
| 131 * Resets the achievement with the given ID for the all players. This method |
| 132 * is only available to user accounts for your developer console. Only draft |
| 133 * achievements can be reset. |
| 134 * |
| 135 * Request parameters: |
| 136 * |
| 137 * [achievementId] - The ID of the achievement used by this method. |
| 138 * |
| 139 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 140 * error. |
| 141 * |
| 142 * If the used [http.Client] completes with an error when making a REST call, |
| 143 * this method will complete with the same error. |
| 144 */ |
| 145 async.Future resetForAllPlayers(core.String achievementId) { |
| 146 var _url = null; |
| 147 var _queryParams = new core.Map(); |
| 148 var _uploadMedia = null; |
| 149 var _uploadOptions = null; |
| 150 var _downloadOptions = common.DownloadOptions.Metadata; |
| 151 var _body = null; |
| 152 |
| 153 if (achievementId == null) { |
| 154 throw new core.ArgumentError("Parameter achievementId is required."); |
| 155 } |
| 156 |
| 157 _downloadOptions = null; |
| 158 |
| 159 _url = 'achievements/' + common_internal.Escaper.ecapeVariable('$achievement
Id') + '/resetForAllPlayers'; |
| 160 |
| 161 var _response = _requester.request(_url, |
| 162 "POST", |
| 163 body: _body, |
| 164 queryParams: _queryParams, |
| 165 uploadOptions: _uploadOptions, |
| 166 uploadMedia: _uploadMedia, |
| 167 downloadOptions: _downloadOptions); |
| 168 return _response.then((data) => null); |
| 169 } |
| 170 |
| 171 } |
| 172 |
| 173 |
| 174 /** Not documented yet. */ |
| 175 class ApplicationsResourceApi { |
| 176 final common_internal.ApiRequester _requester; |
| 177 |
| 178 ApplicationsResourceApi(common_internal.ApiRequester client) : |
| 179 _requester = client; |
| 180 |
| 181 /** |
| 182 * Get the list of players hidden from the given application. This method is |
| 183 * only available to user accounts for your developer console. |
| 184 * |
| 185 * Request parameters: |
| 186 * |
| 187 * [applicationId] - The application being requested. |
| 188 * |
| 189 * [maxResults] - The maximum number of player resources to return in the |
| 190 * response, used for paging. For any response, the actual number of player |
| 191 * resources returned may be less than the specified maxResults. |
| 192 * Value must be between "1" and "15". |
| 193 * |
| 194 * [pageToken] - The token returned by the previous request. |
| 195 * |
| 196 * Completes with a [HiddenPlayerList]. |
| 197 * |
| 198 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 199 * error. |
| 200 * |
| 201 * If the used [http.Client] completes with an error when making a REST call, |
| 202 * this method will complete with the same error. |
| 203 */ |
| 204 async.Future<HiddenPlayerList> listHidden(core.String applicationId, {core.int
maxResults, core.String pageToken}) { |
| 205 var _url = null; |
| 206 var _queryParams = new core.Map(); |
| 207 var _uploadMedia = null; |
| 208 var _uploadOptions = null; |
| 209 var _downloadOptions = common.DownloadOptions.Metadata; |
| 210 var _body = null; |
| 211 |
| 212 if (applicationId == null) { |
| 213 throw new core.ArgumentError("Parameter applicationId is required."); |
| 214 } |
| 215 if (maxResults != null) { |
| 216 _queryParams["maxResults"] = ["${maxResults}"]; |
| 217 } |
| 218 if (pageToken != null) { |
| 219 _queryParams["pageToken"] = [pageToken]; |
| 220 } |
| 221 |
| 222 |
| 223 _url = 'applications/' + common_internal.Escaper.ecapeVariable('$application
Id') + '/players/hidden'; |
| 224 |
| 225 var _response = _requester.request(_url, |
| 226 "GET", |
| 227 body: _body, |
| 228 queryParams: _queryParams, |
| 229 uploadOptions: _uploadOptions, |
| 230 uploadMedia: _uploadMedia, |
| 231 downloadOptions: _downloadOptions); |
| 232 return _response.then((data) => new HiddenPlayerList.fromJson(data)); |
| 233 } |
| 234 |
| 235 } |
| 236 |
| 237 |
| 238 /** Not documented yet. */ |
| 239 class EventsResourceApi { |
| 240 final common_internal.ApiRequester _requester; |
| 241 |
| 242 EventsResourceApi(common_internal.ApiRequester client) : |
| 243 _requester = client; |
| 244 |
| 245 /** |
| 246 * Reset all player progress on the event for the currently authenticated |
| 247 * player. This method is only accessible to whitelisted tester accounts for |
| 248 * your application. All resources that use the event will also be reset. |
| 249 * |
| 250 * Request parameters: |
| 251 * |
| 252 * [eventId] - The ID of the event. |
| 253 * |
| 254 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 255 * error. |
| 256 * |
| 257 * If the used [http.Client] completes with an error when making a REST call, |
| 258 * this method will complete with the same error. |
| 259 */ |
| 260 async.Future reset(core.String eventId) { |
| 261 var _url = null; |
| 262 var _queryParams = new core.Map(); |
| 263 var _uploadMedia = null; |
| 264 var _uploadOptions = null; |
| 265 var _downloadOptions = common.DownloadOptions.Metadata; |
| 266 var _body = null; |
| 267 |
| 268 if (eventId == null) { |
| 269 throw new core.ArgumentError("Parameter eventId is required."); |
| 270 } |
| 271 |
| 272 _downloadOptions = null; |
| 273 |
| 274 _url = 'events/' + common_internal.Escaper.ecapeVariable('$eventId') + '/res
et'; |
| 275 |
| 276 var _response = _requester.request(_url, |
| 277 "POST", |
| 278 body: _body, |
| 279 queryParams: _queryParams, |
| 280 uploadOptions: _uploadOptions, |
| 281 uploadMedia: _uploadMedia, |
| 282 downloadOptions: _downloadOptions); |
| 283 return _response.then((data) => null); |
| 284 } |
| 285 |
| 286 /** |
| 287 * Reset all player progress on all unpublished events for the currently |
| 288 * authenticated player. This method is only accessible to whitelisted tester |
| 289 * accounts for your application. All resources that use the events will also |
| 290 * be reset. |
| 291 * |
| 292 * Request parameters: |
| 293 * |
| 294 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 295 * error. |
| 296 * |
| 297 * If the used [http.Client] completes with an error when making a REST call, |
| 298 * this method will complete with the same error. |
| 299 */ |
| 300 async.Future resetAll() { |
| 301 var _url = null; |
| 302 var _queryParams = new core.Map(); |
| 303 var _uploadMedia = null; |
| 304 var _uploadOptions = null; |
| 305 var _downloadOptions = common.DownloadOptions.Metadata; |
| 306 var _body = null; |
| 307 |
| 308 |
| 309 _downloadOptions = null; |
| 310 |
| 311 _url = 'events/reset'; |
| 312 |
| 313 var _response = _requester.request(_url, |
| 314 "POST", |
| 315 body: _body, |
| 316 queryParams: _queryParams, |
| 317 uploadOptions: _uploadOptions, |
| 318 uploadMedia: _uploadMedia, |
| 319 downloadOptions: _downloadOptions); |
| 320 return _response.then((data) => null); |
| 321 } |
| 322 |
| 323 /** |
| 324 * Reset all player progress on the event for all players. This method is only |
| 325 * available to user accounts for your developer console. Only draft events |
| 326 * can be reset. All resources that use the event will also be reset. |
| 327 * |
| 328 * Request parameters: |
| 329 * |
| 330 * [eventId] - The ID of the event. |
| 331 * |
| 332 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 333 * error. |
| 334 * |
| 335 * If the used [http.Client] completes with an error when making a REST call, |
| 336 * this method will complete with the same error. |
| 337 */ |
| 338 async.Future resetForAllPlayers(core.String eventId) { |
| 339 var _url = null; |
| 340 var _queryParams = new core.Map(); |
| 341 var _uploadMedia = null; |
| 342 var _uploadOptions = null; |
| 343 var _downloadOptions = common.DownloadOptions.Metadata; |
| 344 var _body = null; |
| 345 |
| 346 if (eventId == null) { |
| 347 throw new core.ArgumentError("Parameter eventId is required."); |
| 348 } |
| 349 |
| 350 _downloadOptions = null; |
| 351 |
| 352 _url = 'events/' + common_internal.Escaper.ecapeVariable('$eventId') + '/res
etForAllPlayers'; |
| 353 |
| 354 var _response = _requester.request(_url, |
| 355 "POST", |
| 356 body: _body, |
| 357 queryParams: _queryParams, |
| 358 uploadOptions: _uploadOptions, |
| 359 uploadMedia: _uploadMedia, |
| 360 downloadOptions: _downloadOptions); |
| 361 return _response.then((data) => null); |
| 362 } |
| 363 |
| 364 } |
| 365 |
| 366 |
| 367 /** Not documented yet. */ |
| 368 class PlayersResourceApi { |
| 369 final common_internal.ApiRequester _requester; |
| 370 |
| 371 PlayersResourceApi(common_internal.ApiRequester client) : |
| 372 _requester = client; |
| 373 |
| 374 /** |
| 375 * Hide the given player's leaderboard scores from the given application. This |
| 376 * method is only available to user accounts for your developer console. |
| 377 * |
| 378 * Request parameters: |
| 379 * |
| 380 * [applicationId] - The application being requested. |
| 381 * |
| 382 * [playerId] - A player ID. A value of me may be used in place of the |
| 383 * authenticated player's ID. |
| 384 * |
| 385 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 386 * error. |
| 387 * |
| 388 * If the used [http.Client] completes with an error when making a REST call, |
| 389 * this method will complete with the same error. |
| 390 */ |
| 391 async.Future hide(core.String applicationId, core.String playerId) { |
| 392 var _url = null; |
| 393 var _queryParams = new core.Map(); |
| 394 var _uploadMedia = null; |
| 395 var _uploadOptions = null; |
| 396 var _downloadOptions = common.DownloadOptions.Metadata; |
| 397 var _body = null; |
| 398 |
| 399 if (applicationId == null) { |
| 400 throw new core.ArgumentError("Parameter applicationId is required."); |
| 401 } |
| 402 if (playerId == null) { |
| 403 throw new core.ArgumentError("Parameter playerId is required."); |
| 404 } |
| 405 |
| 406 _downloadOptions = null; |
| 407 |
| 408 _url = 'applications/' + common_internal.Escaper.ecapeVariable('$application
Id') + '/players/hidden/' + common_internal.Escaper.ecapeVariable('$playerId'); |
| 409 |
| 410 var _response = _requester.request(_url, |
| 411 "POST", |
| 412 body: _body, |
| 413 queryParams: _queryParams, |
| 414 uploadOptions: _uploadOptions, |
| 415 uploadMedia: _uploadMedia, |
| 416 downloadOptions: _downloadOptions); |
| 417 return _response.then((data) => null); |
| 418 } |
| 419 |
| 420 /** |
| 421 * Unhide the given player's leaderboard scores from the given application. |
| 422 * This method is only available to user accounts for your developer console. |
| 423 * |
| 424 * Request parameters: |
| 425 * |
| 426 * [applicationId] - The application being requested. |
| 427 * |
| 428 * [playerId] - A player ID. A value of me may be used in place of the |
| 429 * authenticated player's ID. |
| 430 * |
| 431 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 432 * error. |
| 433 * |
| 434 * If the used [http.Client] completes with an error when making a REST call, |
| 435 * this method will complete with the same error. |
| 436 */ |
| 437 async.Future unhide(core.String applicationId, core.String playerId) { |
| 438 var _url = null; |
| 439 var _queryParams = new core.Map(); |
| 440 var _uploadMedia = null; |
| 441 var _uploadOptions = null; |
| 442 var _downloadOptions = common.DownloadOptions.Metadata; |
| 443 var _body = null; |
| 444 |
| 445 if (applicationId == null) { |
| 446 throw new core.ArgumentError("Parameter applicationId is required."); |
| 447 } |
| 448 if (playerId == null) { |
| 449 throw new core.ArgumentError("Parameter playerId is required."); |
| 450 } |
| 451 |
| 452 _downloadOptions = null; |
| 453 |
| 454 _url = 'applications/' + common_internal.Escaper.ecapeVariable('$application
Id') + '/players/hidden/' + common_internal.Escaper.ecapeVariable('$playerId'); |
| 455 |
| 456 var _response = _requester.request(_url, |
| 457 "DELETE", |
| 458 body: _body, |
| 459 queryParams: _queryParams, |
| 460 uploadOptions: _uploadOptions, |
| 461 uploadMedia: _uploadMedia, |
| 462 downloadOptions: _downloadOptions); |
| 463 return _response.then((data) => null); |
| 464 } |
| 465 |
| 466 } |
| 467 |
| 468 |
| 469 /** Not documented yet. */ |
| 470 class QuestsResourceApi { |
| 471 final common_internal.ApiRequester _requester; |
| 472 |
| 473 QuestsResourceApi(common_internal.ApiRequester client) : |
| 474 _requester = client; |
| 475 |
| 476 /** |
| 477 * Reset all player progress on the quest for the currently authenticated |
| 478 * player. This method is only accessible to whitelisted tester accounts for |
| 479 * your application. |
| 480 * |
| 481 * Request parameters: |
| 482 * |
| 483 * [questId] - The ID of the quest. |
| 484 * |
| 485 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 486 * error. |
| 487 * |
| 488 * If the used [http.Client] completes with an error when making a REST call, |
| 489 * this method will complete with the same error. |
| 490 */ |
| 491 async.Future reset(core.String questId) { |
| 492 var _url = null; |
| 493 var _queryParams = new core.Map(); |
| 494 var _uploadMedia = null; |
| 495 var _uploadOptions = null; |
| 496 var _downloadOptions = common.DownloadOptions.Metadata; |
| 497 var _body = null; |
| 498 |
| 499 if (questId == null) { |
| 500 throw new core.ArgumentError("Parameter questId is required."); |
| 501 } |
| 502 |
| 503 _downloadOptions = null; |
| 504 |
| 505 _url = 'quests/' + common_internal.Escaper.ecapeVariable('$questId') + '/res
et'; |
| 506 |
| 507 var _response = _requester.request(_url, |
| 508 "POST", |
| 509 body: _body, |
| 510 queryParams: _queryParams, |
| 511 uploadOptions: _uploadOptions, |
| 512 uploadMedia: _uploadMedia, |
| 513 downloadOptions: _downloadOptions); |
| 514 return _response.then((data) => null); |
| 515 } |
| 516 |
| 517 } |
| 518 |
| 519 |
| 520 /** Not documented yet. */ |
| 521 class RoomsResourceApi { |
| 522 final common_internal.ApiRequester _requester; |
| 523 |
| 524 RoomsResourceApi(common_internal.ApiRequester client) : |
| 525 _requester = client; |
| 526 |
| 527 /** |
| 528 * Reset all rooms for the currently authenticated player for your |
| 529 * application. This method is only accessible to whitelisted tester accounts |
| 530 * for your application. |
| 531 * |
| 532 * Request parameters: |
| 533 * |
| 534 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 535 * error. |
| 536 * |
| 537 * If the used [http.Client] completes with an error when making a REST call, |
| 538 * this method will complete with the same error. |
| 539 */ |
| 540 async.Future reset() { |
| 541 var _url = null; |
| 542 var _queryParams = new core.Map(); |
| 543 var _uploadMedia = null; |
| 544 var _uploadOptions = null; |
| 545 var _downloadOptions = common.DownloadOptions.Metadata; |
| 546 var _body = null; |
| 547 |
| 548 |
| 549 _downloadOptions = null; |
| 550 |
| 551 _url = 'rooms/reset'; |
| 552 |
| 553 var _response = _requester.request(_url, |
| 554 "POST", |
| 555 body: _body, |
| 556 queryParams: _queryParams, |
| 557 uploadOptions: _uploadOptions, |
| 558 uploadMedia: _uploadMedia, |
| 559 downloadOptions: _downloadOptions); |
| 560 return _response.then((data) => null); |
| 561 } |
| 562 |
| 563 } |
| 564 |
| 565 |
| 566 /** Not documented yet. */ |
| 567 class ScoresResourceApi { |
| 568 final common_internal.ApiRequester _requester; |
| 569 |
| 570 ScoresResourceApi(common_internal.ApiRequester client) : |
| 571 _requester = client; |
| 572 |
| 573 /** |
| 574 * Reset scores for the specified leaderboard for the currently authenticated |
| 575 * player. This method is only accessible to whitelisted tester accounts for |
| 576 * your application. |
| 577 * |
| 578 * Request parameters: |
| 579 * |
| 580 * [leaderboardId] - The ID of the leaderboard. |
| 581 * |
| 582 * Completes with a [PlayerScoreResetResponse]. |
| 583 * |
| 584 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 585 * error. |
| 586 * |
| 587 * If the used [http.Client] completes with an error when making a REST call, |
| 588 * this method will complete with the same error. |
| 589 */ |
| 590 async.Future<PlayerScoreResetResponse> reset(core.String leaderboardId) { |
| 591 var _url = null; |
| 592 var _queryParams = new core.Map(); |
| 593 var _uploadMedia = null; |
| 594 var _uploadOptions = null; |
| 595 var _downloadOptions = common.DownloadOptions.Metadata; |
| 596 var _body = null; |
| 597 |
| 598 if (leaderboardId == null) { |
| 599 throw new core.ArgumentError("Parameter leaderboardId is required."); |
| 600 } |
| 601 |
| 602 |
| 603 _url = 'leaderboards/' + common_internal.Escaper.ecapeVariable('$leaderboard
Id') + '/scores/reset'; |
| 604 |
| 605 var _response = _requester.request(_url, |
| 606 "POST", |
| 607 body: _body, |
| 608 queryParams: _queryParams, |
| 609 uploadOptions: _uploadOptions, |
| 610 uploadMedia: _uploadMedia, |
| 611 downloadOptions: _downloadOptions); |
| 612 return _response.then((data) => new PlayerScoreResetResponse.fromJson(data))
; |
| 613 } |
| 614 |
| 615 /** |
| 616 * Reset scores for the specified leaderboard for all players. This method is |
| 617 * only available to user accounts for your developer console. Only draft |
| 618 * leaderboards can be reset. |
| 619 * |
| 620 * Request parameters: |
| 621 * |
| 622 * [leaderboardId] - The ID of the leaderboard. |
| 623 * |
| 624 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 625 * error. |
| 626 * |
| 627 * If the used [http.Client] completes with an error when making a REST call, |
| 628 * this method will complete with the same error. |
| 629 */ |
| 630 async.Future resetForAllPlayers(core.String leaderboardId) { |
| 631 var _url = null; |
| 632 var _queryParams = new core.Map(); |
| 633 var _uploadMedia = null; |
| 634 var _uploadOptions = null; |
| 635 var _downloadOptions = common.DownloadOptions.Metadata; |
| 636 var _body = null; |
| 637 |
| 638 if (leaderboardId == null) { |
| 639 throw new core.ArgumentError("Parameter leaderboardId is required."); |
| 640 } |
| 641 |
| 642 _downloadOptions = null; |
| 643 |
| 644 _url = 'leaderboards/' + common_internal.Escaper.ecapeVariable('$leaderboard
Id') + '/scores/resetForAllPlayers'; |
| 645 |
| 646 var _response = _requester.request(_url, |
| 647 "POST", |
| 648 body: _body, |
| 649 queryParams: _queryParams, |
| 650 uploadOptions: _uploadOptions, |
| 651 uploadMedia: _uploadMedia, |
| 652 downloadOptions: _downloadOptions); |
| 653 return _response.then((data) => null); |
| 654 } |
| 655 |
| 656 } |
| 657 |
| 658 |
| 659 /** Not documented yet. */ |
| 660 class TurnBasedMatchesResourceApi { |
| 661 final common_internal.ApiRequester _requester; |
| 662 |
| 663 TurnBasedMatchesResourceApi(common_internal.ApiRequester client) : |
| 664 _requester = client; |
| 665 |
| 666 /** |
| 667 * Reset all turn-based match data for a user. This method is only accessible |
| 668 * to whitelisted tester accounts for your application. |
| 669 * |
| 670 * Request parameters: |
| 671 * |
| 672 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 673 * error. |
| 674 * |
| 675 * If the used [http.Client] completes with an error when making a REST call, |
| 676 * this method will complete with the same error. |
| 677 */ |
| 678 async.Future reset() { |
| 679 var _url = null; |
| 680 var _queryParams = new core.Map(); |
| 681 var _uploadMedia = null; |
| 682 var _uploadOptions = null; |
| 683 var _downloadOptions = common.DownloadOptions.Metadata; |
| 684 var _body = null; |
| 685 |
| 686 |
| 687 _downloadOptions = null; |
| 688 |
| 689 _url = 'turnbasedmatches/reset'; |
| 690 |
| 691 var _response = _requester.request(_url, |
| 692 "POST", |
| 693 body: _body, |
| 694 queryParams: _queryParams, |
| 695 uploadOptions: _uploadOptions, |
| 696 uploadMedia: _uploadMedia, |
| 697 downloadOptions: _downloadOptions); |
| 698 return _response.then((data) => null); |
| 699 } |
| 700 |
| 701 } |
| 702 |
| 703 |
| 704 |
| 705 /** This is a JSON template for achievement reset all response. */ |
| 706 class AchievementResetAllResponse { |
| 707 /** |
| 708 * Uniquely identifies the type of this resource. Value is always the fixed |
| 709 * string gamesManagement#achievementResetAllResponse. |
| 710 */ |
| 711 core.String kind; |
| 712 |
| 713 /** The achievement reset results. */ |
| 714 core.List<AchievementResetResponse> results; |
| 715 |
| 716 |
| 717 AchievementResetAllResponse(); |
| 718 |
| 719 AchievementResetAllResponse.fromJson(core.Map _json) { |
| 720 if (_json.containsKey("kind")) { |
| 721 kind = _json["kind"]; |
| 722 } |
| 723 if (_json.containsKey("results")) { |
| 724 results = _json["results"].map((value) => new AchievementResetResponse.fro
mJson(value)).toList(); |
| 725 } |
| 726 } |
| 727 |
| 728 core.Map toJson() { |
| 729 var _json = new core.Map(); |
| 730 if (kind != null) { |
| 731 _json["kind"] = kind; |
| 732 } |
| 733 if (results != null) { |
| 734 _json["results"] = results.map((value) => (value).toJson()).toList(); |
| 735 } |
| 736 return _json; |
| 737 } |
| 738 } |
| 739 |
| 740 |
| 741 /** This is a JSON template for an achievement reset response. */ |
| 742 class AchievementResetResponse { |
| 743 /** |
| 744 * The current state of the achievement. This is the same as the initial state |
| 745 * of the achievement. |
| 746 * Possible values are: |
| 747 * - "HIDDEN"- Achievement is hidden. |
| 748 * - "REVEALED" - Achievement is revealed. |
| 749 * - "UNLOCKED" - Achievement is unlocked. |
| 750 */ |
| 751 core.String currentState; |
| 752 |
| 753 /** The ID of an achievement for which player state has been updated. */ |
| 754 core.String definitionId; |
| 755 |
| 756 /** |
| 757 * Uniquely identifies the type of this resource. Value is always the fixed |
| 758 * string gamesManagement#achievementResetResponse. |
| 759 */ |
| 760 core.String kind; |
| 761 |
| 762 /** Flag to indicate if the requested update actually occurred. */ |
| 763 core.bool updateOccurred; |
| 764 |
| 765 |
| 766 AchievementResetResponse(); |
| 767 |
| 768 AchievementResetResponse.fromJson(core.Map _json) { |
| 769 if (_json.containsKey("currentState")) { |
| 770 currentState = _json["currentState"]; |
| 771 } |
| 772 if (_json.containsKey("definitionId")) { |
| 773 definitionId = _json["definitionId"]; |
| 774 } |
| 775 if (_json.containsKey("kind")) { |
| 776 kind = _json["kind"]; |
| 777 } |
| 778 if (_json.containsKey("updateOccurred")) { |
| 779 updateOccurred = _json["updateOccurred"]; |
| 780 } |
| 781 } |
| 782 |
| 783 core.Map toJson() { |
| 784 var _json = new core.Map(); |
| 785 if (currentState != null) { |
| 786 _json["currentState"] = currentState; |
| 787 } |
| 788 if (definitionId != null) { |
| 789 _json["definitionId"] = definitionId; |
| 790 } |
| 791 if (kind != null) { |
| 792 _json["kind"] = kind; |
| 793 } |
| 794 if (updateOccurred != null) { |
| 795 _json["updateOccurred"] = updateOccurred; |
| 796 } |
| 797 return _json; |
| 798 } |
| 799 } |
| 800 |
| 801 |
| 802 /** |
| 803 * This is a JSON template for metadata about a player playing a game with the |
| 804 * currently authenticated user. |
| 805 */ |
| 806 class GamesPlayedResource { |
| 807 /** |
| 808 * True if the player was auto-matched with the currently authenticated user. |
| 809 */ |
| 810 core.bool autoMatched; |
| 811 |
| 812 /** |
| 813 * The last time the player played the game in milliseconds since the epoch in |
| 814 * UTC. |
| 815 */ |
| 816 core.String timeMillis; |
| 817 |
| 818 |
| 819 GamesPlayedResource(); |
| 820 |
| 821 GamesPlayedResource.fromJson(core.Map _json) { |
| 822 if (_json.containsKey("autoMatched")) { |
| 823 autoMatched = _json["autoMatched"]; |
| 824 } |
| 825 if (_json.containsKey("timeMillis")) { |
| 826 timeMillis = _json["timeMillis"]; |
| 827 } |
| 828 } |
| 829 |
| 830 core.Map toJson() { |
| 831 var _json = new core.Map(); |
| 832 if (autoMatched != null) { |
| 833 _json["autoMatched"] = autoMatched; |
| 834 } |
| 835 if (timeMillis != null) { |
| 836 _json["timeMillis"] = timeMillis; |
| 837 } |
| 838 return _json; |
| 839 } |
| 840 } |
| 841 |
| 842 |
| 843 /** |
| 844 * This is a JSON template for 1P/3P metadata about the player's experience. |
| 845 */ |
| 846 class GamesPlayerExperienceInfoResource { |
| 847 /** The current number of experience points for the player. */ |
| 848 core.String currentExperiencePoints; |
| 849 |
| 850 /** The current level of the player. */ |
| 851 GamesPlayerLevelResource currentLevel; |
| 852 |
| 853 /** |
| 854 * The timestamp when the player was leveled up, in millis since Unix epoch |
| 855 * UTC. |
| 856 */ |
| 857 core.String lastLevelUpTimestampMillis; |
| 858 |
| 859 /** |
| 860 * The next level of the player. If the current level is the maximum level, |
| 861 * this should be same as the current level. |
| 862 */ |
| 863 GamesPlayerLevelResource nextLevel; |
| 864 |
| 865 |
| 866 GamesPlayerExperienceInfoResource(); |
| 867 |
| 868 GamesPlayerExperienceInfoResource.fromJson(core.Map _json) { |
| 869 if (_json.containsKey("currentExperiencePoints")) { |
| 870 currentExperiencePoints = _json["currentExperiencePoints"]; |
| 871 } |
| 872 if (_json.containsKey("currentLevel")) { |
| 873 currentLevel = new GamesPlayerLevelResource.fromJson(_json["currentLevel"]
); |
| 874 } |
| 875 if (_json.containsKey("lastLevelUpTimestampMillis")) { |
| 876 lastLevelUpTimestampMillis = _json["lastLevelUpTimestampMillis"]; |
| 877 } |
| 878 if (_json.containsKey("nextLevel")) { |
| 879 nextLevel = new GamesPlayerLevelResource.fromJson(_json["nextLevel"]); |
| 880 } |
| 881 } |
| 882 |
| 883 core.Map toJson() { |
| 884 var _json = new core.Map(); |
| 885 if (currentExperiencePoints != null) { |
| 886 _json["currentExperiencePoints"] = currentExperiencePoints; |
| 887 } |
| 888 if (currentLevel != null) { |
| 889 _json["currentLevel"] = (currentLevel).toJson(); |
| 890 } |
| 891 if (lastLevelUpTimestampMillis != null) { |
| 892 _json["lastLevelUpTimestampMillis"] = lastLevelUpTimestampMillis; |
| 893 } |
| 894 if (nextLevel != null) { |
| 895 _json["nextLevel"] = (nextLevel).toJson(); |
| 896 } |
| 897 return _json; |
| 898 } |
| 899 } |
| 900 |
| 901 |
| 902 /** This is a JSON template for 1P/3P metadata about a user's level. */ |
| 903 class GamesPlayerLevelResource { |
| 904 /** The level for the user. */ |
| 905 core.int level; |
| 906 |
| 907 /** The maximum experience points for this level. */ |
| 908 core.String maxExperiencePoints; |
| 909 |
| 910 /** The minimum experience points for this level. */ |
| 911 core.String minExperiencePoints; |
| 912 |
| 913 |
| 914 GamesPlayerLevelResource(); |
| 915 |
| 916 GamesPlayerLevelResource.fromJson(core.Map _json) { |
| 917 if (_json.containsKey("level")) { |
| 918 level = _json["level"]; |
| 919 } |
| 920 if (_json.containsKey("maxExperiencePoints")) { |
| 921 maxExperiencePoints = _json["maxExperiencePoints"]; |
| 922 } |
| 923 if (_json.containsKey("minExperiencePoints")) { |
| 924 minExperiencePoints = _json["minExperiencePoints"]; |
| 925 } |
| 926 } |
| 927 |
| 928 core.Map toJson() { |
| 929 var _json = new core.Map(); |
| 930 if (level != null) { |
| 931 _json["level"] = level; |
| 932 } |
| 933 if (maxExperiencePoints != null) { |
| 934 _json["maxExperiencePoints"] = maxExperiencePoints; |
| 935 } |
| 936 if (minExperiencePoints != null) { |
| 937 _json["minExperiencePoints"] = minExperiencePoints; |
| 938 } |
| 939 return _json; |
| 940 } |
| 941 } |
| 942 |
| 943 |
| 944 /** This is a JSON template for the HiddenPlayer resource. */ |
| 945 class HiddenPlayer { |
| 946 /** The time this player was hidden. */ |
| 947 core.String hiddenTimeMillis; |
| 948 |
| 949 /** |
| 950 * Uniquely identifies the type of this resource. Value is always the fixed |
| 951 * string gamesManagement#hiddenPlayer. |
| 952 */ |
| 953 core.String kind; |
| 954 |
| 955 /** The player information. */ |
| 956 Player player; |
| 957 |
| 958 |
| 959 HiddenPlayer(); |
| 960 |
| 961 HiddenPlayer.fromJson(core.Map _json) { |
| 962 if (_json.containsKey("hiddenTimeMillis")) { |
| 963 hiddenTimeMillis = _json["hiddenTimeMillis"]; |
| 964 } |
| 965 if (_json.containsKey("kind")) { |
| 966 kind = _json["kind"]; |
| 967 } |
| 968 if (_json.containsKey("player")) { |
| 969 player = new Player.fromJson(_json["player"]); |
| 970 } |
| 971 } |
| 972 |
| 973 core.Map toJson() { |
| 974 var _json = new core.Map(); |
| 975 if (hiddenTimeMillis != null) { |
| 976 _json["hiddenTimeMillis"] = hiddenTimeMillis; |
| 977 } |
| 978 if (kind != null) { |
| 979 _json["kind"] = kind; |
| 980 } |
| 981 if (player != null) { |
| 982 _json["player"] = (player).toJson(); |
| 983 } |
| 984 return _json; |
| 985 } |
| 986 } |
| 987 |
| 988 |
| 989 /** This is a JSON template for a list of hidden players. */ |
| 990 class HiddenPlayerList { |
| 991 /** The players. */ |
| 992 core.List<HiddenPlayer> items; |
| 993 |
| 994 /** |
| 995 * Uniquely identifies the type of this resource. Value is always the fixed |
| 996 * string gamesManagement#hiddenPlayerList. |
| 997 */ |
| 998 core.String kind; |
| 999 |
| 1000 /** The pagination token for the next page of results. */ |
| 1001 core.String nextPageToken; |
| 1002 |
| 1003 |
| 1004 HiddenPlayerList(); |
| 1005 |
| 1006 HiddenPlayerList.fromJson(core.Map _json) { |
| 1007 if (_json.containsKey("items")) { |
| 1008 items = _json["items"].map((value) => new HiddenPlayer.fromJson(value)).to
List(); |
| 1009 } |
| 1010 if (_json.containsKey("kind")) { |
| 1011 kind = _json["kind"]; |
| 1012 } |
| 1013 if (_json.containsKey("nextPageToken")) { |
| 1014 nextPageToken = _json["nextPageToken"]; |
| 1015 } |
| 1016 } |
| 1017 |
| 1018 core.Map toJson() { |
| 1019 var _json = new core.Map(); |
| 1020 if (items != null) { |
| 1021 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1022 } |
| 1023 if (kind != null) { |
| 1024 _json["kind"] = kind; |
| 1025 } |
| 1026 if (nextPageToken != null) { |
| 1027 _json["nextPageToken"] = nextPageToken; |
| 1028 } |
| 1029 return _json; |
| 1030 } |
| 1031 } |
| 1032 |
| 1033 |
| 1034 /** |
| 1035 * An object representation of the individual components of the player's name. |
| 1036 * For some players, these fields may not be present. |
| 1037 */ |
| 1038 class PlayerName { |
| 1039 /** |
| 1040 * The family name of this player. In some places, this is known as the last |
| 1041 * name. |
| 1042 */ |
| 1043 core.String familyName; |
| 1044 |
| 1045 /** |
| 1046 * The given name of this player. In some places, this is known as the first |
| 1047 * name. |
| 1048 */ |
| 1049 core.String givenName; |
| 1050 |
| 1051 |
| 1052 PlayerName(); |
| 1053 |
| 1054 PlayerName.fromJson(core.Map _json) { |
| 1055 if (_json.containsKey("familyName")) { |
| 1056 familyName = _json["familyName"]; |
| 1057 } |
| 1058 if (_json.containsKey("givenName")) { |
| 1059 givenName = _json["givenName"]; |
| 1060 } |
| 1061 } |
| 1062 |
| 1063 core.Map toJson() { |
| 1064 var _json = new core.Map(); |
| 1065 if (familyName != null) { |
| 1066 _json["familyName"] = familyName; |
| 1067 } |
| 1068 if (givenName != null) { |
| 1069 _json["givenName"] = givenName; |
| 1070 } |
| 1071 return _json; |
| 1072 } |
| 1073 } |
| 1074 |
| 1075 |
| 1076 /** This is a JSON template for a Player resource. */ |
| 1077 class Player { |
| 1078 /** The base URL for the image that represents the player. */ |
| 1079 core.String avatarImageUrl; |
| 1080 |
| 1081 /** The name to display for the player. */ |
| 1082 core.String displayName; |
| 1083 |
| 1084 /** |
| 1085 * An object to represent Play Game experience information for the player. |
| 1086 */ |
| 1087 GamesPlayerExperienceInfoResource experienceInfo; |
| 1088 |
| 1089 /** |
| 1090 * Uniquely identifies the type of this resource. Value is always the fixed |
| 1091 * string gamesManagement#player. |
| 1092 */ |
| 1093 core.String kind; |
| 1094 |
| 1095 /** |
| 1096 * Details about the last time this player played a multiplayer game with the |
| 1097 * currently authenticated player. Populated for PLAYED_WITH player collection |
| 1098 * members. |
| 1099 */ |
| 1100 GamesPlayedResource lastPlayedWith; |
| 1101 |
| 1102 /** |
| 1103 * An object representation of the individual components of the player's name. |
| 1104 * For some players, these fields may not be present. |
| 1105 */ |
| 1106 PlayerName name; |
| 1107 |
| 1108 /** The ID of the player. */ |
| 1109 core.String playerId; |
| 1110 |
| 1111 /** The player's title rewarded for their game activities. */ |
| 1112 core.String title; |
| 1113 |
| 1114 |
| 1115 Player(); |
| 1116 |
| 1117 Player.fromJson(core.Map _json) { |
| 1118 if (_json.containsKey("avatarImageUrl")) { |
| 1119 avatarImageUrl = _json["avatarImageUrl"]; |
| 1120 } |
| 1121 if (_json.containsKey("displayName")) { |
| 1122 displayName = _json["displayName"]; |
| 1123 } |
| 1124 if (_json.containsKey("experienceInfo")) { |
| 1125 experienceInfo = new GamesPlayerExperienceInfoResource.fromJson(_json["exp
erienceInfo"]); |
| 1126 } |
| 1127 if (_json.containsKey("kind")) { |
| 1128 kind = _json["kind"]; |
| 1129 } |
| 1130 if (_json.containsKey("lastPlayedWith")) { |
| 1131 lastPlayedWith = new GamesPlayedResource.fromJson(_json["lastPlayedWith"])
; |
| 1132 } |
| 1133 if (_json.containsKey("name")) { |
| 1134 name = new PlayerName.fromJson(_json["name"]); |
| 1135 } |
| 1136 if (_json.containsKey("playerId")) { |
| 1137 playerId = _json["playerId"]; |
| 1138 } |
| 1139 if (_json.containsKey("title")) { |
| 1140 title = _json["title"]; |
| 1141 } |
| 1142 } |
| 1143 |
| 1144 core.Map toJson() { |
| 1145 var _json = new core.Map(); |
| 1146 if (avatarImageUrl != null) { |
| 1147 _json["avatarImageUrl"] = avatarImageUrl; |
| 1148 } |
| 1149 if (displayName != null) { |
| 1150 _json["displayName"] = displayName; |
| 1151 } |
| 1152 if (experienceInfo != null) { |
| 1153 _json["experienceInfo"] = (experienceInfo).toJson(); |
| 1154 } |
| 1155 if (kind != null) { |
| 1156 _json["kind"] = kind; |
| 1157 } |
| 1158 if (lastPlayedWith != null) { |
| 1159 _json["lastPlayedWith"] = (lastPlayedWith).toJson(); |
| 1160 } |
| 1161 if (name != null) { |
| 1162 _json["name"] = (name).toJson(); |
| 1163 } |
| 1164 if (playerId != null) { |
| 1165 _json["playerId"] = playerId; |
| 1166 } |
| 1167 if (title != null) { |
| 1168 _json["title"] = title; |
| 1169 } |
| 1170 return _json; |
| 1171 } |
| 1172 } |
| 1173 |
| 1174 |
| 1175 /** This is a JSON template for a list of reset leaderboard entry resources. */ |
| 1176 class PlayerScoreResetResponse { |
| 1177 /** |
| 1178 * Uniquely identifies the type of this resource. Value is always the fixed |
| 1179 * string gamesManagement#playerScoreResetResponse. |
| 1180 */ |
| 1181 core.String kind; |
| 1182 |
| 1183 /** |
| 1184 * The time spans of the updated score. |
| 1185 * Possible values are: |
| 1186 * - "ALL_TIME" - The score is an all-time score. |
| 1187 * - "WEEKLY" - The score is a weekly score. |
| 1188 * - "DAILY" - The score is a daily score. |
| 1189 */ |
| 1190 core.List<core.String> resetScoreTimeSpans; |
| 1191 |
| 1192 |
| 1193 PlayerScoreResetResponse(); |
| 1194 |
| 1195 PlayerScoreResetResponse.fromJson(core.Map _json) { |
| 1196 if (_json.containsKey("kind")) { |
| 1197 kind = _json["kind"]; |
| 1198 } |
| 1199 if (_json.containsKey("resetScoreTimeSpans")) { |
| 1200 resetScoreTimeSpans = _json["resetScoreTimeSpans"]; |
| 1201 } |
| 1202 } |
| 1203 |
| 1204 core.Map toJson() { |
| 1205 var _json = new core.Map(); |
| 1206 if (kind != null) { |
| 1207 _json["kind"] = kind; |
| 1208 } |
| 1209 if (resetScoreTimeSpans != null) { |
| 1210 _json["resetScoreTimeSpans"] = resetScoreTimeSpans; |
| 1211 } |
| 1212 return _json; |
| 1213 } |
| 1214 } |
| 1215 |
| 1216 |
OLD | NEW |