OLD | NEW |
(Empty) | |
| 1 library googleapis.games.v1; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection_1; |
| 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 API for Google Play Game Services. */ |
| 17 class GamesApi { |
| 18 /** View and manage its own configuration data in your Google Drive */ |
| 19 static const DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdat
a"; |
| 20 |
| 21 /** |
| 22 * Share your Google+ profile information and view and manage your game |
| 23 * activity |
| 24 */ |
| 25 static const GamesScope = "https://www.googleapis.com/auth/games"; |
| 26 |
| 27 /** Know your basic profile info and list of people in your circles. */ |
| 28 static const PlusLoginScope = "https://www.googleapis.com/auth/plus.login"; |
| 29 |
| 30 |
| 31 final common_internal.ApiRequester _requester; |
| 32 |
| 33 AchievementDefinitionsResourceApi get achievementDefinitions => new Achievemen
tDefinitionsResourceApi(_requester); |
| 34 AchievementsResourceApi get achievements => new AchievementsResourceApi(_reque
ster); |
| 35 ApplicationsResourceApi get applications => new ApplicationsResourceApi(_reque
ster); |
| 36 EventsResourceApi get events => new EventsResourceApi(_requester); |
| 37 LeaderboardsResourceApi get leaderboards => new LeaderboardsResourceApi(_reque
ster); |
| 38 MetagameResourceApi get metagame => new MetagameResourceApi(_requester); |
| 39 PlayersResourceApi get players => new PlayersResourceApi(_requester); |
| 40 PushtokensResourceApi get pushtokens => new PushtokensResourceApi(_requester); |
| 41 QuestMilestonesResourceApi get questMilestones => new QuestMilestonesResourceA
pi(_requester); |
| 42 QuestsResourceApi get quests => new QuestsResourceApi(_requester); |
| 43 RevisionsResourceApi get revisions => new RevisionsResourceApi(_requester); |
| 44 RoomsResourceApi get rooms => new RoomsResourceApi(_requester); |
| 45 ScoresResourceApi get scores => new ScoresResourceApi(_requester); |
| 46 SnapshotsResourceApi get snapshots => new SnapshotsResourceApi(_requester); |
| 47 TurnBasedMatchesResourceApi get turnBasedMatches => new TurnBasedMatchesResour
ceApi(_requester); |
| 48 |
| 49 GamesApi(http.Client client) : |
| 50 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/games/v1/"); |
| 51 } |
| 52 |
| 53 |
| 54 /** Not documented yet. */ |
| 55 class AchievementDefinitionsResourceApi { |
| 56 final common_internal.ApiRequester _requester; |
| 57 |
| 58 AchievementDefinitionsResourceApi(common_internal.ApiRequester client) : |
| 59 _requester = client; |
| 60 |
| 61 /** |
| 62 * Lists all the achievement definitions for your application. |
| 63 * |
| 64 * Request parameters: |
| 65 * |
| 66 * [language] - The preferred language to use for strings returned by this |
| 67 * method. |
| 68 * |
| 69 * [maxResults] - The maximum number of achievement resources to return in the |
| 70 * response, used for paging. For any response, the actual number of |
| 71 * achievement resources returned may be less than the specified maxResults. |
| 72 * Value must be between "1" and "200". |
| 73 * |
| 74 * [pageToken] - The token returned by the previous request. |
| 75 * |
| 76 * Completes with a [AchievementDefinitionsListResponse]. |
| 77 * |
| 78 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 79 * error. |
| 80 * |
| 81 * If the used [http.Client] completes with an error when making a REST call, |
| 82 * this method will complete with the same error. |
| 83 */ |
| 84 async.Future<AchievementDefinitionsListResponse> list({core.String language, c
ore.int maxResults, core.String pageToken}) { |
| 85 var _url = null; |
| 86 var _queryParams = new core.Map(); |
| 87 var _uploadMedia = null; |
| 88 var _uploadOptions = null; |
| 89 var _downloadOptions = common.DownloadOptions.Metadata; |
| 90 var _body = null; |
| 91 |
| 92 if (language != null) { |
| 93 _queryParams["language"] = [language]; |
| 94 } |
| 95 if (maxResults != null) { |
| 96 _queryParams["maxResults"] = ["${maxResults}"]; |
| 97 } |
| 98 if (pageToken != null) { |
| 99 _queryParams["pageToken"] = [pageToken]; |
| 100 } |
| 101 |
| 102 |
| 103 _url = 'achievements'; |
| 104 |
| 105 var _response = _requester.request(_url, |
| 106 "GET", |
| 107 body: _body, |
| 108 queryParams: _queryParams, |
| 109 uploadOptions: _uploadOptions, |
| 110 uploadMedia: _uploadMedia, |
| 111 downloadOptions: _downloadOptions); |
| 112 return _response.then((data) => new AchievementDefinitionsListResponse.fromJ
son(data)); |
| 113 } |
| 114 |
| 115 } |
| 116 |
| 117 |
| 118 /** Not documented yet. */ |
| 119 class AchievementsResourceApi { |
| 120 final common_internal.ApiRequester _requester; |
| 121 |
| 122 AchievementsResourceApi(common_internal.ApiRequester client) : |
| 123 _requester = client; |
| 124 |
| 125 /** |
| 126 * Increments the steps of the achievement with the given ID for the currently |
| 127 * authenticated player. |
| 128 * |
| 129 * Request parameters: |
| 130 * |
| 131 * [achievementId] - The ID of the achievement used by this method. |
| 132 * |
| 133 * [stepsToIncrement] - The number of steps to increment. |
| 134 * |
| 135 * [requestId] - A randomly generated numeric ID for each request specified by |
| 136 * the caller. This number is used at the server to ensure that the request is |
| 137 * handled correctly across retries. |
| 138 * |
| 139 * Completes with a [AchievementIncrementResponse]. |
| 140 * |
| 141 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 142 * error. |
| 143 * |
| 144 * If the used [http.Client] completes with an error when making a REST call, |
| 145 * this method will complete with the same error. |
| 146 */ |
| 147 async.Future<AchievementIncrementResponse> increment(core.String achievementId
, core.int stepsToIncrement, {core.String requestId}) { |
| 148 var _url = null; |
| 149 var _queryParams = new core.Map(); |
| 150 var _uploadMedia = null; |
| 151 var _uploadOptions = null; |
| 152 var _downloadOptions = common.DownloadOptions.Metadata; |
| 153 var _body = null; |
| 154 |
| 155 if (achievementId == null) { |
| 156 throw new core.ArgumentError("Parameter achievementId is required."); |
| 157 } |
| 158 if (stepsToIncrement == null) { |
| 159 throw new core.ArgumentError("Parameter stepsToIncrement is required."); |
| 160 } |
| 161 _queryParams["stepsToIncrement"] = ["${stepsToIncrement}"]; |
| 162 if (requestId != null) { |
| 163 _queryParams["requestId"] = [requestId]; |
| 164 } |
| 165 |
| 166 |
| 167 _url = 'achievements/' + common_internal.Escaper.ecapeVariable('$achievement
Id') + '/increment'; |
| 168 |
| 169 var _response = _requester.request(_url, |
| 170 "POST", |
| 171 body: _body, |
| 172 queryParams: _queryParams, |
| 173 uploadOptions: _uploadOptions, |
| 174 uploadMedia: _uploadMedia, |
| 175 downloadOptions: _downloadOptions); |
| 176 return _response.then((data) => new AchievementIncrementResponse.fromJson(da
ta)); |
| 177 } |
| 178 |
| 179 /** |
| 180 * Lists the progress for all your application's achievements for the |
| 181 * currently authenticated player. |
| 182 * |
| 183 * Request parameters: |
| 184 * |
| 185 * [playerId] - A player ID. A value of me may be used in place of the |
| 186 * authenticated player's ID. |
| 187 * |
| 188 * [language] - The preferred language to use for strings returned by this |
| 189 * method. |
| 190 * |
| 191 * [maxResults] - The maximum number of achievement resources to return in the |
| 192 * response, used for paging. For any response, the actual number of |
| 193 * achievement resources returned may be less than the specified maxResults. |
| 194 * Value must be between "1" and "200". |
| 195 * |
| 196 * [pageToken] - The token returned by the previous request. |
| 197 * |
| 198 * [state] - Tells the server to return only achievements with the specified |
| 199 * state. If this parameter isn't specified, all achievements are returned. |
| 200 * Possible string values are: |
| 201 * - "ALL" : List all achievements. This is the default. |
| 202 * - "HIDDEN" : List only hidden achievements. |
| 203 * - "REVEALED" : List only revealed achievements. |
| 204 * - "UNLOCKED" : List only unlocked achievements. |
| 205 * |
| 206 * Completes with a [PlayerAchievementListResponse]. |
| 207 * |
| 208 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 209 * error. |
| 210 * |
| 211 * If the used [http.Client] completes with an error when making a REST call, |
| 212 * this method will complete with the same error. |
| 213 */ |
| 214 async.Future<PlayerAchievementListResponse> list(core.String playerId, {core.S
tring language, core.int maxResults, core.String pageToken, core.String state})
{ |
| 215 var _url = null; |
| 216 var _queryParams = new core.Map(); |
| 217 var _uploadMedia = null; |
| 218 var _uploadOptions = null; |
| 219 var _downloadOptions = common.DownloadOptions.Metadata; |
| 220 var _body = null; |
| 221 |
| 222 if (playerId == null) { |
| 223 throw new core.ArgumentError("Parameter playerId is required."); |
| 224 } |
| 225 if (language != null) { |
| 226 _queryParams["language"] = [language]; |
| 227 } |
| 228 if (maxResults != null) { |
| 229 _queryParams["maxResults"] = ["${maxResults}"]; |
| 230 } |
| 231 if (pageToken != null) { |
| 232 _queryParams["pageToken"] = [pageToken]; |
| 233 } |
| 234 if (state != null) { |
| 235 _queryParams["state"] = [state]; |
| 236 } |
| 237 |
| 238 |
| 239 _url = 'players/' + common_internal.Escaper.ecapeVariable('$playerId') + '/a
chievements'; |
| 240 |
| 241 var _response = _requester.request(_url, |
| 242 "GET", |
| 243 body: _body, |
| 244 queryParams: _queryParams, |
| 245 uploadOptions: _uploadOptions, |
| 246 uploadMedia: _uploadMedia, |
| 247 downloadOptions: _downloadOptions); |
| 248 return _response.then((data) => new PlayerAchievementListResponse.fromJson(d
ata)); |
| 249 } |
| 250 |
| 251 /** |
| 252 * Sets the state of the achievement with the given ID to REVEALED for the |
| 253 * currently authenticated player. |
| 254 * |
| 255 * Request parameters: |
| 256 * |
| 257 * [achievementId] - The ID of the achievement used by this method. |
| 258 * |
| 259 * Completes with a [AchievementRevealResponse]. |
| 260 * |
| 261 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 262 * error. |
| 263 * |
| 264 * If the used [http.Client] completes with an error when making a REST call, |
| 265 * this method will complete with the same error. |
| 266 */ |
| 267 async.Future<AchievementRevealResponse> reveal(core.String achievementId) { |
| 268 var _url = null; |
| 269 var _queryParams = new core.Map(); |
| 270 var _uploadMedia = null; |
| 271 var _uploadOptions = null; |
| 272 var _downloadOptions = common.DownloadOptions.Metadata; |
| 273 var _body = null; |
| 274 |
| 275 if (achievementId == null) { |
| 276 throw new core.ArgumentError("Parameter achievementId is required."); |
| 277 } |
| 278 |
| 279 |
| 280 _url = 'achievements/' + common_internal.Escaper.ecapeVariable('$achievement
Id') + '/reveal'; |
| 281 |
| 282 var _response = _requester.request(_url, |
| 283 "POST", |
| 284 body: _body, |
| 285 queryParams: _queryParams, |
| 286 uploadOptions: _uploadOptions, |
| 287 uploadMedia: _uploadMedia, |
| 288 downloadOptions: _downloadOptions); |
| 289 return _response.then((data) => new AchievementRevealResponse.fromJson(data)
); |
| 290 } |
| 291 |
| 292 /** |
| 293 * Sets the steps for the currently authenticated player towards unlocking an |
| 294 * achievement. If the steps parameter is less than the current number of |
| 295 * steps that the player already gained for the achievement, the achievement |
| 296 * is not modified. |
| 297 * |
| 298 * Request parameters: |
| 299 * |
| 300 * [achievementId] - The ID of the achievement used by this method. |
| 301 * |
| 302 * [steps] - The minimum value to set the steps to. |
| 303 * |
| 304 * Completes with a [AchievementSetStepsAtLeastResponse]. |
| 305 * |
| 306 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 307 * error. |
| 308 * |
| 309 * If the used [http.Client] completes with an error when making a REST call, |
| 310 * this method will complete with the same error. |
| 311 */ |
| 312 async.Future<AchievementSetStepsAtLeastResponse> setStepsAtLeast(core.String a
chievementId, core.int steps) { |
| 313 var _url = null; |
| 314 var _queryParams = new core.Map(); |
| 315 var _uploadMedia = null; |
| 316 var _uploadOptions = null; |
| 317 var _downloadOptions = common.DownloadOptions.Metadata; |
| 318 var _body = null; |
| 319 |
| 320 if (achievementId == null) { |
| 321 throw new core.ArgumentError("Parameter achievementId is required."); |
| 322 } |
| 323 if (steps == null) { |
| 324 throw new core.ArgumentError("Parameter steps is required."); |
| 325 } |
| 326 _queryParams["steps"] = ["${steps}"]; |
| 327 |
| 328 |
| 329 _url = 'achievements/' + common_internal.Escaper.ecapeVariable('$achievement
Id') + '/setStepsAtLeast'; |
| 330 |
| 331 var _response = _requester.request(_url, |
| 332 "POST", |
| 333 body: _body, |
| 334 queryParams: _queryParams, |
| 335 uploadOptions: _uploadOptions, |
| 336 uploadMedia: _uploadMedia, |
| 337 downloadOptions: _downloadOptions); |
| 338 return _response.then((data) => new AchievementSetStepsAtLeastResponse.fromJ
son(data)); |
| 339 } |
| 340 |
| 341 /** |
| 342 * Unlocks this achievement for the currently authenticated player. |
| 343 * |
| 344 * Request parameters: |
| 345 * |
| 346 * [achievementId] - The ID of the achievement used by this method. |
| 347 * |
| 348 * Completes with a [AchievementUnlockResponse]. |
| 349 * |
| 350 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 351 * error. |
| 352 * |
| 353 * If the used [http.Client] completes with an error when making a REST call, |
| 354 * this method will complete with the same error. |
| 355 */ |
| 356 async.Future<AchievementUnlockResponse> unlock(core.String achievementId) { |
| 357 var _url = null; |
| 358 var _queryParams = new core.Map(); |
| 359 var _uploadMedia = null; |
| 360 var _uploadOptions = null; |
| 361 var _downloadOptions = common.DownloadOptions.Metadata; |
| 362 var _body = null; |
| 363 |
| 364 if (achievementId == null) { |
| 365 throw new core.ArgumentError("Parameter achievementId is required."); |
| 366 } |
| 367 |
| 368 |
| 369 _url = 'achievements/' + common_internal.Escaper.ecapeVariable('$achievement
Id') + '/unlock'; |
| 370 |
| 371 var _response = _requester.request(_url, |
| 372 "POST", |
| 373 body: _body, |
| 374 queryParams: _queryParams, |
| 375 uploadOptions: _uploadOptions, |
| 376 uploadMedia: _uploadMedia, |
| 377 downloadOptions: _downloadOptions); |
| 378 return _response.then((data) => new AchievementUnlockResponse.fromJson(data)
); |
| 379 } |
| 380 |
| 381 /** |
| 382 * Updates multiple achievements for the currently authenticated player. |
| 383 * |
| 384 * [request] - The metadata request object. |
| 385 * |
| 386 * Request parameters: |
| 387 * |
| 388 * Completes with a [AchievementUpdateMultipleResponse]. |
| 389 * |
| 390 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 391 * error. |
| 392 * |
| 393 * If the used [http.Client] completes with an error when making a REST call, |
| 394 * this method will complete with the same error. |
| 395 */ |
| 396 async.Future<AchievementUpdateMultipleResponse> updateMultiple(AchievementUpda
teMultipleRequest request) { |
| 397 var _url = null; |
| 398 var _queryParams = new core.Map(); |
| 399 var _uploadMedia = null; |
| 400 var _uploadOptions = null; |
| 401 var _downloadOptions = common.DownloadOptions.Metadata; |
| 402 var _body = null; |
| 403 |
| 404 if (request != null) { |
| 405 _body = convert.JSON.encode((request).toJson()); |
| 406 } |
| 407 |
| 408 |
| 409 _url = 'achievements/updateMultiple'; |
| 410 |
| 411 var _response = _requester.request(_url, |
| 412 "POST", |
| 413 body: _body, |
| 414 queryParams: _queryParams, |
| 415 uploadOptions: _uploadOptions, |
| 416 uploadMedia: _uploadMedia, |
| 417 downloadOptions: _downloadOptions); |
| 418 return _response.then((data) => new AchievementUpdateMultipleResponse.fromJs
on(data)); |
| 419 } |
| 420 |
| 421 } |
| 422 |
| 423 |
| 424 /** Not documented yet. */ |
| 425 class ApplicationsResourceApi { |
| 426 final common_internal.ApiRequester _requester; |
| 427 |
| 428 ApplicationsResourceApi(common_internal.ApiRequester client) : |
| 429 _requester = client; |
| 430 |
| 431 /** |
| 432 * Retrieves the metadata of the application with the given ID. If the |
| 433 * requested application is not available for the specified platformType, the |
| 434 * returned response will not include any instance data. |
| 435 * |
| 436 * Request parameters: |
| 437 * |
| 438 * [applicationId] - The application being requested. |
| 439 * |
| 440 * [language] - The preferred language to use for strings returned by this |
| 441 * method. |
| 442 * |
| 443 * [platformType] - Restrict application details returned to the specific |
| 444 * platform. |
| 445 * Possible string values are: |
| 446 * - "ANDROID" : Retrieve applications that can be played on Android. |
| 447 * - "IOS" : Retrieve applications that can be played on iOS. |
| 448 * - "WEB_APP" : Retrieve applications that can be played on desktop web. |
| 449 * |
| 450 * Completes with a [Application]. |
| 451 * |
| 452 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 453 * error. |
| 454 * |
| 455 * If the used [http.Client] completes with an error when making a REST call, |
| 456 * this method will complete with the same error. |
| 457 */ |
| 458 async.Future<Application> get(core.String applicationId, {core.String language
, core.String platformType}) { |
| 459 var _url = null; |
| 460 var _queryParams = new core.Map(); |
| 461 var _uploadMedia = null; |
| 462 var _uploadOptions = null; |
| 463 var _downloadOptions = common.DownloadOptions.Metadata; |
| 464 var _body = null; |
| 465 |
| 466 if (applicationId == null) { |
| 467 throw new core.ArgumentError("Parameter applicationId is required."); |
| 468 } |
| 469 if (language != null) { |
| 470 _queryParams["language"] = [language]; |
| 471 } |
| 472 if (platformType != null) { |
| 473 _queryParams["platformType"] = [platformType]; |
| 474 } |
| 475 |
| 476 |
| 477 _url = 'applications/' + common_internal.Escaper.ecapeVariable('$application
Id'); |
| 478 |
| 479 var _response = _requester.request(_url, |
| 480 "GET", |
| 481 body: _body, |
| 482 queryParams: _queryParams, |
| 483 uploadOptions: _uploadOptions, |
| 484 uploadMedia: _uploadMedia, |
| 485 downloadOptions: _downloadOptions); |
| 486 return _response.then((data) => new Application.fromJson(data)); |
| 487 } |
| 488 |
| 489 /** |
| 490 * Indicate that the the currently authenticated user is playing your |
| 491 * application. |
| 492 * |
| 493 * Request parameters: |
| 494 * |
| 495 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 496 * error. |
| 497 * |
| 498 * If the used [http.Client] completes with an error when making a REST call, |
| 499 * this method will complete with the same error. |
| 500 */ |
| 501 async.Future played() { |
| 502 var _url = null; |
| 503 var _queryParams = new core.Map(); |
| 504 var _uploadMedia = null; |
| 505 var _uploadOptions = null; |
| 506 var _downloadOptions = common.DownloadOptions.Metadata; |
| 507 var _body = null; |
| 508 |
| 509 |
| 510 _downloadOptions = null; |
| 511 |
| 512 _url = 'applications/played'; |
| 513 |
| 514 var _response = _requester.request(_url, |
| 515 "POST", |
| 516 body: _body, |
| 517 queryParams: _queryParams, |
| 518 uploadOptions: _uploadOptions, |
| 519 uploadMedia: _uploadMedia, |
| 520 downloadOptions: _downloadOptions); |
| 521 return _response.then((data) => null); |
| 522 } |
| 523 |
| 524 } |
| 525 |
| 526 |
| 527 /** Not documented yet. */ |
| 528 class EventsResourceApi { |
| 529 final common_internal.ApiRequester _requester; |
| 530 |
| 531 EventsResourceApi(common_internal.ApiRequester client) : |
| 532 _requester = client; |
| 533 |
| 534 /** |
| 535 * Returns a list showing the current progress on events in this application |
| 536 * for the currently authenticated user. |
| 537 * |
| 538 * Request parameters: |
| 539 * |
| 540 * [language] - The preferred language to use for strings returned by this |
| 541 * method. |
| 542 * |
| 543 * [maxResults] - The maximum number of events to return in the response, used |
| 544 * for paging. For any response, the actual number of events to return may be |
| 545 * less than the specified maxResults. |
| 546 * Value must be between "1" and "100". |
| 547 * |
| 548 * [pageToken] - The token returned by the previous request. |
| 549 * |
| 550 * Completes with a [PlayerEventListResponse]. |
| 551 * |
| 552 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 553 * error. |
| 554 * |
| 555 * If the used [http.Client] completes with an error when making a REST call, |
| 556 * this method will complete with the same error. |
| 557 */ |
| 558 async.Future<PlayerEventListResponse> listByPlayer({core.String language, core
.int maxResults, core.String pageToken}) { |
| 559 var _url = null; |
| 560 var _queryParams = new core.Map(); |
| 561 var _uploadMedia = null; |
| 562 var _uploadOptions = null; |
| 563 var _downloadOptions = common.DownloadOptions.Metadata; |
| 564 var _body = null; |
| 565 |
| 566 if (language != null) { |
| 567 _queryParams["language"] = [language]; |
| 568 } |
| 569 if (maxResults != null) { |
| 570 _queryParams["maxResults"] = ["${maxResults}"]; |
| 571 } |
| 572 if (pageToken != null) { |
| 573 _queryParams["pageToken"] = [pageToken]; |
| 574 } |
| 575 |
| 576 |
| 577 _url = 'events'; |
| 578 |
| 579 var _response = _requester.request(_url, |
| 580 "GET", |
| 581 body: _body, |
| 582 queryParams: _queryParams, |
| 583 uploadOptions: _uploadOptions, |
| 584 uploadMedia: _uploadMedia, |
| 585 downloadOptions: _downloadOptions); |
| 586 return _response.then((data) => new PlayerEventListResponse.fromJson(data)); |
| 587 } |
| 588 |
| 589 /** |
| 590 * Returns a list of the event definitions in this application. |
| 591 * |
| 592 * Request parameters: |
| 593 * |
| 594 * [language] - The preferred language to use for strings returned by this |
| 595 * method. |
| 596 * |
| 597 * [maxResults] - The maximum number of event definitions to return in the |
| 598 * response, used for paging. For any response, the actual number of event |
| 599 * definitions to return may be less than the specified maxResults. |
| 600 * Value must be between "1" and "100". |
| 601 * |
| 602 * [pageToken] - The token returned by the previous request. |
| 603 * |
| 604 * Completes with a [EventDefinitionListResponse]. |
| 605 * |
| 606 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 607 * error. |
| 608 * |
| 609 * If the used [http.Client] completes with an error when making a REST call, |
| 610 * this method will complete with the same error. |
| 611 */ |
| 612 async.Future<EventDefinitionListResponse> listDefinitions({core.String languag
e, core.int maxResults, core.String pageToken}) { |
| 613 var _url = null; |
| 614 var _queryParams = new core.Map(); |
| 615 var _uploadMedia = null; |
| 616 var _uploadOptions = null; |
| 617 var _downloadOptions = common.DownloadOptions.Metadata; |
| 618 var _body = null; |
| 619 |
| 620 if (language != null) { |
| 621 _queryParams["language"] = [language]; |
| 622 } |
| 623 if (maxResults != null) { |
| 624 _queryParams["maxResults"] = ["${maxResults}"]; |
| 625 } |
| 626 if (pageToken != null) { |
| 627 _queryParams["pageToken"] = [pageToken]; |
| 628 } |
| 629 |
| 630 |
| 631 _url = 'eventDefinitions'; |
| 632 |
| 633 var _response = _requester.request(_url, |
| 634 "GET", |
| 635 body: _body, |
| 636 queryParams: _queryParams, |
| 637 uploadOptions: _uploadOptions, |
| 638 uploadMedia: _uploadMedia, |
| 639 downloadOptions: _downloadOptions); |
| 640 return _response.then((data) => new EventDefinitionListResponse.fromJson(dat
a)); |
| 641 } |
| 642 |
| 643 /** |
| 644 * Records a batch of changes to the number of times events have occurred for |
| 645 * the currently authenticated user of this application. |
| 646 * |
| 647 * [request] - The metadata request object. |
| 648 * |
| 649 * Request parameters: |
| 650 * |
| 651 * [language] - The preferred language to use for strings returned by this |
| 652 * method. |
| 653 * |
| 654 * Completes with a [EventUpdateResponse]. |
| 655 * |
| 656 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 657 * error. |
| 658 * |
| 659 * If the used [http.Client] completes with an error when making a REST call, |
| 660 * this method will complete with the same error. |
| 661 */ |
| 662 async.Future<EventUpdateResponse> record(EventRecordRequest request, {core.Str
ing language}) { |
| 663 var _url = null; |
| 664 var _queryParams = new core.Map(); |
| 665 var _uploadMedia = null; |
| 666 var _uploadOptions = null; |
| 667 var _downloadOptions = common.DownloadOptions.Metadata; |
| 668 var _body = null; |
| 669 |
| 670 if (request != null) { |
| 671 _body = convert.JSON.encode((request).toJson()); |
| 672 } |
| 673 if (language != null) { |
| 674 _queryParams["language"] = [language]; |
| 675 } |
| 676 |
| 677 |
| 678 _url = 'events'; |
| 679 |
| 680 var _response = _requester.request(_url, |
| 681 "POST", |
| 682 body: _body, |
| 683 queryParams: _queryParams, |
| 684 uploadOptions: _uploadOptions, |
| 685 uploadMedia: _uploadMedia, |
| 686 downloadOptions: _downloadOptions); |
| 687 return _response.then((data) => new EventUpdateResponse.fromJson(data)); |
| 688 } |
| 689 |
| 690 } |
| 691 |
| 692 |
| 693 /** Not documented yet. */ |
| 694 class LeaderboardsResourceApi { |
| 695 final common_internal.ApiRequester _requester; |
| 696 |
| 697 LeaderboardsResourceApi(common_internal.ApiRequester client) : |
| 698 _requester = client; |
| 699 |
| 700 /** |
| 701 * Retrieves the metadata of the leaderboard with the given ID. |
| 702 * |
| 703 * Request parameters: |
| 704 * |
| 705 * [leaderboardId] - The ID of the leaderboard. |
| 706 * |
| 707 * [language] - The preferred language to use for strings returned by this |
| 708 * method. |
| 709 * |
| 710 * Completes with a [Leaderboard]. |
| 711 * |
| 712 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 713 * error. |
| 714 * |
| 715 * If the used [http.Client] completes with an error when making a REST call, |
| 716 * this method will complete with the same error. |
| 717 */ |
| 718 async.Future<Leaderboard> get(core.String leaderboardId, {core.String language
}) { |
| 719 var _url = null; |
| 720 var _queryParams = new core.Map(); |
| 721 var _uploadMedia = null; |
| 722 var _uploadOptions = null; |
| 723 var _downloadOptions = common.DownloadOptions.Metadata; |
| 724 var _body = null; |
| 725 |
| 726 if (leaderboardId == null) { |
| 727 throw new core.ArgumentError("Parameter leaderboardId is required."); |
| 728 } |
| 729 if (language != null) { |
| 730 _queryParams["language"] = [language]; |
| 731 } |
| 732 |
| 733 |
| 734 _url = 'leaderboards/' + common_internal.Escaper.ecapeVariable('$leaderboard
Id'); |
| 735 |
| 736 var _response = _requester.request(_url, |
| 737 "GET", |
| 738 body: _body, |
| 739 queryParams: _queryParams, |
| 740 uploadOptions: _uploadOptions, |
| 741 uploadMedia: _uploadMedia, |
| 742 downloadOptions: _downloadOptions); |
| 743 return _response.then((data) => new Leaderboard.fromJson(data)); |
| 744 } |
| 745 |
| 746 /** |
| 747 * Lists all the leaderboard metadata for your application. |
| 748 * |
| 749 * Request parameters: |
| 750 * |
| 751 * [language] - The preferred language to use for strings returned by this |
| 752 * method. |
| 753 * |
| 754 * [maxResults] - The maximum number of leaderboards to return in the |
| 755 * response. For any response, the actual number of leaderboards returned may |
| 756 * be less than the specified maxResults. |
| 757 * Value must be between "1" and "200". |
| 758 * |
| 759 * [pageToken] - The token returned by the previous request. |
| 760 * |
| 761 * Completes with a [LeaderboardListResponse]. |
| 762 * |
| 763 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 764 * error. |
| 765 * |
| 766 * If the used [http.Client] completes with an error when making a REST call, |
| 767 * this method will complete with the same error. |
| 768 */ |
| 769 async.Future<LeaderboardListResponse> list({core.String language, core.int max
Results, core.String pageToken}) { |
| 770 var _url = null; |
| 771 var _queryParams = new core.Map(); |
| 772 var _uploadMedia = null; |
| 773 var _uploadOptions = null; |
| 774 var _downloadOptions = common.DownloadOptions.Metadata; |
| 775 var _body = null; |
| 776 |
| 777 if (language != null) { |
| 778 _queryParams["language"] = [language]; |
| 779 } |
| 780 if (maxResults != null) { |
| 781 _queryParams["maxResults"] = ["${maxResults}"]; |
| 782 } |
| 783 if (pageToken != null) { |
| 784 _queryParams["pageToken"] = [pageToken]; |
| 785 } |
| 786 |
| 787 |
| 788 _url = 'leaderboards'; |
| 789 |
| 790 var _response = _requester.request(_url, |
| 791 "GET", |
| 792 body: _body, |
| 793 queryParams: _queryParams, |
| 794 uploadOptions: _uploadOptions, |
| 795 uploadMedia: _uploadMedia, |
| 796 downloadOptions: _downloadOptions); |
| 797 return _response.then((data) => new LeaderboardListResponse.fromJson(data)); |
| 798 } |
| 799 |
| 800 } |
| 801 |
| 802 |
| 803 /** Not documented yet. */ |
| 804 class MetagameResourceApi { |
| 805 final common_internal.ApiRequester _requester; |
| 806 |
| 807 MetagameResourceApi(common_internal.ApiRequester client) : |
| 808 _requester = client; |
| 809 |
| 810 /** |
| 811 * Return the metagame configuration data for the calling application. |
| 812 * |
| 813 * Request parameters: |
| 814 * |
| 815 * Completes with a [MetagameConfig]. |
| 816 * |
| 817 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 818 * error. |
| 819 * |
| 820 * If the used [http.Client] completes with an error when making a REST call, |
| 821 * this method will complete with the same error. |
| 822 */ |
| 823 async.Future<MetagameConfig> getMetagameConfig() { |
| 824 var _url = null; |
| 825 var _queryParams = new core.Map(); |
| 826 var _uploadMedia = null; |
| 827 var _uploadOptions = null; |
| 828 var _downloadOptions = common.DownloadOptions.Metadata; |
| 829 var _body = null; |
| 830 |
| 831 |
| 832 |
| 833 _url = 'metagameConfig'; |
| 834 |
| 835 var _response = _requester.request(_url, |
| 836 "GET", |
| 837 body: _body, |
| 838 queryParams: _queryParams, |
| 839 uploadOptions: _uploadOptions, |
| 840 uploadMedia: _uploadMedia, |
| 841 downloadOptions: _downloadOptions); |
| 842 return _response.then((data) => new MetagameConfig.fromJson(data)); |
| 843 } |
| 844 |
| 845 /** |
| 846 * List play data aggregated per category for the player corresponding to |
| 847 * playerId. |
| 848 * |
| 849 * Request parameters: |
| 850 * |
| 851 * [playerId] - A player ID. A value of me may be used in place of the |
| 852 * authenticated player's ID. |
| 853 * |
| 854 * [collection] - The collection of categories for which data will be |
| 855 * returned. |
| 856 * Possible string values are: |
| 857 * - "all" : Retrieve data for all categories. This is the default. |
| 858 * |
| 859 * [language] - The preferred language to use for strings returned by this |
| 860 * method. |
| 861 * |
| 862 * [maxResults] - The maximum number of category resources to return in the |
| 863 * response, used for paging. For any response, the actual number of category |
| 864 * resources returned may be less than the specified maxResults. |
| 865 * Value must be between "1" and "100". |
| 866 * |
| 867 * [pageToken] - The token returned by the previous request. |
| 868 * |
| 869 * Completes with a [CategoryListResponse]. |
| 870 * |
| 871 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 872 * error. |
| 873 * |
| 874 * If the used [http.Client] completes with an error when making a REST call, |
| 875 * this method will complete with the same error. |
| 876 */ |
| 877 async.Future<CategoryListResponse> listCategoriesByPlayer(core.String playerId
, core.String collection, {core.String language, core.int maxResults, core.Strin
g pageToken}) { |
| 878 var _url = null; |
| 879 var _queryParams = new core.Map(); |
| 880 var _uploadMedia = null; |
| 881 var _uploadOptions = null; |
| 882 var _downloadOptions = common.DownloadOptions.Metadata; |
| 883 var _body = null; |
| 884 |
| 885 if (playerId == null) { |
| 886 throw new core.ArgumentError("Parameter playerId is required."); |
| 887 } |
| 888 if (collection == null) { |
| 889 throw new core.ArgumentError("Parameter collection is required."); |
| 890 } |
| 891 if (language != null) { |
| 892 _queryParams["language"] = [language]; |
| 893 } |
| 894 if (maxResults != null) { |
| 895 _queryParams["maxResults"] = ["${maxResults}"]; |
| 896 } |
| 897 if (pageToken != null) { |
| 898 _queryParams["pageToken"] = [pageToken]; |
| 899 } |
| 900 |
| 901 |
| 902 _url = 'players/' + common_internal.Escaper.ecapeVariable('$playerId') + '/c
ategories/' + common_internal.Escaper.ecapeVariable('$collection'); |
| 903 |
| 904 var _response = _requester.request(_url, |
| 905 "GET", |
| 906 body: _body, |
| 907 queryParams: _queryParams, |
| 908 uploadOptions: _uploadOptions, |
| 909 uploadMedia: _uploadMedia, |
| 910 downloadOptions: _downloadOptions); |
| 911 return _response.then((data) => new CategoryListResponse.fromJson(data)); |
| 912 } |
| 913 |
| 914 } |
| 915 |
| 916 |
| 917 /** Not documented yet. */ |
| 918 class PlayersResourceApi { |
| 919 final common_internal.ApiRequester _requester; |
| 920 |
| 921 PlayersResourceApi(common_internal.ApiRequester client) : |
| 922 _requester = client; |
| 923 |
| 924 /** |
| 925 * Retrieves the Player resource with the given ID. To retrieve the player for |
| 926 * the currently authenticated user, set playerId to me. |
| 927 * |
| 928 * Request parameters: |
| 929 * |
| 930 * [playerId] - A player ID. A value of me may be used in place of the |
| 931 * authenticated player's ID. |
| 932 * |
| 933 * [language] - The preferred language to use for strings returned by this |
| 934 * method. |
| 935 * |
| 936 * Completes with a [Player]. |
| 937 * |
| 938 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 939 * error. |
| 940 * |
| 941 * If the used [http.Client] completes with an error when making a REST call, |
| 942 * this method will complete with the same error. |
| 943 */ |
| 944 async.Future<Player> get(core.String playerId, {core.String language}) { |
| 945 var _url = null; |
| 946 var _queryParams = new core.Map(); |
| 947 var _uploadMedia = null; |
| 948 var _uploadOptions = null; |
| 949 var _downloadOptions = common.DownloadOptions.Metadata; |
| 950 var _body = null; |
| 951 |
| 952 if (playerId == null) { |
| 953 throw new core.ArgumentError("Parameter playerId is required."); |
| 954 } |
| 955 if (language != null) { |
| 956 _queryParams["language"] = [language]; |
| 957 } |
| 958 |
| 959 |
| 960 _url = 'players/' + common_internal.Escaper.ecapeVariable('$playerId'); |
| 961 |
| 962 var _response = _requester.request(_url, |
| 963 "GET", |
| 964 body: _body, |
| 965 queryParams: _queryParams, |
| 966 uploadOptions: _uploadOptions, |
| 967 uploadMedia: _uploadMedia, |
| 968 downloadOptions: _downloadOptions); |
| 969 return _response.then((data) => new Player.fromJson(data)); |
| 970 } |
| 971 |
| 972 /** |
| 973 * Get the collection of players for the currently authenticated user. |
| 974 * |
| 975 * Request parameters: |
| 976 * |
| 977 * [collection] - Collection of players being retrieved |
| 978 * Possible string values are: |
| 979 * - "playedWith" : (DEPRECATED: please use played_with!) Retrieve a list of |
| 980 * players you have played a multiplayer game (realtime or turn-based) with |
| 981 * recently. |
| 982 * - "played_with" : Retrieve a list of players you have played a multiplayer |
| 983 * game (realtime or turn-based) with recently. |
| 984 * |
| 985 * [language] - The preferred language to use for strings returned by this |
| 986 * method. |
| 987 * |
| 988 * [maxResults] - The maximum number of player resources to return in the |
| 989 * response, used for paging. For any response, the actual number of player |
| 990 * resources returned may be less than the specified maxResults. |
| 991 * Value must be between "1" and "15". |
| 992 * |
| 993 * [pageToken] - The token returned by the previous request. |
| 994 * |
| 995 * Completes with a [PlayerListResponse]. |
| 996 * |
| 997 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 998 * error. |
| 999 * |
| 1000 * If the used [http.Client] completes with an error when making a REST call, |
| 1001 * this method will complete with the same error. |
| 1002 */ |
| 1003 async.Future<PlayerListResponse> list(core.String collection, {core.String lan
guage, core.int maxResults, core.String pageToken}) { |
| 1004 var _url = null; |
| 1005 var _queryParams = new core.Map(); |
| 1006 var _uploadMedia = null; |
| 1007 var _uploadOptions = null; |
| 1008 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1009 var _body = null; |
| 1010 |
| 1011 if (collection == null) { |
| 1012 throw new core.ArgumentError("Parameter collection is required."); |
| 1013 } |
| 1014 if (language != null) { |
| 1015 _queryParams["language"] = [language]; |
| 1016 } |
| 1017 if (maxResults != null) { |
| 1018 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1019 } |
| 1020 if (pageToken != null) { |
| 1021 _queryParams["pageToken"] = [pageToken]; |
| 1022 } |
| 1023 |
| 1024 |
| 1025 _url = 'players/me/players/' + common_internal.Escaper.ecapeVariable('$colle
ction'); |
| 1026 |
| 1027 var _response = _requester.request(_url, |
| 1028 "GET", |
| 1029 body: _body, |
| 1030 queryParams: _queryParams, |
| 1031 uploadOptions: _uploadOptions, |
| 1032 uploadMedia: _uploadMedia, |
| 1033 downloadOptions: _downloadOptions); |
| 1034 return _response.then((data) => new PlayerListResponse.fromJson(data)); |
| 1035 } |
| 1036 |
| 1037 } |
| 1038 |
| 1039 |
| 1040 /** Not documented yet. */ |
| 1041 class PushtokensResourceApi { |
| 1042 final common_internal.ApiRequester _requester; |
| 1043 |
| 1044 PushtokensResourceApi(common_internal.ApiRequester client) : |
| 1045 _requester = client; |
| 1046 |
| 1047 /** |
| 1048 * Removes a push token for the current user and application. Removing a |
| 1049 * non-existent push token will report success. |
| 1050 * |
| 1051 * [request] - The metadata request object. |
| 1052 * |
| 1053 * Request parameters: |
| 1054 * |
| 1055 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1056 * error. |
| 1057 * |
| 1058 * If the used [http.Client] completes with an error when making a REST call, |
| 1059 * this method will complete with the same error. |
| 1060 */ |
| 1061 async.Future remove(PushTokenId request) { |
| 1062 var _url = null; |
| 1063 var _queryParams = new core.Map(); |
| 1064 var _uploadMedia = null; |
| 1065 var _uploadOptions = null; |
| 1066 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1067 var _body = null; |
| 1068 |
| 1069 if (request != null) { |
| 1070 _body = convert.JSON.encode((request).toJson()); |
| 1071 } |
| 1072 |
| 1073 _downloadOptions = null; |
| 1074 |
| 1075 _url = 'pushtokens/remove'; |
| 1076 |
| 1077 var _response = _requester.request(_url, |
| 1078 "POST", |
| 1079 body: _body, |
| 1080 queryParams: _queryParams, |
| 1081 uploadOptions: _uploadOptions, |
| 1082 uploadMedia: _uploadMedia, |
| 1083 downloadOptions: _downloadOptions); |
| 1084 return _response.then((data) => null); |
| 1085 } |
| 1086 |
| 1087 /** |
| 1088 * Registers a push token for the current user and application. |
| 1089 * |
| 1090 * [request] - The metadata request object. |
| 1091 * |
| 1092 * Request parameters: |
| 1093 * |
| 1094 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1095 * error. |
| 1096 * |
| 1097 * If the used [http.Client] completes with an error when making a REST call, |
| 1098 * this method will complete with the same error. |
| 1099 */ |
| 1100 async.Future update(PushToken request) { |
| 1101 var _url = null; |
| 1102 var _queryParams = new core.Map(); |
| 1103 var _uploadMedia = null; |
| 1104 var _uploadOptions = null; |
| 1105 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1106 var _body = null; |
| 1107 |
| 1108 if (request != null) { |
| 1109 _body = convert.JSON.encode((request).toJson()); |
| 1110 } |
| 1111 |
| 1112 _downloadOptions = null; |
| 1113 |
| 1114 _url = 'pushtokens'; |
| 1115 |
| 1116 var _response = _requester.request(_url, |
| 1117 "PUT", |
| 1118 body: _body, |
| 1119 queryParams: _queryParams, |
| 1120 uploadOptions: _uploadOptions, |
| 1121 uploadMedia: _uploadMedia, |
| 1122 downloadOptions: _downloadOptions); |
| 1123 return _response.then((data) => null); |
| 1124 } |
| 1125 |
| 1126 } |
| 1127 |
| 1128 |
| 1129 /** Not documented yet. */ |
| 1130 class QuestMilestonesResourceApi { |
| 1131 final common_internal.ApiRequester _requester; |
| 1132 |
| 1133 QuestMilestonesResourceApi(common_internal.ApiRequester client) : |
| 1134 _requester = client; |
| 1135 |
| 1136 /** |
| 1137 * Report that a reward for the milestone corresponding to milestoneId for the |
| 1138 * quest corresponding to questId has been claimed by the currently authorized |
| 1139 * user. |
| 1140 * |
| 1141 * Request parameters: |
| 1142 * |
| 1143 * [questId] - The ID of the quest. |
| 1144 * |
| 1145 * [milestoneId] - The ID of the milestone. |
| 1146 * |
| 1147 * [requestId] - A numeric ID to ensure that the request is handled correctly |
| 1148 * across retries. Your client application must generate this ID randomly. |
| 1149 * |
| 1150 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1151 * error. |
| 1152 * |
| 1153 * If the used [http.Client] completes with an error when making a REST call, |
| 1154 * this method will complete with the same error. |
| 1155 */ |
| 1156 async.Future claim(core.String questId, core.String milestoneId, core.String r
equestId) { |
| 1157 var _url = null; |
| 1158 var _queryParams = new core.Map(); |
| 1159 var _uploadMedia = null; |
| 1160 var _uploadOptions = null; |
| 1161 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1162 var _body = null; |
| 1163 |
| 1164 if (questId == null) { |
| 1165 throw new core.ArgumentError("Parameter questId is required."); |
| 1166 } |
| 1167 if (milestoneId == null) { |
| 1168 throw new core.ArgumentError("Parameter milestoneId is required."); |
| 1169 } |
| 1170 if (requestId == null) { |
| 1171 throw new core.ArgumentError("Parameter requestId is required."); |
| 1172 } |
| 1173 _queryParams["requestId"] = [requestId]; |
| 1174 |
| 1175 _downloadOptions = null; |
| 1176 |
| 1177 _url = 'quests/' + common_internal.Escaper.ecapeVariable('$questId') + '/mil
estones/' + common_internal.Escaper.ecapeVariable('$milestoneId') + '/claim'; |
| 1178 |
| 1179 var _response = _requester.request(_url, |
| 1180 "PUT", |
| 1181 body: _body, |
| 1182 queryParams: _queryParams, |
| 1183 uploadOptions: _uploadOptions, |
| 1184 uploadMedia: _uploadMedia, |
| 1185 downloadOptions: _downloadOptions); |
| 1186 return _response.then((data) => null); |
| 1187 } |
| 1188 |
| 1189 } |
| 1190 |
| 1191 |
| 1192 /** Not documented yet. */ |
| 1193 class QuestsResourceApi { |
| 1194 final common_internal.ApiRequester _requester; |
| 1195 |
| 1196 QuestsResourceApi(common_internal.ApiRequester client) : |
| 1197 _requester = client; |
| 1198 |
| 1199 /** |
| 1200 * Indicates that the currently authorized user will participate in the quest. |
| 1201 * |
| 1202 * Request parameters: |
| 1203 * |
| 1204 * [questId] - The ID of the quest. |
| 1205 * |
| 1206 * [language] - The preferred language to use for strings returned by this |
| 1207 * method. |
| 1208 * |
| 1209 * Completes with a [Quest]. |
| 1210 * |
| 1211 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1212 * error. |
| 1213 * |
| 1214 * If the used [http.Client] completes with an error when making a REST call, |
| 1215 * this method will complete with the same error. |
| 1216 */ |
| 1217 async.Future<Quest> accept(core.String questId, {core.String language}) { |
| 1218 var _url = null; |
| 1219 var _queryParams = new core.Map(); |
| 1220 var _uploadMedia = null; |
| 1221 var _uploadOptions = null; |
| 1222 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1223 var _body = null; |
| 1224 |
| 1225 if (questId == null) { |
| 1226 throw new core.ArgumentError("Parameter questId is required."); |
| 1227 } |
| 1228 if (language != null) { |
| 1229 _queryParams["language"] = [language]; |
| 1230 } |
| 1231 |
| 1232 |
| 1233 _url = 'quests/' + common_internal.Escaper.ecapeVariable('$questId') + '/acc
ept'; |
| 1234 |
| 1235 var _response = _requester.request(_url, |
| 1236 "POST", |
| 1237 body: _body, |
| 1238 queryParams: _queryParams, |
| 1239 uploadOptions: _uploadOptions, |
| 1240 uploadMedia: _uploadMedia, |
| 1241 downloadOptions: _downloadOptions); |
| 1242 return _response.then((data) => new Quest.fromJson(data)); |
| 1243 } |
| 1244 |
| 1245 /** |
| 1246 * Get a list of quests for your application and the currently authenticated |
| 1247 * player. |
| 1248 * |
| 1249 * Request parameters: |
| 1250 * |
| 1251 * [playerId] - A player ID. A value of me may be used in place of the |
| 1252 * authenticated player's ID. |
| 1253 * |
| 1254 * [language] - The preferred language to use for strings returned by this |
| 1255 * method. |
| 1256 * |
| 1257 * [maxResults] - The maximum number of quest resources to return in the |
| 1258 * response, used for paging. For any response, the actual number of quest |
| 1259 * resources returned may be less than the specified maxResults. Acceptable |
| 1260 * values are 1 to 50, inclusive. (Default: 50). |
| 1261 * Value must be between "1" and "50". |
| 1262 * |
| 1263 * [pageToken] - The token returned by the previous request. |
| 1264 * |
| 1265 * Completes with a [QuestListResponse]. |
| 1266 * |
| 1267 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1268 * error. |
| 1269 * |
| 1270 * If the used [http.Client] completes with an error when making a REST call, |
| 1271 * this method will complete with the same error. |
| 1272 */ |
| 1273 async.Future<QuestListResponse> list(core.String playerId, {core.String langua
ge, core.int maxResults, core.String pageToken}) { |
| 1274 var _url = null; |
| 1275 var _queryParams = new core.Map(); |
| 1276 var _uploadMedia = null; |
| 1277 var _uploadOptions = null; |
| 1278 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1279 var _body = null; |
| 1280 |
| 1281 if (playerId == null) { |
| 1282 throw new core.ArgumentError("Parameter playerId is required."); |
| 1283 } |
| 1284 if (language != null) { |
| 1285 _queryParams["language"] = [language]; |
| 1286 } |
| 1287 if (maxResults != null) { |
| 1288 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1289 } |
| 1290 if (pageToken != null) { |
| 1291 _queryParams["pageToken"] = [pageToken]; |
| 1292 } |
| 1293 |
| 1294 |
| 1295 _url = 'players/' + common_internal.Escaper.ecapeVariable('$playerId') + '/q
uests'; |
| 1296 |
| 1297 var _response = _requester.request(_url, |
| 1298 "GET", |
| 1299 body: _body, |
| 1300 queryParams: _queryParams, |
| 1301 uploadOptions: _uploadOptions, |
| 1302 uploadMedia: _uploadMedia, |
| 1303 downloadOptions: _downloadOptions); |
| 1304 return _response.then((data) => new QuestListResponse.fromJson(data)); |
| 1305 } |
| 1306 |
| 1307 } |
| 1308 |
| 1309 |
| 1310 /** Not documented yet. */ |
| 1311 class RevisionsResourceApi { |
| 1312 final common_internal.ApiRequester _requester; |
| 1313 |
| 1314 RevisionsResourceApi(common_internal.ApiRequester client) : |
| 1315 _requester = client; |
| 1316 |
| 1317 /** |
| 1318 * Checks whether the games client is out of date. |
| 1319 * |
| 1320 * Request parameters: |
| 1321 * |
| 1322 * [clientRevision] - The revision of the client SDK used by your application. |
| 1323 * Format: |
| 1324 * [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: |
| 1325 * |
| 1326 * - "ANDROID" - Client is running the Android SDK. |
| 1327 * - "IOS" - Client is running the iOS SDK. |
| 1328 * - "WEB_APP" - Client is running as a Web App. |
| 1329 * |
| 1330 * Completes with a [RevisionCheckResponse]. |
| 1331 * |
| 1332 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1333 * error. |
| 1334 * |
| 1335 * If the used [http.Client] completes with an error when making a REST call, |
| 1336 * this method will complete with the same error. |
| 1337 */ |
| 1338 async.Future<RevisionCheckResponse> check(core.String clientRevision) { |
| 1339 var _url = null; |
| 1340 var _queryParams = new core.Map(); |
| 1341 var _uploadMedia = null; |
| 1342 var _uploadOptions = null; |
| 1343 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1344 var _body = null; |
| 1345 |
| 1346 if (clientRevision == null) { |
| 1347 throw new core.ArgumentError("Parameter clientRevision is required."); |
| 1348 } |
| 1349 _queryParams["clientRevision"] = [clientRevision]; |
| 1350 |
| 1351 |
| 1352 _url = 'revisions/check'; |
| 1353 |
| 1354 var _response = _requester.request(_url, |
| 1355 "GET", |
| 1356 body: _body, |
| 1357 queryParams: _queryParams, |
| 1358 uploadOptions: _uploadOptions, |
| 1359 uploadMedia: _uploadMedia, |
| 1360 downloadOptions: _downloadOptions); |
| 1361 return _response.then((data) => new RevisionCheckResponse.fromJson(data)); |
| 1362 } |
| 1363 |
| 1364 } |
| 1365 |
| 1366 |
| 1367 /** Not documented yet. */ |
| 1368 class RoomsResourceApi { |
| 1369 final common_internal.ApiRequester _requester; |
| 1370 |
| 1371 RoomsResourceApi(common_internal.ApiRequester client) : |
| 1372 _requester = client; |
| 1373 |
| 1374 /** |
| 1375 * Create a room. For internal use by the Games SDK only. Calling this method |
| 1376 * directly is unsupported. |
| 1377 * |
| 1378 * [request] - The metadata request object. |
| 1379 * |
| 1380 * Request parameters: |
| 1381 * |
| 1382 * [language] - The preferred language to use for strings returned by this |
| 1383 * method. |
| 1384 * |
| 1385 * Completes with a [Room]. |
| 1386 * |
| 1387 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1388 * error. |
| 1389 * |
| 1390 * If the used [http.Client] completes with an error when making a REST call, |
| 1391 * this method will complete with the same error. |
| 1392 */ |
| 1393 async.Future<Room> create(RoomCreateRequest request, {core.String language}) { |
| 1394 var _url = null; |
| 1395 var _queryParams = new core.Map(); |
| 1396 var _uploadMedia = null; |
| 1397 var _uploadOptions = null; |
| 1398 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1399 var _body = null; |
| 1400 |
| 1401 if (request != null) { |
| 1402 _body = convert.JSON.encode((request).toJson()); |
| 1403 } |
| 1404 if (language != null) { |
| 1405 _queryParams["language"] = [language]; |
| 1406 } |
| 1407 |
| 1408 |
| 1409 _url = 'rooms/create'; |
| 1410 |
| 1411 var _response = _requester.request(_url, |
| 1412 "POST", |
| 1413 body: _body, |
| 1414 queryParams: _queryParams, |
| 1415 uploadOptions: _uploadOptions, |
| 1416 uploadMedia: _uploadMedia, |
| 1417 downloadOptions: _downloadOptions); |
| 1418 return _response.then((data) => new Room.fromJson(data)); |
| 1419 } |
| 1420 |
| 1421 /** |
| 1422 * Decline an invitation to join a room. For internal use by the Games SDK |
| 1423 * only. Calling this method directly is unsupported. |
| 1424 * |
| 1425 * Request parameters: |
| 1426 * |
| 1427 * [roomId] - The ID of the room. |
| 1428 * |
| 1429 * [language] - The preferred language to use for strings returned by this |
| 1430 * method. |
| 1431 * |
| 1432 * Completes with a [Room]. |
| 1433 * |
| 1434 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1435 * error. |
| 1436 * |
| 1437 * If the used [http.Client] completes with an error when making a REST call, |
| 1438 * this method will complete with the same error. |
| 1439 */ |
| 1440 async.Future<Room> decline(core.String roomId, {core.String language}) { |
| 1441 var _url = null; |
| 1442 var _queryParams = new core.Map(); |
| 1443 var _uploadMedia = null; |
| 1444 var _uploadOptions = null; |
| 1445 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1446 var _body = null; |
| 1447 |
| 1448 if (roomId == null) { |
| 1449 throw new core.ArgumentError("Parameter roomId is required."); |
| 1450 } |
| 1451 if (language != null) { |
| 1452 _queryParams["language"] = [language]; |
| 1453 } |
| 1454 |
| 1455 |
| 1456 _url = 'rooms/' + common_internal.Escaper.ecapeVariable('$roomId') + '/decli
ne'; |
| 1457 |
| 1458 var _response = _requester.request(_url, |
| 1459 "POST", |
| 1460 body: _body, |
| 1461 queryParams: _queryParams, |
| 1462 uploadOptions: _uploadOptions, |
| 1463 uploadMedia: _uploadMedia, |
| 1464 downloadOptions: _downloadOptions); |
| 1465 return _response.then((data) => new Room.fromJson(data)); |
| 1466 } |
| 1467 |
| 1468 /** |
| 1469 * Dismiss an invitation to join a room. For internal use by the Games SDK |
| 1470 * only. Calling this method directly is unsupported. |
| 1471 * |
| 1472 * Request parameters: |
| 1473 * |
| 1474 * [roomId] - The ID of the room. |
| 1475 * |
| 1476 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1477 * error. |
| 1478 * |
| 1479 * If the used [http.Client] completes with an error when making a REST call, |
| 1480 * this method will complete with the same error. |
| 1481 */ |
| 1482 async.Future dismiss(core.String roomId) { |
| 1483 var _url = null; |
| 1484 var _queryParams = new core.Map(); |
| 1485 var _uploadMedia = null; |
| 1486 var _uploadOptions = null; |
| 1487 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1488 var _body = null; |
| 1489 |
| 1490 if (roomId == null) { |
| 1491 throw new core.ArgumentError("Parameter roomId is required."); |
| 1492 } |
| 1493 |
| 1494 _downloadOptions = null; |
| 1495 |
| 1496 _url = 'rooms/' + common_internal.Escaper.ecapeVariable('$roomId') + '/dismi
ss'; |
| 1497 |
| 1498 var _response = _requester.request(_url, |
| 1499 "POST", |
| 1500 body: _body, |
| 1501 queryParams: _queryParams, |
| 1502 uploadOptions: _uploadOptions, |
| 1503 uploadMedia: _uploadMedia, |
| 1504 downloadOptions: _downloadOptions); |
| 1505 return _response.then((data) => null); |
| 1506 } |
| 1507 |
| 1508 /** |
| 1509 * Get the data for a room. |
| 1510 * |
| 1511 * Request parameters: |
| 1512 * |
| 1513 * [roomId] - The ID of the room. |
| 1514 * |
| 1515 * [language] - The preferred language to use for strings returned by this |
| 1516 * method. |
| 1517 * |
| 1518 * Completes with a [Room]. |
| 1519 * |
| 1520 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1521 * error. |
| 1522 * |
| 1523 * If the used [http.Client] completes with an error when making a REST call, |
| 1524 * this method will complete with the same error. |
| 1525 */ |
| 1526 async.Future<Room> get(core.String roomId, {core.String language}) { |
| 1527 var _url = null; |
| 1528 var _queryParams = new core.Map(); |
| 1529 var _uploadMedia = null; |
| 1530 var _uploadOptions = null; |
| 1531 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1532 var _body = null; |
| 1533 |
| 1534 if (roomId == null) { |
| 1535 throw new core.ArgumentError("Parameter roomId is required."); |
| 1536 } |
| 1537 if (language != null) { |
| 1538 _queryParams["language"] = [language]; |
| 1539 } |
| 1540 |
| 1541 |
| 1542 _url = 'rooms/' + common_internal.Escaper.ecapeVariable('$roomId'); |
| 1543 |
| 1544 var _response = _requester.request(_url, |
| 1545 "GET", |
| 1546 body: _body, |
| 1547 queryParams: _queryParams, |
| 1548 uploadOptions: _uploadOptions, |
| 1549 uploadMedia: _uploadMedia, |
| 1550 downloadOptions: _downloadOptions); |
| 1551 return _response.then((data) => new Room.fromJson(data)); |
| 1552 } |
| 1553 |
| 1554 /** |
| 1555 * Join a room. For internal use by the Games SDK only. Calling this method |
| 1556 * directly is unsupported. |
| 1557 * |
| 1558 * [request] - The metadata request object. |
| 1559 * |
| 1560 * Request parameters: |
| 1561 * |
| 1562 * [roomId] - The ID of the room. |
| 1563 * |
| 1564 * [language] - The preferred language to use for strings returned by this |
| 1565 * method. |
| 1566 * |
| 1567 * Completes with a [Room]. |
| 1568 * |
| 1569 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1570 * error. |
| 1571 * |
| 1572 * If the used [http.Client] completes with an error when making a REST call, |
| 1573 * this method will complete with the same error. |
| 1574 */ |
| 1575 async.Future<Room> join(RoomJoinRequest request, core.String roomId, {core.Str
ing language}) { |
| 1576 var _url = null; |
| 1577 var _queryParams = new core.Map(); |
| 1578 var _uploadMedia = null; |
| 1579 var _uploadOptions = null; |
| 1580 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1581 var _body = null; |
| 1582 |
| 1583 if (request != null) { |
| 1584 _body = convert.JSON.encode((request).toJson()); |
| 1585 } |
| 1586 if (roomId == null) { |
| 1587 throw new core.ArgumentError("Parameter roomId is required."); |
| 1588 } |
| 1589 if (language != null) { |
| 1590 _queryParams["language"] = [language]; |
| 1591 } |
| 1592 |
| 1593 |
| 1594 _url = 'rooms/' + common_internal.Escaper.ecapeVariable('$roomId') + '/join'
; |
| 1595 |
| 1596 var _response = _requester.request(_url, |
| 1597 "POST", |
| 1598 body: _body, |
| 1599 queryParams: _queryParams, |
| 1600 uploadOptions: _uploadOptions, |
| 1601 uploadMedia: _uploadMedia, |
| 1602 downloadOptions: _downloadOptions); |
| 1603 return _response.then((data) => new Room.fromJson(data)); |
| 1604 } |
| 1605 |
| 1606 /** |
| 1607 * Leave a room. For internal use by the Games SDK only. Calling this method |
| 1608 * directly is unsupported. |
| 1609 * |
| 1610 * [request] - The metadata request object. |
| 1611 * |
| 1612 * Request parameters: |
| 1613 * |
| 1614 * [roomId] - The ID of the room. |
| 1615 * |
| 1616 * [language] - The preferred language to use for strings returned by this |
| 1617 * method. |
| 1618 * |
| 1619 * Completes with a [Room]. |
| 1620 * |
| 1621 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1622 * error. |
| 1623 * |
| 1624 * If the used [http.Client] completes with an error when making a REST call, |
| 1625 * this method will complete with the same error. |
| 1626 */ |
| 1627 async.Future<Room> leave(RoomLeaveRequest request, core.String roomId, {core.S
tring language}) { |
| 1628 var _url = null; |
| 1629 var _queryParams = new core.Map(); |
| 1630 var _uploadMedia = null; |
| 1631 var _uploadOptions = null; |
| 1632 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1633 var _body = null; |
| 1634 |
| 1635 if (request != null) { |
| 1636 _body = convert.JSON.encode((request).toJson()); |
| 1637 } |
| 1638 if (roomId == null) { |
| 1639 throw new core.ArgumentError("Parameter roomId is required."); |
| 1640 } |
| 1641 if (language != null) { |
| 1642 _queryParams["language"] = [language]; |
| 1643 } |
| 1644 |
| 1645 |
| 1646 _url = 'rooms/' + common_internal.Escaper.ecapeVariable('$roomId') + '/leave
'; |
| 1647 |
| 1648 var _response = _requester.request(_url, |
| 1649 "POST", |
| 1650 body: _body, |
| 1651 queryParams: _queryParams, |
| 1652 uploadOptions: _uploadOptions, |
| 1653 uploadMedia: _uploadMedia, |
| 1654 downloadOptions: _downloadOptions); |
| 1655 return _response.then((data) => new Room.fromJson(data)); |
| 1656 } |
| 1657 |
| 1658 /** |
| 1659 * Returns invitations to join rooms. |
| 1660 * |
| 1661 * Request parameters: |
| 1662 * |
| 1663 * [language] - The preferred language to use for strings returned by this |
| 1664 * method. |
| 1665 * |
| 1666 * [maxResults] - The maximum number of rooms to return in the response, used |
| 1667 * for paging. For any response, the actual number of rooms to return may be |
| 1668 * less than the specified maxResults. |
| 1669 * Value must be between "1" and "500". |
| 1670 * |
| 1671 * [pageToken] - The token returned by the previous request. |
| 1672 * |
| 1673 * Completes with a [RoomList]. |
| 1674 * |
| 1675 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1676 * error. |
| 1677 * |
| 1678 * If the used [http.Client] completes with an error when making a REST call, |
| 1679 * this method will complete with the same error. |
| 1680 */ |
| 1681 async.Future<RoomList> list({core.String language, core.int maxResults, core.S
tring pageToken}) { |
| 1682 var _url = null; |
| 1683 var _queryParams = new core.Map(); |
| 1684 var _uploadMedia = null; |
| 1685 var _uploadOptions = null; |
| 1686 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1687 var _body = null; |
| 1688 |
| 1689 if (language != null) { |
| 1690 _queryParams["language"] = [language]; |
| 1691 } |
| 1692 if (maxResults != null) { |
| 1693 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1694 } |
| 1695 if (pageToken != null) { |
| 1696 _queryParams["pageToken"] = [pageToken]; |
| 1697 } |
| 1698 |
| 1699 |
| 1700 _url = 'rooms'; |
| 1701 |
| 1702 var _response = _requester.request(_url, |
| 1703 "GET", |
| 1704 body: _body, |
| 1705 queryParams: _queryParams, |
| 1706 uploadOptions: _uploadOptions, |
| 1707 uploadMedia: _uploadMedia, |
| 1708 downloadOptions: _downloadOptions); |
| 1709 return _response.then((data) => new RoomList.fromJson(data)); |
| 1710 } |
| 1711 |
| 1712 /** |
| 1713 * Updates sent by a client reporting the status of peers in a room. For |
| 1714 * internal use by the Games SDK only. Calling this method directly is |
| 1715 * unsupported. |
| 1716 * |
| 1717 * [request] - The metadata request object. |
| 1718 * |
| 1719 * Request parameters: |
| 1720 * |
| 1721 * [roomId] - The ID of the room. |
| 1722 * |
| 1723 * [language] - The preferred language to use for strings returned by this |
| 1724 * method. |
| 1725 * |
| 1726 * Completes with a [RoomStatus]. |
| 1727 * |
| 1728 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1729 * error. |
| 1730 * |
| 1731 * If the used [http.Client] completes with an error when making a REST call, |
| 1732 * this method will complete with the same error. |
| 1733 */ |
| 1734 async.Future<RoomStatus> reportStatus(RoomP2PStatuses request, core.String roo
mId, {core.String language}) { |
| 1735 var _url = null; |
| 1736 var _queryParams = new core.Map(); |
| 1737 var _uploadMedia = null; |
| 1738 var _uploadOptions = null; |
| 1739 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1740 var _body = null; |
| 1741 |
| 1742 if (request != null) { |
| 1743 _body = convert.JSON.encode((request).toJson()); |
| 1744 } |
| 1745 if (roomId == null) { |
| 1746 throw new core.ArgumentError("Parameter roomId is required."); |
| 1747 } |
| 1748 if (language != null) { |
| 1749 _queryParams["language"] = [language]; |
| 1750 } |
| 1751 |
| 1752 |
| 1753 _url = 'rooms/' + common_internal.Escaper.ecapeVariable('$roomId') + '/repor
tstatus'; |
| 1754 |
| 1755 var _response = _requester.request(_url, |
| 1756 "POST", |
| 1757 body: _body, |
| 1758 queryParams: _queryParams, |
| 1759 uploadOptions: _uploadOptions, |
| 1760 uploadMedia: _uploadMedia, |
| 1761 downloadOptions: _downloadOptions); |
| 1762 return _response.then((data) => new RoomStatus.fromJson(data)); |
| 1763 } |
| 1764 |
| 1765 } |
| 1766 |
| 1767 |
| 1768 /** Not documented yet. */ |
| 1769 class ScoresResourceApi { |
| 1770 final common_internal.ApiRequester _requester; |
| 1771 |
| 1772 ScoresResourceApi(common_internal.ApiRequester client) : |
| 1773 _requester = client; |
| 1774 |
| 1775 /** |
| 1776 * Get high scores, and optionally ranks, in leaderboards for the currently |
| 1777 * authenticated player. For a specific time span, leaderboardId can be set to |
| 1778 * ALL to retrieve data for all leaderboards in a given time span. |
| 1779 * NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same |
| 1780 * request; only one parameter may be set to 'ALL'. |
| 1781 * |
| 1782 * Request parameters: |
| 1783 * |
| 1784 * [playerId] - A player ID. A value of me may be used in place of the |
| 1785 * authenticated player's ID. |
| 1786 * |
| 1787 * [leaderboardId] - The ID of the leaderboard. Can be set to 'ALL' to |
| 1788 * retrieve data for all leaderboards for this application. |
| 1789 * |
| 1790 * [timeSpan] - The time span for the scores and ranks you're requesting. |
| 1791 * Possible string values are: |
| 1792 * - "ALL" : Get the high scores for all time spans. If this is used, |
| 1793 * maxResults values will be ignored. |
| 1794 * - "ALL_TIME" : Get the all time high score. |
| 1795 * - "DAILY" : List the top scores for the current day. |
| 1796 * - "WEEKLY" : List the top scores for the current week. |
| 1797 * |
| 1798 * [includeRankType] - The types of ranks to return. If the parameter is |
| 1799 * omitted, no ranks will be returned. |
| 1800 * Possible string values are: |
| 1801 * - "ALL" : Retrieve public and social ranks. |
| 1802 * - "PUBLIC" : Retrieve public ranks, if the player is sharing their gameplay |
| 1803 * activity publicly. |
| 1804 * - "SOCIAL" : Retrieve the social rank. |
| 1805 * |
| 1806 * [language] - The preferred language to use for strings returned by this |
| 1807 * method. |
| 1808 * |
| 1809 * [maxResults] - The maximum number of leaderboard scores to return in the |
| 1810 * response. For any response, the actual number of leaderboard scores |
| 1811 * returned may be less than the specified maxResults. |
| 1812 * Value must be between "1" and "25". |
| 1813 * |
| 1814 * [pageToken] - The token returned by the previous request. |
| 1815 * |
| 1816 * Completes with a [PlayerLeaderboardScoreListResponse]. |
| 1817 * |
| 1818 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1819 * error. |
| 1820 * |
| 1821 * If the used [http.Client] completes with an error when making a REST call, |
| 1822 * this method will complete with the same error. |
| 1823 */ |
| 1824 async.Future<PlayerLeaderboardScoreListResponse> get(core.String playerId, cor
e.String leaderboardId, core.String timeSpan, {core.String includeRankType, core
.String language, core.int maxResults, core.String pageToken}) { |
| 1825 var _url = null; |
| 1826 var _queryParams = new core.Map(); |
| 1827 var _uploadMedia = null; |
| 1828 var _uploadOptions = null; |
| 1829 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1830 var _body = null; |
| 1831 |
| 1832 if (playerId == null) { |
| 1833 throw new core.ArgumentError("Parameter playerId is required."); |
| 1834 } |
| 1835 if (leaderboardId == null) { |
| 1836 throw new core.ArgumentError("Parameter leaderboardId is required."); |
| 1837 } |
| 1838 if (timeSpan == null) { |
| 1839 throw new core.ArgumentError("Parameter timeSpan is required."); |
| 1840 } |
| 1841 if (includeRankType != null) { |
| 1842 _queryParams["includeRankType"] = [includeRankType]; |
| 1843 } |
| 1844 if (language != null) { |
| 1845 _queryParams["language"] = [language]; |
| 1846 } |
| 1847 if (maxResults != null) { |
| 1848 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1849 } |
| 1850 if (pageToken != null) { |
| 1851 _queryParams["pageToken"] = [pageToken]; |
| 1852 } |
| 1853 |
| 1854 |
| 1855 _url = 'players/' + common_internal.Escaper.ecapeVariable('$playerId') + '/l
eaderboards/' + common_internal.Escaper.ecapeVariable('$leaderboardId') + '/scor
es/' + common_internal.Escaper.ecapeVariable('$timeSpan'); |
| 1856 |
| 1857 var _response = _requester.request(_url, |
| 1858 "GET", |
| 1859 body: _body, |
| 1860 queryParams: _queryParams, |
| 1861 uploadOptions: _uploadOptions, |
| 1862 uploadMedia: _uploadMedia, |
| 1863 downloadOptions: _downloadOptions); |
| 1864 return _response.then((data) => new PlayerLeaderboardScoreListResponse.fromJ
son(data)); |
| 1865 } |
| 1866 |
| 1867 /** |
| 1868 * Lists the scores in a leaderboard, starting from the top. |
| 1869 * |
| 1870 * Request parameters: |
| 1871 * |
| 1872 * [leaderboardId] - The ID of the leaderboard. |
| 1873 * |
| 1874 * [collection] - The collection of scores you're requesting. |
| 1875 * Possible string values are: |
| 1876 * - "PUBLIC" : List all scores in the public leaderboard. |
| 1877 * - "SOCIAL" : List only social scores. |
| 1878 * |
| 1879 * [timeSpan] - The time span for the scores and ranks you're requesting. |
| 1880 * Possible string values are: |
| 1881 * - "ALL_TIME" : List the all-time top scores. |
| 1882 * - "DAILY" : List the top scores for the current day. |
| 1883 * - "WEEKLY" : List the top scores for the current week. |
| 1884 * |
| 1885 * [language] - The preferred language to use for strings returned by this |
| 1886 * method. |
| 1887 * |
| 1888 * [maxResults] - The maximum number of leaderboard scores to return in the |
| 1889 * response. For any response, the actual number of leaderboard scores |
| 1890 * returned may be less than the specified maxResults. |
| 1891 * Value must be between "1" and "25". |
| 1892 * |
| 1893 * [pageToken] - The token returned by the previous request. |
| 1894 * |
| 1895 * Completes with a [LeaderboardScores]. |
| 1896 * |
| 1897 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1898 * error. |
| 1899 * |
| 1900 * If the used [http.Client] completes with an error when making a REST call, |
| 1901 * this method will complete with the same error. |
| 1902 */ |
| 1903 async.Future<LeaderboardScores> list(core.String leaderboardId, core.String co
llection, core.String timeSpan, {core.String language, core.int maxResults, core
.String pageToken}) { |
| 1904 var _url = null; |
| 1905 var _queryParams = new core.Map(); |
| 1906 var _uploadMedia = null; |
| 1907 var _uploadOptions = null; |
| 1908 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1909 var _body = null; |
| 1910 |
| 1911 if (leaderboardId == null) { |
| 1912 throw new core.ArgumentError("Parameter leaderboardId is required."); |
| 1913 } |
| 1914 if (collection == null) { |
| 1915 throw new core.ArgumentError("Parameter collection is required."); |
| 1916 } |
| 1917 if (timeSpan == null) { |
| 1918 throw new core.ArgumentError("Parameter timeSpan is required."); |
| 1919 } |
| 1920 _queryParams["timeSpan"] = [timeSpan]; |
| 1921 if (language != null) { |
| 1922 _queryParams["language"] = [language]; |
| 1923 } |
| 1924 if (maxResults != null) { |
| 1925 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1926 } |
| 1927 if (pageToken != null) { |
| 1928 _queryParams["pageToken"] = [pageToken]; |
| 1929 } |
| 1930 |
| 1931 |
| 1932 _url = 'leaderboards/' + common_internal.Escaper.ecapeVariable('$leaderboard
Id') + '/scores/' + common_internal.Escaper.ecapeVariable('$collection'); |
| 1933 |
| 1934 var _response = _requester.request(_url, |
| 1935 "GET", |
| 1936 body: _body, |
| 1937 queryParams: _queryParams, |
| 1938 uploadOptions: _uploadOptions, |
| 1939 uploadMedia: _uploadMedia, |
| 1940 downloadOptions: _downloadOptions); |
| 1941 return _response.then((data) => new LeaderboardScores.fromJson(data)); |
| 1942 } |
| 1943 |
| 1944 /** |
| 1945 * Lists the scores in a leaderboard around (and including) a player's score. |
| 1946 * |
| 1947 * Request parameters: |
| 1948 * |
| 1949 * [leaderboardId] - The ID of the leaderboard. |
| 1950 * |
| 1951 * [collection] - The collection of scores you're requesting. |
| 1952 * Possible string values are: |
| 1953 * - "PUBLIC" : List all scores in the public leaderboard. |
| 1954 * - "SOCIAL" : List only social scores. |
| 1955 * |
| 1956 * [timeSpan] - The time span for the scores and ranks you're requesting. |
| 1957 * Possible string values are: |
| 1958 * - "ALL_TIME" : List the all-time top scores. |
| 1959 * - "DAILY" : List the top scores for the current day. |
| 1960 * - "WEEKLY" : List the top scores for the current week. |
| 1961 * |
| 1962 * [language] - The preferred language to use for strings returned by this |
| 1963 * method. |
| 1964 * |
| 1965 * [maxResults] - The maximum number of leaderboard scores to return in the |
| 1966 * response. For any response, the actual number of leaderboard scores |
| 1967 * returned may be less than the specified maxResults. |
| 1968 * Value must be between "1" and "25". |
| 1969 * |
| 1970 * [pageToken] - The token returned by the previous request. |
| 1971 * |
| 1972 * [resultsAbove] - The preferred number of scores to return above the |
| 1973 * player's score. More scores may be returned if the player is at the bottom |
| 1974 * of the leaderboard; fewer may be returned if the player is at the top. Must |
| 1975 * be less than or equal to maxResults. |
| 1976 * |
| 1977 * [returnTopIfAbsent] - True if the top scores should be returned when the |
| 1978 * player is not in the leaderboard. Defaults to true. |
| 1979 * |
| 1980 * Completes with a [LeaderboardScores]. |
| 1981 * |
| 1982 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1983 * error. |
| 1984 * |
| 1985 * If the used [http.Client] completes with an error when making a REST call, |
| 1986 * this method will complete with the same error. |
| 1987 */ |
| 1988 async.Future<LeaderboardScores> listWindow(core.String leaderboardId, core.Str
ing collection, core.String timeSpan, {core.String language, core.int maxResults
, core.String pageToken, core.int resultsAbove, core.bool returnTopIfAbsent}) { |
| 1989 var _url = null; |
| 1990 var _queryParams = new core.Map(); |
| 1991 var _uploadMedia = null; |
| 1992 var _uploadOptions = null; |
| 1993 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1994 var _body = null; |
| 1995 |
| 1996 if (leaderboardId == null) { |
| 1997 throw new core.ArgumentError("Parameter leaderboardId is required."); |
| 1998 } |
| 1999 if (collection == null) { |
| 2000 throw new core.ArgumentError("Parameter collection is required."); |
| 2001 } |
| 2002 if (timeSpan == null) { |
| 2003 throw new core.ArgumentError("Parameter timeSpan is required."); |
| 2004 } |
| 2005 _queryParams["timeSpan"] = [timeSpan]; |
| 2006 if (language != null) { |
| 2007 _queryParams["language"] = [language]; |
| 2008 } |
| 2009 if (maxResults != null) { |
| 2010 _queryParams["maxResults"] = ["${maxResults}"]; |
| 2011 } |
| 2012 if (pageToken != null) { |
| 2013 _queryParams["pageToken"] = [pageToken]; |
| 2014 } |
| 2015 if (resultsAbove != null) { |
| 2016 _queryParams["resultsAbove"] = ["${resultsAbove}"]; |
| 2017 } |
| 2018 if (returnTopIfAbsent != null) { |
| 2019 _queryParams["returnTopIfAbsent"] = ["${returnTopIfAbsent}"]; |
| 2020 } |
| 2021 |
| 2022 |
| 2023 _url = 'leaderboards/' + common_internal.Escaper.ecapeVariable('$leaderboard
Id') + '/window/' + common_internal.Escaper.ecapeVariable('$collection'); |
| 2024 |
| 2025 var _response = _requester.request(_url, |
| 2026 "GET", |
| 2027 body: _body, |
| 2028 queryParams: _queryParams, |
| 2029 uploadOptions: _uploadOptions, |
| 2030 uploadMedia: _uploadMedia, |
| 2031 downloadOptions: _downloadOptions); |
| 2032 return _response.then((data) => new LeaderboardScores.fromJson(data)); |
| 2033 } |
| 2034 |
| 2035 /** |
| 2036 * Submits a score to the specified leaderboard. |
| 2037 * |
| 2038 * Request parameters: |
| 2039 * |
| 2040 * [leaderboardId] - The ID of the leaderboard. |
| 2041 * |
| 2042 * [score] - The score you're submitting. The submitted score is ignored if it |
| 2043 * is worse than a previously submitted score, where worse depends on the |
| 2044 * leaderboard sort order. The meaning of the score value depends on the |
| 2045 * leaderboard format type. For fixed-point, the score represents the raw |
| 2046 * value. For time, the score represents elapsed time in milliseconds. For |
| 2047 * currency, the score represents a value in micro units. |
| 2048 * |
| 2049 * [language] - The preferred language to use for strings returned by this |
| 2050 * method. |
| 2051 * |
| 2052 * [scoreTag] - Additional information about the score you're submitting. |
| 2053 * Values must contain no more than 64 URI-safe characters as defined by |
| 2054 * section 2.3 of RFC 3986. |
| 2055 * Value must have pattern "[a-zA-Z0-9-._~]{0,64}". |
| 2056 * |
| 2057 * Completes with a [PlayerScoreResponse]. |
| 2058 * |
| 2059 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2060 * error. |
| 2061 * |
| 2062 * If the used [http.Client] completes with an error when making a REST call, |
| 2063 * this method will complete with the same error. |
| 2064 */ |
| 2065 async.Future<PlayerScoreResponse> submit(core.String leaderboardId, core.Strin
g score, {core.String language, core.String scoreTag}) { |
| 2066 var _url = null; |
| 2067 var _queryParams = new core.Map(); |
| 2068 var _uploadMedia = null; |
| 2069 var _uploadOptions = null; |
| 2070 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2071 var _body = null; |
| 2072 |
| 2073 if (leaderboardId == null) { |
| 2074 throw new core.ArgumentError("Parameter leaderboardId is required."); |
| 2075 } |
| 2076 if (score == null) { |
| 2077 throw new core.ArgumentError("Parameter score is required."); |
| 2078 } |
| 2079 _queryParams["score"] = [score]; |
| 2080 if (language != null) { |
| 2081 _queryParams["language"] = [language]; |
| 2082 } |
| 2083 if (scoreTag != null) { |
| 2084 _queryParams["scoreTag"] = [scoreTag]; |
| 2085 } |
| 2086 |
| 2087 |
| 2088 _url = 'leaderboards/' + common_internal.Escaper.ecapeVariable('$leaderboard
Id') + '/scores'; |
| 2089 |
| 2090 var _response = _requester.request(_url, |
| 2091 "POST", |
| 2092 body: _body, |
| 2093 queryParams: _queryParams, |
| 2094 uploadOptions: _uploadOptions, |
| 2095 uploadMedia: _uploadMedia, |
| 2096 downloadOptions: _downloadOptions); |
| 2097 return _response.then((data) => new PlayerScoreResponse.fromJson(data)); |
| 2098 } |
| 2099 |
| 2100 /** |
| 2101 * Submits multiple scores to leaderboards. |
| 2102 * |
| 2103 * [request] - The metadata request object. |
| 2104 * |
| 2105 * Request parameters: |
| 2106 * |
| 2107 * [language] - The preferred language to use for strings returned by this |
| 2108 * method. |
| 2109 * |
| 2110 * Completes with a [PlayerScoreListResponse]. |
| 2111 * |
| 2112 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2113 * error. |
| 2114 * |
| 2115 * If the used [http.Client] completes with an error when making a REST call, |
| 2116 * this method will complete with the same error. |
| 2117 */ |
| 2118 async.Future<PlayerScoreListResponse> submitMultiple(PlayerScoreSubmissionList
request, {core.String language}) { |
| 2119 var _url = null; |
| 2120 var _queryParams = new core.Map(); |
| 2121 var _uploadMedia = null; |
| 2122 var _uploadOptions = null; |
| 2123 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2124 var _body = null; |
| 2125 |
| 2126 if (request != null) { |
| 2127 _body = convert.JSON.encode((request).toJson()); |
| 2128 } |
| 2129 if (language != null) { |
| 2130 _queryParams["language"] = [language]; |
| 2131 } |
| 2132 |
| 2133 |
| 2134 _url = 'leaderboards/scores'; |
| 2135 |
| 2136 var _response = _requester.request(_url, |
| 2137 "POST", |
| 2138 body: _body, |
| 2139 queryParams: _queryParams, |
| 2140 uploadOptions: _uploadOptions, |
| 2141 uploadMedia: _uploadMedia, |
| 2142 downloadOptions: _downloadOptions); |
| 2143 return _response.then((data) => new PlayerScoreListResponse.fromJson(data)); |
| 2144 } |
| 2145 |
| 2146 } |
| 2147 |
| 2148 |
| 2149 /** Not documented yet. */ |
| 2150 class SnapshotsResourceApi { |
| 2151 final common_internal.ApiRequester _requester; |
| 2152 |
| 2153 SnapshotsResourceApi(common_internal.ApiRequester client) : |
| 2154 _requester = client; |
| 2155 |
| 2156 /** |
| 2157 * Retrieves the metadata for a given snapshot ID. |
| 2158 * |
| 2159 * Request parameters: |
| 2160 * |
| 2161 * [snapshotId] - The ID of the snapshot. |
| 2162 * |
| 2163 * [language] - The preferred language to use for strings returned by this |
| 2164 * method. |
| 2165 * |
| 2166 * Completes with a [Snapshot]. |
| 2167 * |
| 2168 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2169 * error. |
| 2170 * |
| 2171 * If the used [http.Client] completes with an error when making a REST call, |
| 2172 * this method will complete with the same error. |
| 2173 */ |
| 2174 async.Future<Snapshot> get(core.String snapshotId, {core.String language}) { |
| 2175 var _url = null; |
| 2176 var _queryParams = new core.Map(); |
| 2177 var _uploadMedia = null; |
| 2178 var _uploadOptions = null; |
| 2179 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2180 var _body = null; |
| 2181 |
| 2182 if (snapshotId == null) { |
| 2183 throw new core.ArgumentError("Parameter snapshotId is required."); |
| 2184 } |
| 2185 if (language != null) { |
| 2186 _queryParams["language"] = [language]; |
| 2187 } |
| 2188 |
| 2189 |
| 2190 _url = 'snapshots/' + common_internal.Escaper.ecapeVariable('$snapshotId'); |
| 2191 |
| 2192 var _response = _requester.request(_url, |
| 2193 "GET", |
| 2194 body: _body, |
| 2195 queryParams: _queryParams, |
| 2196 uploadOptions: _uploadOptions, |
| 2197 uploadMedia: _uploadMedia, |
| 2198 downloadOptions: _downloadOptions); |
| 2199 return _response.then((data) => new Snapshot.fromJson(data)); |
| 2200 } |
| 2201 |
| 2202 /** |
| 2203 * Retrieves a list of snapshots created by your application for the player |
| 2204 * corresponding to the player ID. |
| 2205 * |
| 2206 * Request parameters: |
| 2207 * |
| 2208 * [playerId] - A player ID. A value of me may be used in place of the |
| 2209 * authenticated player's ID. |
| 2210 * |
| 2211 * [language] - The preferred language to use for strings returned by this |
| 2212 * method. |
| 2213 * |
| 2214 * [maxResults] - The maximum number of snapshot resources to return in the |
| 2215 * response, used for paging. For any response, the actual number of snapshot |
| 2216 * resources returned may be less than the specified maxResults. |
| 2217 * Value must be between "1" and "25". |
| 2218 * |
| 2219 * [pageToken] - The token returned by the previous request. |
| 2220 * |
| 2221 * Completes with a [SnapshotListResponse]. |
| 2222 * |
| 2223 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2224 * error. |
| 2225 * |
| 2226 * If the used [http.Client] completes with an error when making a REST call, |
| 2227 * this method will complete with the same error. |
| 2228 */ |
| 2229 async.Future<SnapshotListResponse> list(core.String playerId, {core.String lan
guage, core.int maxResults, core.String pageToken}) { |
| 2230 var _url = null; |
| 2231 var _queryParams = new core.Map(); |
| 2232 var _uploadMedia = null; |
| 2233 var _uploadOptions = null; |
| 2234 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2235 var _body = null; |
| 2236 |
| 2237 if (playerId == null) { |
| 2238 throw new core.ArgumentError("Parameter playerId is required."); |
| 2239 } |
| 2240 if (language != null) { |
| 2241 _queryParams["language"] = [language]; |
| 2242 } |
| 2243 if (maxResults != null) { |
| 2244 _queryParams["maxResults"] = ["${maxResults}"]; |
| 2245 } |
| 2246 if (pageToken != null) { |
| 2247 _queryParams["pageToken"] = [pageToken]; |
| 2248 } |
| 2249 |
| 2250 |
| 2251 _url = 'players/' + common_internal.Escaper.ecapeVariable('$playerId') + '/s
napshots'; |
| 2252 |
| 2253 var _response = _requester.request(_url, |
| 2254 "GET", |
| 2255 body: _body, |
| 2256 queryParams: _queryParams, |
| 2257 uploadOptions: _uploadOptions, |
| 2258 uploadMedia: _uploadMedia, |
| 2259 downloadOptions: _downloadOptions); |
| 2260 return _response.then((data) => new SnapshotListResponse.fromJson(data)); |
| 2261 } |
| 2262 |
| 2263 } |
| 2264 |
| 2265 |
| 2266 /** Not documented yet. */ |
| 2267 class TurnBasedMatchesResourceApi { |
| 2268 final common_internal.ApiRequester _requester; |
| 2269 |
| 2270 TurnBasedMatchesResourceApi(common_internal.ApiRequester client) : |
| 2271 _requester = client; |
| 2272 |
| 2273 /** |
| 2274 * Cancel a turn-based match. |
| 2275 * |
| 2276 * Request parameters: |
| 2277 * |
| 2278 * [matchId] - The ID of the match. |
| 2279 * |
| 2280 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2281 * error. |
| 2282 * |
| 2283 * If the used [http.Client] completes with an error when making a REST call, |
| 2284 * this method will complete with the same error. |
| 2285 */ |
| 2286 async.Future cancel(core.String matchId) { |
| 2287 var _url = null; |
| 2288 var _queryParams = new core.Map(); |
| 2289 var _uploadMedia = null; |
| 2290 var _uploadOptions = null; |
| 2291 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2292 var _body = null; |
| 2293 |
| 2294 if (matchId == null) { |
| 2295 throw new core.ArgumentError("Parameter matchId is required."); |
| 2296 } |
| 2297 |
| 2298 _downloadOptions = null; |
| 2299 |
| 2300 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/cancel'; |
| 2301 |
| 2302 var _response = _requester.request(_url, |
| 2303 "PUT", |
| 2304 body: _body, |
| 2305 queryParams: _queryParams, |
| 2306 uploadOptions: _uploadOptions, |
| 2307 uploadMedia: _uploadMedia, |
| 2308 downloadOptions: _downloadOptions); |
| 2309 return _response.then((data) => null); |
| 2310 } |
| 2311 |
| 2312 /** |
| 2313 * Create a turn-based match. |
| 2314 * |
| 2315 * [request] - The metadata request object. |
| 2316 * |
| 2317 * Request parameters: |
| 2318 * |
| 2319 * [language] - The preferred language to use for strings returned by this |
| 2320 * method. |
| 2321 * |
| 2322 * Completes with a [TurnBasedMatch]. |
| 2323 * |
| 2324 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2325 * error. |
| 2326 * |
| 2327 * If the used [http.Client] completes with an error when making a REST call, |
| 2328 * this method will complete with the same error. |
| 2329 */ |
| 2330 async.Future<TurnBasedMatch> create(TurnBasedMatchCreateRequest request, {core
.String language}) { |
| 2331 var _url = null; |
| 2332 var _queryParams = new core.Map(); |
| 2333 var _uploadMedia = null; |
| 2334 var _uploadOptions = null; |
| 2335 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2336 var _body = null; |
| 2337 |
| 2338 if (request != null) { |
| 2339 _body = convert.JSON.encode((request).toJson()); |
| 2340 } |
| 2341 if (language != null) { |
| 2342 _queryParams["language"] = [language]; |
| 2343 } |
| 2344 |
| 2345 |
| 2346 _url = 'turnbasedmatches/create'; |
| 2347 |
| 2348 var _response = _requester.request(_url, |
| 2349 "POST", |
| 2350 body: _body, |
| 2351 queryParams: _queryParams, |
| 2352 uploadOptions: _uploadOptions, |
| 2353 uploadMedia: _uploadMedia, |
| 2354 downloadOptions: _downloadOptions); |
| 2355 return _response.then((data) => new TurnBasedMatch.fromJson(data)); |
| 2356 } |
| 2357 |
| 2358 /** |
| 2359 * Decline an invitation to play a turn-based match. |
| 2360 * |
| 2361 * Request parameters: |
| 2362 * |
| 2363 * [matchId] - The ID of the match. |
| 2364 * |
| 2365 * [language] - The preferred language to use for strings returned by this |
| 2366 * method. |
| 2367 * |
| 2368 * Completes with a [TurnBasedMatch]. |
| 2369 * |
| 2370 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2371 * error. |
| 2372 * |
| 2373 * If the used [http.Client] completes with an error when making a REST call, |
| 2374 * this method will complete with the same error. |
| 2375 */ |
| 2376 async.Future<TurnBasedMatch> decline(core.String matchId, {core.String languag
e}) { |
| 2377 var _url = null; |
| 2378 var _queryParams = new core.Map(); |
| 2379 var _uploadMedia = null; |
| 2380 var _uploadOptions = null; |
| 2381 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2382 var _body = null; |
| 2383 |
| 2384 if (matchId == null) { |
| 2385 throw new core.ArgumentError("Parameter matchId is required."); |
| 2386 } |
| 2387 if (language != null) { |
| 2388 _queryParams["language"] = [language]; |
| 2389 } |
| 2390 |
| 2391 |
| 2392 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/decline'; |
| 2393 |
| 2394 var _response = _requester.request(_url, |
| 2395 "PUT", |
| 2396 body: _body, |
| 2397 queryParams: _queryParams, |
| 2398 uploadOptions: _uploadOptions, |
| 2399 uploadMedia: _uploadMedia, |
| 2400 downloadOptions: _downloadOptions); |
| 2401 return _response.then((data) => new TurnBasedMatch.fromJson(data)); |
| 2402 } |
| 2403 |
| 2404 /** |
| 2405 * Dismiss a turn-based match from the match list. The match will no longer |
| 2406 * show up in the list and will not generate notifications. |
| 2407 * |
| 2408 * Request parameters: |
| 2409 * |
| 2410 * [matchId] - The ID of the match. |
| 2411 * |
| 2412 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2413 * error. |
| 2414 * |
| 2415 * If the used [http.Client] completes with an error when making a REST call, |
| 2416 * this method will complete with the same error. |
| 2417 */ |
| 2418 async.Future dismiss(core.String matchId) { |
| 2419 var _url = null; |
| 2420 var _queryParams = new core.Map(); |
| 2421 var _uploadMedia = null; |
| 2422 var _uploadOptions = null; |
| 2423 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2424 var _body = null; |
| 2425 |
| 2426 if (matchId == null) { |
| 2427 throw new core.ArgumentError("Parameter matchId is required."); |
| 2428 } |
| 2429 |
| 2430 _downloadOptions = null; |
| 2431 |
| 2432 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/dismiss'; |
| 2433 |
| 2434 var _response = _requester.request(_url, |
| 2435 "PUT", |
| 2436 body: _body, |
| 2437 queryParams: _queryParams, |
| 2438 uploadOptions: _uploadOptions, |
| 2439 uploadMedia: _uploadMedia, |
| 2440 downloadOptions: _downloadOptions); |
| 2441 return _response.then((data) => null); |
| 2442 } |
| 2443 |
| 2444 /** |
| 2445 * Finish a turn-based match. Each player should make this call once, after |
| 2446 * all results are in. Only the player whose turn it is may make the first |
| 2447 * call to Finish, and can pass in the final match state. |
| 2448 * |
| 2449 * [request] - The metadata request object. |
| 2450 * |
| 2451 * Request parameters: |
| 2452 * |
| 2453 * [matchId] - The ID of the match. |
| 2454 * |
| 2455 * [language] - The preferred language to use for strings returned by this |
| 2456 * method. |
| 2457 * |
| 2458 * Completes with a [TurnBasedMatch]. |
| 2459 * |
| 2460 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2461 * error. |
| 2462 * |
| 2463 * If the used [http.Client] completes with an error when making a REST call, |
| 2464 * this method will complete with the same error. |
| 2465 */ |
| 2466 async.Future<TurnBasedMatch> finish(TurnBasedMatchResults request, core.String
matchId, {core.String language}) { |
| 2467 var _url = null; |
| 2468 var _queryParams = new core.Map(); |
| 2469 var _uploadMedia = null; |
| 2470 var _uploadOptions = null; |
| 2471 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2472 var _body = null; |
| 2473 |
| 2474 if (request != null) { |
| 2475 _body = convert.JSON.encode((request).toJson()); |
| 2476 } |
| 2477 if (matchId == null) { |
| 2478 throw new core.ArgumentError("Parameter matchId is required."); |
| 2479 } |
| 2480 if (language != null) { |
| 2481 _queryParams["language"] = [language]; |
| 2482 } |
| 2483 |
| 2484 |
| 2485 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/finish'; |
| 2486 |
| 2487 var _response = _requester.request(_url, |
| 2488 "PUT", |
| 2489 body: _body, |
| 2490 queryParams: _queryParams, |
| 2491 uploadOptions: _uploadOptions, |
| 2492 uploadMedia: _uploadMedia, |
| 2493 downloadOptions: _downloadOptions); |
| 2494 return _response.then((data) => new TurnBasedMatch.fromJson(data)); |
| 2495 } |
| 2496 |
| 2497 /** |
| 2498 * Get the data for a turn-based match. |
| 2499 * |
| 2500 * Request parameters: |
| 2501 * |
| 2502 * [matchId] - The ID of the match. |
| 2503 * |
| 2504 * [includeMatchData] - Get match data along with metadata. |
| 2505 * |
| 2506 * [language] - The preferred language to use for strings returned by this |
| 2507 * method. |
| 2508 * |
| 2509 * Completes with a [TurnBasedMatch]. |
| 2510 * |
| 2511 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2512 * error. |
| 2513 * |
| 2514 * If the used [http.Client] completes with an error when making a REST call, |
| 2515 * this method will complete with the same error. |
| 2516 */ |
| 2517 async.Future<TurnBasedMatch> get(core.String matchId, {core.bool includeMatchD
ata, core.String language}) { |
| 2518 var _url = null; |
| 2519 var _queryParams = new core.Map(); |
| 2520 var _uploadMedia = null; |
| 2521 var _uploadOptions = null; |
| 2522 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2523 var _body = null; |
| 2524 |
| 2525 if (matchId == null) { |
| 2526 throw new core.ArgumentError("Parameter matchId is required."); |
| 2527 } |
| 2528 if (includeMatchData != null) { |
| 2529 _queryParams["includeMatchData"] = ["${includeMatchData}"]; |
| 2530 } |
| 2531 if (language != null) { |
| 2532 _queryParams["language"] = [language]; |
| 2533 } |
| 2534 |
| 2535 |
| 2536 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
'); |
| 2537 |
| 2538 var _response = _requester.request(_url, |
| 2539 "GET", |
| 2540 body: _body, |
| 2541 queryParams: _queryParams, |
| 2542 uploadOptions: _uploadOptions, |
| 2543 uploadMedia: _uploadMedia, |
| 2544 downloadOptions: _downloadOptions); |
| 2545 return _response.then((data) => new TurnBasedMatch.fromJson(data)); |
| 2546 } |
| 2547 |
| 2548 /** |
| 2549 * Join a turn-based match. |
| 2550 * |
| 2551 * Request parameters: |
| 2552 * |
| 2553 * [matchId] - The ID of the match. |
| 2554 * |
| 2555 * [language] - The preferred language to use for strings returned by this |
| 2556 * method. |
| 2557 * |
| 2558 * Completes with a [TurnBasedMatch]. |
| 2559 * |
| 2560 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2561 * error. |
| 2562 * |
| 2563 * If the used [http.Client] completes with an error when making a REST call, |
| 2564 * this method will complete with the same error. |
| 2565 */ |
| 2566 async.Future<TurnBasedMatch> join(core.String matchId, {core.String language})
{ |
| 2567 var _url = null; |
| 2568 var _queryParams = new core.Map(); |
| 2569 var _uploadMedia = null; |
| 2570 var _uploadOptions = null; |
| 2571 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2572 var _body = null; |
| 2573 |
| 2574 if (matchId == null) { |
| 2575 throw new core.ArgumentError("Parameter matchId is required."); |
| 2576 } |
| 2577 if (language != null) { |
| 2578 _queryParams["language"] = [language]; |
| 2579 } |
| 2580 |
| 2581 |
| 2582 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/join'; |
| 2583 |
| 2584 var _response = _requester.request(_url, |
| 2585 "PUT", |
| 2586 body: _body, |
| 2587 queryParams: _queryParams, |
| 2588 uploadOptions: _uploadOptions, |
| 2589 uploadMedia: _uploadMedia, |
| 2590 downloadOptions: _downloadOptions); |
| 2591 return _response.then((data) => new TurnBasedMatch.fromJson(data)); |
| 2592 } |
| 2593 |
| 2594 /** |
| 2595 * Leave a turn-based match when it is not the current player's turn, without |
| 2596 * canceling the match. |
| 2597 * |
| 2598 * Request parameters: |
| 2599 * |
| 2600 * [matchId] - The ID of the match. |
| 2601 * |
| 2602 * [language] - The preferred language to use for strings returned by this |
| 2603 * method. |
| 2604 * |
| 2605 * Completes with a [TurnBasedMatch]. |
| 2606 * |
| 2607 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2608 * error. |
| 2609 * |
| 2610 * If the used [http.Client] completes with an error when making a REST call, |
| 2611 * this method will complete with the same error. |
| 2612 */ |
| 2613 async.Future<TurnBasedMatch> leave(core.String matchId, {core.String language}
) { |
| 2614 var _url = null; |
| 2615 var _queryParams = new core.Map(); |
| 2616 var _uploadMedia = null; |
| 2617 var _uploadOptions = null; |
| 2618 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2619 var _body = null; |
| 2620 |
| 2621 if (matchId == null) { |
| 2622 throw new core.ArgumentError("Parameter matchId is required."); |
| 2623 } |
| 2624 if (language != null) { |
| 2625 _queryParams["language"] = [language]; |
| 2626 } |
| 2627 |
| 2628 |
| 2629 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/leave'; |
| 2630 |
| 2631 var _response = _requester.request(_url, |
| 2632 "PUT", |
| 2633 body: _body, |
| 2634 queryParams: _queryParams, |
| 2635 uploadOptions: _uploadOptions, |
| 2636 uploadMedia: _uploadMedia, |
| 2637 downloadOptions: _downloadOptions); |
| 2638 return _response.then((data) => new TurnBasedMatch.fromJson(data)); |
| 2639 } |
| 2640 |
| 2641 /** |
| 2642 * Leave a turn-based match during the current player's turn, without |
| 2643 * canceling the match. |
| 2644 * |
| 2645 * Request parameters: |
| 2646 * |
| 2647 * [matchId] - The ID of the match. |
| 2648 * |
| 2649 * [matchVersion] - The version of the match being updated. |
| 2650 * |
| 2651 * [language] - The preferred language to use for strings returned by this |
| 2652 * method. |
| 2653 * |
| 2654 * [pendingParticipantId] - The ID of another participant who should take |
| 2655 * their turn next. If not set, the match will wait for other player(s) to |
| 2656 * join via automatching; this is only valid if automatch criteria is set on |
| 2657 * the match with remaining slots for automatched players. |
| 2658 * |
| 2659 * Completes with a [TurnBasedMatch]. |
| 2660 * |
| 2661 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2662 * error. |
| 2663 * |
| 2664 * If the used [http.Client] completes with an error when making a REST call, |
| 2665 * this method will complete with the same error. |
| 2666 */ |
| 2667 async.Future<TurnBasedMatch> leaveTurn(core.String matchId, core.int matchVers
ion, {core.String language, core.String pendingParticipantId}) { |
| 2668 var _url = null; |
| 2669 var _queryParams = new core.Map(); |
| 2670 var _uploadMedia = null; |
| 2671 var _uploadOptions = null; |
| 2672 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2673 var _body = null; |
| 2674 |
| 2675 if (matchId == null) { |
| 2676 throw new core.ArgumentError("Parameter matchId is required."); |
| 2677 } |
| 2678 if (matchVersion == null) { |
| 2679 throw new core.ArgumentError("Parameter matchVersion is required."); |
| 2680 } |
| 2681 _queryParams["matchVersion"] = ["${matchVersion}"]; |
| 2682 if (language != null) { |
| 2683 _queryParams["language"] = [language]; |
| 2684 } |
| 2685 if (pendingParticipantId != null) { |
| 2686 _queryParams["pendingParticipantId"] = [pendingParticipantId]; |
| 2687 } |
| 2688 |
| 2689 |
| 2690 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/leaveTurn'; |
| 2691 |
| 2692 var _response = _requester.request(_url, |
| 2693 "PUT", |
| 2694 body: _body, |
| 2695 queryParams: _queryParams, |
| 2696 uploadOptions: _uploadOptions, |
| 2697 uploadMedia: _uploadMedia, |
| 2698 downloadOptions: _downloadOptions); |
| 2699 return _response.then((data) => new TurnBasedMatch.fromJson(data)); |
| 2700 } |
| 2701 |
| 2702 /** |
| 2703 * Returns turn-based matches the player is or was involved in. |
| 2704 * |
| 2705 * Request parameters: |
| 2706 * |
| 2707 * [includeMatchData] - True if match data should be returned in the response. |
| 2708 * Note that not all data will necessarily be returned if include_match_data |
| 2709 * is true; the server may decide to only return data for some of the matches |
| 2710 * to limit download size for the client. The remainder of the data for these |
| 2711 * matches will be retrievable on request. |
| 2712 * |
| 2713 * [language] - The preferred language to use for strings returned by this |
| 2714 * method. |
| 2715 * |
| 2716 * [maxCompletedMatches] - The maximum number of completed or canceled matches |
| 2717 * to return in the response. If not set, all matches returned could be |
| 2718 * completed or canceled. |
| 2719 * Value must be between "0" and "500". |
| 2720 * |
| 2721 * [maxResults] - The maximum number of matches to return in the response, |
| 2722 * used for paging. For any response, the actual number of matches to return |
| 2723 * may be less than the specified maxResults. |
| 2724 * Value must be between "1" and "500". |
| 2725 * |
| 2726 * [pageToken] - The token returned by the previous request. |
| 2727 * |
| 2728 * Completes with a [TurnBasedMatchList]. |
| 2729 * |
| 2730 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2731 * error. |
| 2732 * |
| 2733 * If the used [http.Client] completes with an error when making a REST call, |
| 2734 * this method will complete with the same error. |
| 2735 */ |
| 2736 async.Future<TurnBasedMatchList> list({core.bool includeMatchData, core.String
language, core.int maxCompletedMatches, core.int maxResults, core.String pageTo
ken}) { |
| 2737 var _url = null; |
| 2738 var _queryParams = new core.Map(); |
| 2739 var _uploadMedia = null; |
| 2740 var _uploadOptions = null; |
| 2741 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2742 var _body = null; |
| 2743 |
| 2744 if (includeMatchData != null) { |
| 2745 _queryParams["includeMatchData"] = ["${includeMatchData}"]; |
| 2746 } |
| 2747 if (language != null) { |
| 2748 _queryParams["language"] = [language]; |
| 2749 } |
| 2750 if (maxCompletedMatches != null) { |
| 2751 _queryParams["maxCompletedMatches"] = ["${maxCompletedMatches}"]; |
| 2752 } |
| 2753 if (maxResults != null) { |
| 2754 _queryParams["maxResults"] = ["${maxResults}"]; |
| 2755 } |
| 2756 if (pageToken != null) { |
| 2757 _queryParams["pageToken"] = [pageToken]; |
| 2758 } |
| 2759 |
| 2760 |
| 2761 _url = 'turnbasedmatches'; |
| 2762 |
| 2763 var _response = _requester.request(_url, |
| 2764 "GET", |
| 2765 body: _body, |
| 2766 queryParams: _queryParams, |
| 2767 uploadOptions: _uploadOptions, |
| 2768 uploadMedia: _uploadMedia, |
| 2769 downloadOptions: _downloadOptions); |
| 2770 return _response.then((data) => new TurnBasedMatchList.fromJson(data)); |
| 2771 } |
| 2772 |
| 2773 /** |
| 2774 * Create a rematch of a match that was previously completed, with the same |
| 2775 * participants. This can be called by only one player on a match still in |
| 2776 * their list; the player must have called Finish first. Returns the newly |
| 2777 * created match; it will be the caller's turn. |
| 2778 * |
| 2779 * Request parameters: |
| 2780 * |
| 2781 * [matchId] - The ID of the match. |
| 2782 * |
| 2783 * [language] - The preferred language to use for strings returned by this |
| 2784 * method. |
| 2785 * |
| 2786 * [requestId] - A randomly generated numeric ID for each request specified by |
| 2787 * the caller. This number is used at the server to ensure that the request is |
| 2788 * handled correctly across retries. |
| 2789 * |
| 2790 * Completes with a [TurnBasedMatchRematch]. |
| 2791 * |
| 2792 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2793 * error. |
| 2794 * |
| 2795 * If the used [http.Client] completes with an error when making a REST call, |
| 2796 * this method will complete with the same error. |
| 2797 */ |
| 2798 async.Future<TurnBasedMatchRematch> rematch(core.String matchId, {core.String
language, core.String requestId}) { |
| 2799 var _url = null; |
| 2800 var _queryParams = new core.Map(); |
| 2801 var _uploadMedia = null; |
| 2802 var _uploadOptions = null; |
| 2803 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2804 var _body = null; |
| 2805 |
| 2806 if (matchId == null) { |
| 2807 throw new core.ArgumentError("Parameter matchId is required."); |
| 2808 } |
| 2809 if (language != null) { |
| 2810 _queryParams["language"] = [language]; |
| 2811 } |
| 2812 if (requestId != null) { |
| 2813 _queryParams["requestId"] = [requestId]; |
| 2814 } |
| 2815 |
| 2816 |
| 2817 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/rematch'; |
| 2818 |
| 2819 var _response = _requester.request(_url, |
| 2820 "POST", |
| 2821 body: _body, |
| 2822 queryParams: _queryParams, |
| 2823 uploadOptions: _uploadOptions, |
| 2824 uploadMedia: _uploadMedia, |
| 2825 downloadOptions: _downloadOptions); |
| 2826 return _response.then((data) => new TurnBasedMatchRematch.fromJson(data)); |
| 2827 } |
| 2828 |
| 2829 /** |
| 2830 * Returns turn-based matches the player is or was involved in that changed |
| 2831 * since the last sync call, with the least recent changes coming first. |
| 2832 * Matches that should be removed from the local cache will have a status of |
| 2833 * MATCH_DELETED. |
| 2834 * |
| 2835 * Request parameters: |
| 2836 * |
| 2837 * [includeMatchData] - True if match data should be returned in the response. |
| 2838 * Note that not all data will necessarily be returned if include_match_data |
| 2839 * is true; the server may decide to only return data for some of the matches |
| 2840 * to limit download size for the client. The remainder of the data for these |
| 2841 * matches will be retrievable on request. |
| 2842 * |
| 2843 * [language] - The preferred language to use for strings returned by this |
| 2844 * method. |
| 2845 * |
| 2846 * [maxCompletedMatches] - The maximum number of completed or canceled matches |
| 2847 * to return in the response. If not set, all matches returned could be |
| 2848 * completed or canceled. |
| 2849 * Value must be between "0" and "500". |
| 2850 * |
| 2851 * [maxResults] - The maximum number of matches to return in the response, |
| 2852 * used for paging. For any response, the actual number of matches to return |
| 2853 * may be less than the specified maxResults. |
| 2854 * Value must be between "1" and "500". |
| 2855 * |
| 2856 * [pageToken] - The token returned by the previous request. |
| 2857 * |
| 2858 * Completes with a [TurnBasedMatchSync]. |
| 2859 * |
| 2860 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2861 * error. |
| 2862 * |
| 2863 * If the used [http.Client] completes with an error when making a REST call, |
| 2864 * this method will complete with the same error. |
| 2865 */ |
| 2866 async.Future<TurnBasedMatchSync> sync({core.bool includeMatchData, core.String
language, core.int maxCompletedMatches, core.int maxResults, core.String pageTo
ken}) { |
| 2867 var _url = null; |
| 2868 var _queryParams = new core.Map(); |
| 2869 var _uploadMedia = null; |
| 2870 var _uploadOptions = null; |
| 2871 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2872 var _body = null; |
| 2873 |
| 2874 if (includeMatchData != null) { |
| 2875 _queryParams["includeMatchData"] = ["${includeMatchData}"]; |
| 2876 } |
| 2877 if (language != null) { |
| 2878 _queryParams["language"] = [language]; |
| 2879 } |
| 2880 if (maxCompletedMatches != null) { |
| 2881 _queryParams["maxCompletedMatches"] = ["${maxCompletedMatches}"]; |
| 2882 } |
| 2883 if (maxResults != null) { |
| 2884 _queryParams["maxResults"] = ["${maxResults}"]; |
| 2885 } |
| 2886 if (pageToken != null) { |
| 2887 _queryParams["pageToken"] = [pageToken]; |
| 2888 } |
| 2889 |
| 2890 |
| 2891 _url = 'turnbasedmatches/sync'; |
| 2892 |
| 2893 var _response = _requester.request(_url, |
| 2894 "GET", |
| 2895 body: _body, |
| 2896 queryParams: _queryParams, |
| 2897 uploadOptions: _uploadOptions, |
| 2898 uploadMedia: _uploadMedia, |
| 2899 downloadOptions: _downloadOptions); |
| 2900 return _response.then((data) => new TurnBasedMatchSync.fromJson(data)); |
| 2901 } |
| 2902 |
| 2903 /** |
| 2904 * Commit the results of a player turn. |
| 2905 * |
| 2906 * [request] - The metadata request object. |
| 2907 * |
| 2908 * Request parameters: |
| 2909 * |
| 2910 * [matchId] - The ID of the match. |
| 2911 * |
| 2912 * [language] - The preferred language to use for strings returned by this |
| 2913 * method. |
| 2914 * |
| 2915 * Completes with a [TurnBasedMatch]. |
| 2916 * |
| 2917 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 2918 * error. |
| 2919 * |
| 2920 * If the used [http.Client] completes with an error when making a REST call, |
| 2921 * this method will complete with the same error. |
| 2922 */ |
| 2923 async.Future<TurnBasedMatch> takeTurn(TurnBasedMatchTurn request, core.String
matchId, {core.String language}) { |
| 2924 var _url = null; |
| 2925 var _queryParams = new core.Map(); |
| 2926 var _uploadMedia = null; |
| 2927 var _uploadOptions = null; |
| 2928 var _downloadOptions = common.DownloadOptions.Metadata; |
| 2929 var _body = null; |
| 2930 |
| 2931 if (request != null) { |
| 2932 _body = convert.JSON.encode((request).toJson()); |
| 2933 } |
| 2934 if (matchId == null) { |
| 2935 throw new core.ArgumentError("Parameter matchId is required."); |
| 2936 } |
| 2937 if (language != null) { |
| 2938 _queryParams["language"] = [language]; |
| 2939 } |
| 2940 |
| 2941 |
| 2942 _url = 'turnbasedmatches/' + common_internal.Escaper.ecapeVariable('$matchId
') + '/turn'; |
| 2943 |
| 2944 var _response = _requester.request(_url, |
| 2945 "PUT", |
| 2946 body: _body, |
| 2947 queryParams: _queryParams, |
| 2948 uploadOptions: _uploadOptions, |
| 2949 uploadMedia: _uploadMedia, |
| 2950 downloadOptions: _downloadOptions); |
| 2951 return _response.then((data) => new TurnBasedMatch.fromJson(data)); |
| 2952 } |
| 2953 |
| 2954 } |
| 2955 |
| 2956 |
| 2957 |
| 2958 /** This is a JSON template for an achievement definition object. */ |
| 2959 class AchievementDefinition { |
| 2960 /** |
| 2961 * The type of the achievement. |
| 2962 * Possible values are: |
| 2963 * - "STANDARD" - Achievement is either locked or unlocked. |
| 2964 * - "INCREMENTAL" - Achievement is incremental. |
| 2965 */ |
| 2966 core.String achievementType; |
| 2967 |
| 2968 /** The description of the achievement. */ |
| 2969 core.String description; |
| 2970 |
| 2971 /** |
| 2972 * Experience points which will be earned when unlocking this achievement. |
| 2973 */ |
| 2974 core.String experiencePoints; |
| 2975 |
| 2976 /** The total steps for an incremental achievement as a string. */ |
| 2977 core.String formattedTotalSteps; |
| 2978 |
| 2979 /** The ID of the achievement. */ |
| 2980 core.String id; |
| 2981 |
| 2982 /** |
| 2983 * The initial state of the achievement. |
| 2984 * Possible values are: |
| 2985 * - "HIDDEN" - Achievement is hidden. |
| 2986 * - "REVEALED" - Achievement is revealed. |
| 2987 * - "UNLOCKED" - Achievement is unlocked. |
| 2988 */ |
| 2989 core.String initialState; |
| 2990 |
| 2991 /** |
| 2992 * Indicates whether the revealed icon image being returned is a default |
| 2993 * image, or is provided by the game. |
| 2994 */ |
| 2995 core.bool isRevealedIconUrlDefault; |
| 2996 |
| 2997 /** |
| 2998 * Indicates whether the unlocked icon image being returned is a default |
| 2999 * image, or is game-provided. |
| 3000 */ |
| 3001 core.bool isUnlockedIconUrlDefault; |
| 3002 |
| 3003 /** |
| 3004 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3005 * string games#achievementDefinition. |
| 3006 */ |
| 3007 core.String kind; |
| 3008 |
| 3009 /** The name of the achievement. */ |
| 3010 core.String name; |
| 3011 |
| 3012 /** The image URL for the revealed achievement icon. */ |
| 3013 core.String revealedIconUrl; |
| 3014 |
| 3015 /** The total steps for an incremental achievement. */ |
| 3016 core.int totalSteps; |
| 3017 |
| 3018 /** The image URL for the unlocked achievement icon. */ |
| 3019 core.String unlockedIconUrl; |
| 3020 |
| 3021 |
| 3022 AchievementDefinition(); |
| 3023 |
| 3024 AchievementDefinition.fromJson(core.Map _json) { |
| 3025 if (_json.containsKey("achievementType")) { |
| 3026 achievementType = _json["achievementType"]; |
| 3027 } |
| 3028 if (_json.containsKey("description")) { |
| 3029 description = _json["description"]; |
| 3030 } |
| 3031 if (_json.containsKey("experiencePoints")) { |
| 3032 experiencePoints = _json["experiencePoints"]; |
| 3033 } |
| 3034 if (_json.containsKey("formattedTotalSteps")) { |
| 3035 formattedTotalSteps = _json["formattedTotalSteps"]; |
| 3036 } |
| 3037 if (_json.containsKey("id")) { |
| 3038 id = _json["id"]; |
| 3039 } |
| 3040 if (_json.containsKey("initialState")) { |
| 3041 initialState = _json["initialState"]; |
| 3042 } |
| 3043 if (_json.containsKey("isRevealedIconUrlDefault")) { |
| 3044 isRevealedIconUrlDefault = _json["isRevealedIconUrlDefault"]; |
| 3045 } |
| 3046 if (_json.containsKey("isUnlockedIconUrlDefault")) { |
| 3047 isUnlockedIconUrlDefault = _json["isUnlockedIconUrlDefault"]; |
| 3048 } |
| 3049 if (_json.containsKey("kind")) { |
| 3050 kind = _json["kind"]; |
| 3051 } |
| 3052 if (_json.containsKey("name")) { |
| 3053 name = _json["name"]; |
| 3054 } |
| 3055 if (_json.containsKey("revealedIconUrl")) { |
| 3056 revealedIconUrl = _json["revealedIconUrl"]; |
| 3057 } |
| 3058 if (_json.containsKey("totalSteps")) { |
| 3059 totalSteps = _json["totalSteps"]; |
| 3060 } |
| 3061 if (_json.containsKey("unlockedIconUrl")) { |
| 3062 unlockedIconUrl = _json["unlockedIconUrl"]; |
| 3063 } |
| 3064 } |
| 3065 |
| 3066 core.Map toJson() { |
| 3067 var _json = new core.Map(); |
| 3068 if (achievementType != null) { |
| 3069 _json["achievementType"] = achievementType; |
| 3070 } |
| 3071 if (description != null) { |
| 3072 _json["description"] = description; |
| 3073 } |
| 3074 if (experiencePoints != null) { |
| 3075 _json["experiencePoints"] = experiencePoints; |
| 3076 } |
| 3077 if (formattedTotalSteps != null) { |
| 3078 _json["formattedTotalSteps"] = formattedTotalSteps; |
| 3079 } |
| 3080 if (id != null) { |
| 3081 _json["id"] = id; |
| 3082 } |
| 3083 if (initialState != null) { |
| 3084 _json["initialState"] = initialState; |
| 3085 } |
| 3086 if (isRevealedIconUrlDefault != null) { |
| 3087 _json["isRevealedIconUrlDefault"] = isRevealedIconUrlDefault; |
| 3088 } |
| 3089 if (isUnlockedIconUrlDefault != null) { |
| 3090 _json["isUnlockedIconUrlDefault"] = isUnlockedIconUrlDefault; |
| 3091 } |
| 3092 if (kind != null) { |
| 3093 _json["kind"] = kind; |
| 3094 } |
| 3095 if (name != null) { |
| 3096 _json["name"] = name; |
| 3097 } |
| 3098 if (revealedIconUrl != null) { |
| 3099 _json["revealedIconUrl"] = revealedIconUrl; |
| 3100 } |
| 3101 if (totalSteps != null) { |
| 3102 _json["totalSteps"] = totalSteps; |
| 3103 } |
| 3104 if (unlockedIconUrl != null) { |
| 3105 _json["unlockedIconUrl"] = unlockedIconUrl; |
| 3106 } |
| 3107 return _json; |
| 3108 } |
| 3109 } |
| 3110 |
| 3111 |
| 3112 /** This is a JSON template for a list of achievement definition objects. */ |
| 3113 class AchievementDefinitionsListResponse { |
| 3114 /** The achievement definitions. */ |
| 3115 core.List<AchievementDefinition> items; |
| 3116 |
| 3117 /** |
| 3118 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3119 * string games#achievementDefinitionsListResponse. |
| 3120 */ |
| 3121 core.String kind; |
| 3122 |
| 3123 /** Token corresponding to the next page of results. */ |
| 3124 core.String nextPageToken; |
| 3125 |
| 3126 |
| 3127 AchievementDefinitionsListResponse(); |
| 3128 |
| 3129 AchievementDefinitionsListResponse.fromJson(core.Map _json) { |
| 3130 if (_json.containsKey("items")) { |
| 3131 items = _json["items"].map((value) => new AchievementDefinition.fromJson(v
alue)).toList(); |
| 3132 } |
| 3133 if (_json.containsKey("kind")) { |
| 3134 kind = _json["kind"]; |
| 3135 } |
| 3136 if (_json.containsKey("nextPageToken")) { |
| 3137 nextPageToken = _json["nextPageToken"]; |
| 3138 } |
| 3139 } |
| 3140 |
| 3141 core.Map toJson() { |
| 3142 var _json = new core.Map(); |
| 3143 if (items != null) { |
| 3144 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 3145 } |
| 3146 if (kind != null) { |
| 3147 _json["kind"] = kind; |
| 3148 } |
| 3149 if (nextPageToken != null) { |
| 3150 _json["nextPageToken"] = nextPageToken; |
| 3151 } |
| 3152 return _json; |
| 3153 } |
| 3154 } |
| 3155 |
| 3156 |
| 3157 /** This is a JSON template for an achievement increment response */ |
| 3158 class AchievementIncrementResponse { |
| 3159 /** The current steps recorded for this incremental achievement. */ |
| 3160 core.int currentSteps; |
| 3161 |
| 3162 /** |
| 3163 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3164 * string games#achievementIncrementResponse. |
| 3165 */ |
| 3166 core.String kind; |
| 3167 |
| 3168 /** |
| 3169 * Whether the the current steps for the achievement has reached the number of |
| 3170 * steps required to unlock. |
| 3171 */ |
| 3172 core.bool newlyUnlocked; |
| 3173 |
| 3174 |
| 3175 AchievementIncrementResponse(); |
| 3176 |
| 3177 AchievementIncrementResponse.fromJson(core.Map _json) { |
| 3178 if (_json.containsKey("currentSteps")) { |
| 3179 currentSteps = _json["currentSteps"]; |
| 3180 } |
| 3181 if (_json.containsKey("kind")) { |
| 3182 kind = _json["kind"]; |
| 3183 } |
| 3184 if (_json.containsKey("newlyUnlocked")) { |
| 3185 newlyUnlocked = _json["newlyUnlocked"]; |
| 3186 } |
| 3187 } |
| 3188 |
| 3189 core.Map toJson() { |
| 3190 var _json = new core.Map(); |
| 3191 if (currentSteps != null) { |
| 3192 _json["currentSteps"] = currentSteps; |
| 3193 } |
| 3194 if (kind != null) { |
| 3195 _json["kind"] = kind; |
| 3196 } |
| 3197 if (newlyUnlocked != null) { |
| 3198 _json["newlyUnlocked"] = newlyUnlocked; |
| 3199 } |
| 3200 return _json; |
| 3201 } |
| 3202 } |
| 3203 |
| 3204 |
| 3205 /** This is a JSON template for an achievement reveal response */ |
| 3206 class AchievementRevealResponse { |
| 3207 /** |
| 3208 * The current state of the achievement for which a reveal was attempted. This |
| 3209 * might be UNLOCKED if the achievement was already unlocked. |
| 3210 * Possible values are: |
| 3211 * - "REVEALED" - Achievement is revealed. |
| 3212 * - "UNLOCKED" - Achievement is unlocked. |
| 3213 */ |
| 3214 core.String currentState; |
| 3215 |
| 3216 /** |
| 3217 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3218 * string games#achievementRevealResponse. |
| 3219 */ |
| 3220 core.String kind; |
| 3221 |
| 3222 |
| 3223 AchievementRevealResponse(); |
| 3224 |
| 3225 AchievementRevealResponse.fromJson(core.Map _json) { |
| 3226 if (_json.containsKey("currentState")) { |
| 3227 currentState = _json["currentState"]; |
| 3228 } |
| 3229 if (_json.containsKey("kind")) { |
| 3230 kind = _json["kind"]; |
| 3231 } |
| 3232 } |
| 3233 |
| 3234 core.Map toJson() { |
| 3235 var _json = new core.Map(); |
| 3236 if (currentState != null) { |
| 3237 _json["currentState"] = currentState; |
| 3238 } |
| 3239 if (kind != null) { |
| 3240 _json["kind"] = kind; |
| 3241 } |
| 3242 return _json; |
| 3243 } |
| 3244 } |
| 3245 |
| 3246 |
| 3247 /** This is a JSON template for an achievement set steps at least response. */ |
| 3248 class AchievementSetStepsAtLeastResponse { |
| 3249 /** The current steps recorded for this incremental achievement. */ |
| 3250 core.int currentSteps; |
| 3251 |
| 3252 /** |
| 3253 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3254 * string games#achievementSetStepsAtLeastResponse. |
| 3255 */ |
| 3256 core.String kind; |
| 3257 |
| 3258 /** |
| 3259 * Whether the the current steps for the achievement has reached the number of |
| 3260 * steps required to unlock. |
| 3261 */ |
| 3262 core.bool newlyUnlocked; |
| 3263 |
| 3264 |
| 3265 AchievementSetStepsAtLeastResponse(); |
| 3266 |
| 3267 AchievementSetStepsAtLeastResponse.fromJson(core.Map _json) { |
| 3268 if (_json.containsKey("currentSteps")) { |
| 3269 currentSteps = _json["currentSteps"]; |
| 3270 } |
| 3271 if (_json.containsKey("kind")) { |
| 3272 kind = _json["kind"]; |
| 3273 } |
| 3274 if (_json.containsKey("newlyUnlocked")) { |
| 3275 newlyUnlocked = _json["newlyUnlocked"]; |
| 3276 } |
| 3277 } |
| 3278 |
| 3279 core.Map toJson() { |
| 3280 var _json = new core.Map(); |
| 3281 if (currentSteps != null) { |
| 3282 _json["currentSteps"] = currentSteps; |
| 3283 } |
| 3284 if (kind != null) { |
| 3285 _json["kind"] = kind; |
| 3286 } |
| 3287 if (newlyUnlocked != null) { |
| 3288 _json["newlyUnlocked"] = newlyUnlocked; |
| 3289 } |
| 3290 return _json; |
| 3291 } |
| 3292 } |
| 3293 |
| 3294 |
| 3295 /** This is a JSON template for an achievement unlock response */ |
| 3296 class AchievementUnlockResponse { |
| 3297 /** |
| 3298 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3299 * string games#achievementUnlockResponse. |
| 3300 */ |
| 3301 core.String kind; |
| 3302 |
| 3303 /** |
| 3304 * Whether this achievement was newly unlocked (that is, whether the unlock |
| 3305 * request for the achievement was the first for the player). |
| 3306 */ |
| 3307 core.bool newlyUnlocked; |
| 3308 |
| 3309 |
| 3310 AchievementUnlockResponse(); |
| 3311 |
| 3312 AchievementUnlockResponse.fromJson(core.Map _json) { |
| 3313 if (_json.containsKey("kind")) { |
| 3314 kind = _json["kind"]; |
| 3315 } |
| 3316 if (_json.containsKey("newlyUnlocked")) { |
| 3317 newlyUnlocked = _json["newlyUnlocked"]; |
| 3318 } |
| 3319 } |
| 3320 |
| 3321 core.Map toJson() { |
| 3322 var _json = new core.Map(); |
| 3323 if (kind != null) { |
| 3324 _json["kind"] = kind; |
| 3325 } |
| 3326 if (newlyUnlocked != null) { |
| 3327 _json["newlyUnlocked"] = newlyUnlocked; |
| 3328 } |
| 3329 return _json; |
| 3330 } |
| 3331 } |
| 3332 |
| 3333 |
| 3334 /** This is a JSON template for a list of achievement update requests. */ |
| 3335 class AchievementUpdateMultipleRequest { |
| 3336 /** |
| 3337 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3338 * string games#achievementUpdateMultipleRequest. |
| 3339 */ |
| 3340 core.String kind; |
| 3341 |
| 3342 /** The individual achievement update requests. */ |
| 3343 core.List<AchievementUpdateRequest> updates; |
| 3344 |
| 3345 |
| 3346 AchievementUpdateMultipleRequest(); |
| 3347 |
| 3348 AchievementUpdateMultipleRequest.fromJson(core.Map _json) { |
| 3349 if (_json.containsKey("kind")) { |
| 3350 kind = _json["kind"]; |
| 3351 } |
| 3352 if (_json.containsKey("updates")) { |
| 3353 updates = _json["updates"].map((value) => new AchievementUpdateRequest.fro
mJson(value)).toList(); |
| 3354 } |
| 3355 } |
| 3356 |
| 3357 core.Map toJson() { |
| 3358 var _json = new core.Map(); |
| 3359 if (kind != null) { |
| 3360 _json["kind"] = kind; |
| 3361 } |
| 3362 if (updates != null) { |
| 3363 _json["updates"] = updates.map((value) => (value).toJson()).toList(); |
| 3364 } |
| 3365 return _json; |
| 3366 } |
| 3367 } |
| 3368 |
| 3369 |
| 3370 /** This is a JSON template for an achievement unlock response. */ |
| 3371 class AchievementUpdateMultipleResponse { |
| 3372 /** |
| 3373 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3374 * string games#achievementUpdateListResponse. |
| 3375 */ |
| 3376 core.String kind; |
| 3377 |
| 3378 /** The updated state of the achievements. */ |
| 3379 core.List<AchievementUpdateResponse> updatedAchievements; |
| 3380 |
| 3381 |
| 3382 AchievementUpdateMultipleResponse(); |
| 3383 |
| 3384 AchievementUpdateMultipleResponse.fromJson(core.Map _json) { |
| 3385 if (_json.containsKey("kind")) { |
| 3386 kind = _json["kind"]; |
| 3387 } |
| 3388 if (_json.containsKey("updatedAchievements")) { |
| 3389 updatedAchievements = _json["updatedAchievements"].map((value) => new Achi
evementUpdateResponse.fromJson(value)).toList(); |
| 3390 } |
| 3391 } |
| 3392 |
| 3393 core.Map toJson() { |
| 3394 var _json = new core.Map(); |
| 3395 if (kind != null) { |
| 3396 _json["kind"] = kind; |
| 3397 } |
| 3398 if (updatedAchievements != null) { |
| 3399 _json["updatedAchievements"] = updatedAchievements.map((value) => (value).
toJson()).toList(); |
| 3400 } |
| 3401 return _json; |
| 3402 } |
| 3403 } |
| 3404 |
| 3405 |
| 3406 /** This is a JSON template for a request to update an achievement. */ |
| 3407 class AchievementUpdateRequest { |
| 3408 /** The achievement this update is being applied to. */ |
| 3409 core.String achievementId; |
| 3410 |
| 3411 /** |
| 3412 * The payload if an update of type INCREMENT was requested for the |
| 3413 * achievement. |
| 3414 */ |
| 3415 GamesAchievementIncrement incrementPayload; |
| 3416 |
| 3417 /** |
| 3418 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3419 * string games#achievementUpdateRequest. |
| 3420 */ |
| 3421 core.String kind; |
| 3422 |
| 3423 /** |
| 3424 * The payload if an update of type SET_STEPS_AT_LEAST was requested for the |
| 3425 * achievement. |
| 3426 */ |
| 3427 GamesAchievementSetStepsAtLeast setStepsAtLeastPayload; |
| 3428 |
| 3429 /** |
| 3430 * The type of update being applied. |
| 3431 * Possible values are: |
| 3432 * - "REVEAL" - Achievement is revealed. |
| 3433 * - "UNLOCK" - Achievement is unlocked. |
| 3434 * - "INCREMENT" - Achievement is incremented. |
| 3435 * - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the passed |
| 3436 * value. |
| 3437 */ |
| 3438 core.String updateType; |
| 3439 |
| 3440 |
| 3441 AchievementUpdateRequest(); |
| 3442 |
| 3443 AchievementUpdateRequest.fromJson(core.Map _json) { |
| 3444 if (_json.containsKey("achievementId")) { |
| 3445 achievementId = _json["achievementId"]; |
| 3446 } |
| 3447 if (_json.containsKey("incrementPayload")) { |
| 3448 incrementPayload = new GamesAchievementIncrement.fromJson(_json["increment
Payload"]); |
| 3449 } |
| 3450 if (_json.containsKey("kind")) { |
| 3451 kind = _json["kind"]; |
| 3452 } |
| 3453 if (_json.containsKey("setStepsAtLeastPayload")) { |
| 3454 setStepsAtLeastPayload = new GamesAchievementSetStepsAtLeast.fromJson(_jso
n["setStepsAtLeastPayload"]); |
| 3455 } |
| 3456 if (_json.containsKey("updateType")) { |
| 3457 updateType = _json["updateType"]; |
| 3458 } |
| 3459 } |
| 3460 |
| 3461 core.Map toJson() { |
| 3462 var _json = new core.Map(); |
| 3463 if (achievementId != null) { |
| 3464 _json["achievementId"] = achievementId; |
| 3465 } |
| 3466 if (incrementPayload != null) { |
| 3467 _json["incrementPayload"] = (incrementPayload).toJson(); |
| 3468 } |
| 3469 if (kind != null) { |
| 3470 _json["kind"] = kind; |
| 3471 } |
| 3472 if (setStepsAtLeastPayload != null) { |
| 3473 _json["setStepsAtLeastPayload"] = (setStepsAtLeastPayload).toJson(); |
| 3474 } |
| 3475 if (updateType != null) { |
| 3476 _json["updateType"] = updateType; |
| 3477 } |
| 3478 return _json; |
| 3479 } |
| 3480 } |
| 3481 |
| 3482 |
| 3483 /** This is a JSON template for an achievement update response. */ |
| 3484 class AchievementUpdateResponse { |
| 3485 /** The achievement this update is was applied to. */ |
| 3486 core.String achievementId; |
| 3487 |
| 3488 /** |
| 3489 * The current state of the achievement. |
| 3490 * Possible values are: |
| 3491 * - "HIDDEN" - Achievement is hidden. |
| 3492 * - "REVEALED" - Achievement is revealed. |
| 3493 * - "UNLOCKED" - Achievement is unlocked. |
| 3494 */ |
| 3495 core.String currentState; |
| 3496 |
| 3497 /** The current steps recorded for this achievement if it is incremental. */ |
| 3498 core.int currentSteps; |
| 3499 |
| 3500 /** |
| 3501 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3502 * string games#achievementUpdateResponse. |
| 3503 */ |
| 3504 core.String kind; |
| 3505 |
| 3506 /** |
| 3507 * Whether this achievement was newly unlocked (that is, whether the unlock |
| 3508 * request for the achievement was the first for the player). |
| 3509 */ |
| 3510 core.bool newlyUnlocked; |
| 3511 |
| 3512 /** Whether the requested updates actually affected the achievement. */ |
| 3513 core.bool updateOccurred; |
| 3514 |
| 3515 |
| 3516 AchievementUpdateResponse(); |
| 3517 |
| 3518 AchievementUpdateResponse.fromJson(core.Map _json) { |
| 3519 if (_json.containsKey("achievementId")) { |
| 3520 achievementId = _json["achievementId"]; |
| 3521 } |
| 3522 if (_json.containsKey("currentState")) { |
| 3523 currentState = _json["currentState"]; |
| 3524 } |
| 3525 if (_json.containsKey("currentSteps")) { |
| 3526 currentSteps = _json["currentSteps"]; |
| 3527 } |
| 3528 if (_json.containsKey("kind")) { |
| 3529 kind = _json["kind"]; |
| 3530 } |
| 3531 if (_json.containsKey("newlyUnlocked")) { |
| 3532 newlyUnlocked = _json["newlyUnlocked"]; |
| 3533 } |
| 3534 if (_json.containsKey("updateOccurred")) { |
| 3535 updateOccurred = _json["updateOccurred"]; |
| 3536 } |
| 3537 } |
| 3538 |
| 3539 core.Map toJson() { |
| 3540 var _json = new core.Map(); |
| 3541 if (achievementId != null) { |
| 3542 _json["achievementId"] = achievementId; |
| 3543 } |
| 3544 if (currentState != null) { |
| 3545 _json["currentState"] = currentState; |
| 3546 } |
| 3547 if (currentSteps != null) { |
| 3548 _json["currentSteps"] = currentSteps; |
| 3549 } |
| 3550 if (kind != null) { |
| 3551 _json["kind"] = kind; |
| 3552 } |
| 3553 if (newlyUnlocked != null) { |
| 3554 _json["newlyUnlocked"] = newlyUnlocked; |
| 3555 } |
| 3556 if (updateOccurred != null) { |
| 3557 _json["updateOccurred"] = updateOccurred; |
| 3558 } |
| 3559 return _json; |
| 3560 } |
| 3561 } |
| 3562 |
| 3563 |
| 3564 /** This is a JSON template for aggregate stats. */ |
| 3565 class AggregateStats { |
| 3566 /** The number of messages sent between a pair of peers. */ |
| 3567 core.String count; |
| 3568 |
| 3569 /** |
| 3570 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3571 * string games#aggregateStats. |
| 3572 */ |
| 3573 core.String kind; |
| 3574 |
| 3575 /** The maximum amount. */ |
| 3576 core.String max; |
| 3577 |
| 3578 /** The minimum amount. */ |
| 3579 core.String min; |
| 3580 |
| 3581 /** The total number of bytes sent for messages between a pair of peers. */ |
| 3582 core.String sum; |
| 3583 |
| 3584 |
| 3585 AggregateStats(); |
| 3586 |
| 3587 AggregateStats.fromJson(core.Map _json) { |
| 3588 if (_json.containsKey("count")) { |
| 3589 count = _json["count"]; |
| 3590 } |
| 3591 if (_json.containsKey("kind")) { |
| 3592 kind = _json["kind"]; |
| 3593 } |
| 3594 if (_json.containsKey("max")) { |
| 3595 max = _json["max"]; |
| 3596 } |
| 3597 if (_json.containsKey("min")) { |
| 3598 min = _json["min"]; |
| 3599 } |
| 3600 if (_json.containsKey("sum")) { |
| 3601 sum = _json["sum"]; |
| 3602 } |
| 3603 } |
| 3604 |
| 3605 core.Map toJson() { |
| 3606 var _json = new core.Map(); |
| 3607 if (count != null) { |
| 3608 _json["count"] = count; |
| 3609 } |
| 3610 if (kind != null) { |
| 3611 _json["kind"] = kind; |
| 3612 } |
| 3613 if (max != null) { |
| 3614 _json["max"] = max; |
| 3615 } |
| 3616 if (min != null) { |
| 3617 _json["min"] = min; |
| 3618 } |
| 3619 if (sum != null) { |
| 3620 _json["sum"] = sum; |
| 3621 } |
| 3622 return _json; |
| 3623 } |
| 3624 } |
| 3625 |
| 3626 |
| 3627 /** This is a JSON template for an anonymous player */ |
| 3628 class AnonymousPlayer { |
| 3629 /** The base URL for the image to display for the anonymous player. */ |
| 3630 core.String avatarImageUrl; |
| 3631 |
| 3632 /** The name to display for the anonymous player. */ |
| 3633 core.String displayName; |
| 3634 |
| 3635 /** |
| 3636 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3637 * string games#anonymousPlayer. |
| 3638 */ |
| 3639 core.String kind; |
| 3640 |
| 3641 |
| 3642 AnonymousPlayer(); |
| 3643 |
| 3644 AnonymousPlayer.fromJson(core.Map _json) { |
| 3645 if (_json.containsKey("avatarImageUrl")) { |
| 3646 avatarImageUrl = _json["avatarImageUrl"]; |
| 3647 } |
| 3648 if (_json.containsKey("displayName")) { |
| 3649 displayName = _json["displayName"]; |
| 3650 } |
| 3651 if (_json.containsKey("kind")) { |
| 3652 kind = _json["kind"]; |
| 3653 } |
| 3654 } |
| 3655 |
| 3656 core.Map toJson() { |
| 3657 var _json = new core.Map(); |
| 3658 if (avatarImageUrl != null) { |
| 3659 _json["avatarImageUrl"] = avatarImageUrl; |
| 3660 } |
| 3661 if (displayName != null) { |
| 3662 _json["displayName"] = displayName; |
| 3663 } |
| 3664 if (kind != null) { |
| 3665 _json["kind"] = kind; |
| 3666 } |
| 3667 return _json; |
| 3668 } |
| 3669 } |
| 3670 |
| 3671 |
| 3672 /** This is a JSON template for the Application resource. */ |
| 3673 class Application { |
| 3674 /** |
| 3675 * The number of achievements visible to the currently authenticated player. |
| 3676 */ |
| 3677 core.int achievementCount; |
| 3678 |
| 3679 /** The assets of the application. */ |
| 3680 core.List<ImageAsset> assets; |
| 3681 |
| 3682 /** The author of the application. */ |
| 3683 core.String author; |
| 3684 |
| 3685 /** The category of the application. */ |
| 3686 ApplicationCategory category; |
| 3687 |
| 3688 /** The description of the application. */ |
| 3689 core.String description; |
| 3690 |
| 3691 /** |
| 3692 * A list of features that have been enabled for the application. |
| 3693 * Possible values are: |
| 3694 * - "SNAPSHOTS" - Snapshots has been enabled |
| 3695 */ |
| 3696 core.List<core.String> enabledFeatures; |
| 3697 |
| 3698 /** The ID of the application. */ |
| 3699 core.String id; |
| 3700 |
| 3701 /** The instances of the application. */ |
| 3702 core.List<Instance> instances; |
| 3703 |
| 3704 /** |
| 3705 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3706 * string games#application. |
| 3707 */ |
| 3708 core.String kind; |
| 3709 |
| 3710 /** The last updated timestamp of the application. */ |
| 3711 core.String lastUpdatedTimestamp; |
| 3712 |
| 3713 /** |
| 3714 * The number of leaderboards visible to the currently authenticated player. |
| 3715 */ |
| 3716 core.int leaderboardCount; |
| 3717 |
| 3718 /** The name of the application. */ |
| 3719 core.String name; |
| 3720 |
| 3721 |
| 3722 Application(); |
| 3723 |
| 3724 Application.fromJson(core.Map _json) { |
| 3725 if (_json.containsKey("achievement_count")) { |
| 3726 achievementCount = _json["achievement_count"]; |
| 3727 } |
| 3728 if (_json.containsKey("assets")) { |
| 3729 assets = _json["assets"].map((value) => new ImageAsset.fromJson(value)).to
List(); |
| 3730 } |
| 3731 if (_json.containsKey("author")) { |
| 3732 author = _json["author"]; |
| 3733 } |
| 3734 if (_json.containsKey("category")) { |
| 3735 category = new ApplicationCategory.fromJson(_json["category"]); |
| 3736 } |
| 3737 if (_json.containsKey("description")) { |
| 3738 description = _json["description"]; |
| 3739 } |
| 3740 if (_json.containsKey("enabledFeatures")) { |
| 3741 enabledFeatures = _json["enabledFeatures"]; |
| 3742 } |
| 3743 if (_json.containsKey("id")) { |
| 3744 id = _json["id"]; |
| 3745 } |
| 3746 if (_json.containsKey("instances")) { |
| 3747 instances = _json["instances"].map((value) => new Instance.fromJson(value)
).toList(); |
| 3748 } |
| 3749 if (_json.containsKey("kind")) { |
| 3750 kind = _json["kind"]; |
| 3751 } |
| 3752 if (_json.containsKey("lastUpdatedTimestamp")) { |
| 3753 lastUpdatedTimestamp = _json["lastUpdatedTimestamp"]; |
| 3754 } |
| 3755 if (_json.containsKey("leaderboard_count")) { |
| 3756 leaderboardCount = _json["leaderboard_count"]; |
| 3757 } |
| 3758 if (_json.containsKey("name")) { |
| 3759 name = _json["name"]; |
| 3760 } |
| 3761 } |
| 3762 |
| 3763 core.Map toJson() { |
| 3764 var _json = new core.Map(); |
| 3765 if (achievementCount != null) { |
| 3766 _json["achievement_count"] = achievementCount; |
| 3767 } |
| 3768 if (assets != null) { |
| 3769 _json["assets"] = assets.map((value) => (value).toJson()).toList(); |
| 3770 } |
| 3771 if (author != null) { |
| 3772 _json["author"] = author; |
| 3773 } |
| 3774 if (category != null) { |
| 3775 _json["category"] = (category).toJson(); |
| 3776 } |
| 3777 if (description != null) { |
| 3778 _json["description"] = description; |
| 3779 } |
| 3780 if (enabledFeatures != null) { |
| 3781 _json["enabledFeatures"] = enabledFeatures; |
| 3782 } |
| 3783 if (id != null) { |
| 3784 _json["id"] = id; |
| 3785 } |
| 3786 if (instances != null) { |
| 3787 _json["instances"] = instances.map((value) => (value).toJson()).toList(); |
| 3788 } |
| 3789 if (kind != null) { |
| 3790 _json["kind"] = kind; |
| 3791 } |
| 3792 if (lastUpdatedTimestamp != null) { |
| 3793 _json["lastUpdatedTimestamp"] = lastUpdatedTimestamp; |
| 3794 } |
| 3795 if (leaderboardCount != null) { |
| 3796 _json["leaderboard_count"] = leaderboardCount; |
| 3797 } |
| 3798 if (name != null) { |
| 3799 _json["name"] = name; |
| 3800 } |
| 3801 return _json; |
| 3802 } |
| 3803 } |
| 3804 |
| 3805 |
| 3806 /** This is a JSON template for an application category object. */ |
| 3807 class ApplicationCategory { |
| 3808 /** |
| 3809 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3810 * string games#applicationCategory. |
| 3811 */ |
| 3812 core.String kind; |
| 3813 |
| 3814 /** The primary category. */ |
| 3815 core.String primary; |
| 3816 |
| 3817 /** The secondary category. */ |
| 3818 core.String secondary; |
| 3819 |
| 3820 |
| 3821 ApplicationCategory(); |
| 3822 |
| 3823 ApplicationCategory.fromJson(core.Map _json) { |
| 3824 if (_json.containsKey("kind")) { |
| 3825 kind = _json["kind"]; |
| 3826 } |
| 3827 if (_json.containsKey("primary")) { |
| 3828 primary = _json["primary"]; |
| 3829 } |
| 3830 if (_json.containsKey("secondary")) { |
| 3831 secondary = _json["secondary"]; |
| 3832 } |
| 3833 } |
| 3834 |
| 3835 core.Map toJson() { |
| 3836 var _json = new core.Map(); |
| 3837 if (kind != null) { |
| 3838 _json["kind"] = kind; |
| 3839 } |
| 3840 if (primary != null) { |
| 3841 _json["primary"] = primary; |
| 3842 } |
| 3843 if (secondary != null) { |
| 3844 _json["secondary"] = secondary; |
| 3845 } |
| 3846 return _json; |
| 3847 } |
| 3848 } |
| 3849 |
| 3850 |
| 3851 /** This is a JSON template for data related to individual game categories. */ |
| 3852 class Category { |
| 3853 /** The category name. */ |
| 3854 core.String category; |
| 3855 |
| 3856 /** Experience points earned in this category. */ |
| 3857 core.String experiencePoints; |
| 3858 |
| 3859 /** |
| 3860 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3861 * string games#category. |
| 3862 */ |
| 3863 core.String kind; |
| 3864 |
| 3865 |
| 3866 Category(); |
| 3867 |
| 3868 Category.fromJson(core.Map _json) { |
| 3869 if (_json.containsKey("category")) { |
| 3870 category = _json["category"]; |
| 3871 } |
| 3872 if (_json.containsKey("experiencePoints")) { |
| 3873 experiencePoints = _json["experiencePoints"]; |
| 3874 } |
| 3875 if (_json.containsKey("kind")) { |
| 3876 kind = _json["kind"]; |
| 3877 } |
| 3878 } |
| 3879 |
| 3880 core.Map toJson() { |
| 3881 var _json = new core.Map(); |
| 3882 if (category != null) { |
| 3883 _json["category"] = category; |
| 3884 } |
| 3885 if (experiencePoints != null) { |
| 3886 _json["experiencePoints"] = experiencePoints; |
| 3887 } |
| 3888 if (kind != null) { |
| 3889 _json["kind"] = kind; |
| 3890 } |
| 3891 return _json; |
| 3892 } |
| 3893 } |
| 3894 |
| 3895 |
| 3896 /** This is a JSON template for a list of category data objects. */ |
| 3897 class CategoryListResponse { |
| 3898 /** The list of categories with usage data. */ |
| 3899 core.List<Category> items; |
| 3900 |
| 3901 /** |
| 3902 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3903 * string games#categoryListResponse. |
| 3904 */ |
| 3905 core.String kind; |
| 3906 |
| 3907 /** Token corresponding to the next page of results. */ |
| 3908 core.String nextPageToken; |
| 3909 |
| 3910 |
| 3911 CategoryListResponse(); |
| 3912 |
| 3913 CategoryListResponse.fromJson(core.Map _json) { |
| 3914 if (_json.containsKey("items")) { |
| 3915 items = _json["items"].map((value) => new Category.fromJson(value)).toList
(); |
| 3916 } |
| 3917 if (_json.containsKey("kind")) { |
| 3918 kind = _json["kind"]; |
| 3919 } |
| 3920 if (_json.containsKey("nextPageToken")) { |
| 3921 nextPageToken = _json["nextPageToken"]; |
| 3922 } |
| 3923 } |
| 3924 |
| 3925 core.Map toJson() { |
| 3926 var _json = new core.Map(); |
| 3927 if (items != null) { |
| 3928 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 3929 } |
| 3930 if (kind != null) { |
| 3931 _json["kind"] = kind; |
| 3932 } |
| 3933 if (nextPageToken != null) { |
| 3934 _json["nextPageToken"] = nextPageToken; |
| 3935 } |
| 3936 return _json; |
| 3937 } |
| 3938 } |
| 3939 |
| 3940 |
| 3941 /** This is a JSON template for a batch update failure resource. */ |
| 3942 class EventBatchRecordFailure { |
| 3943 /** |
| 3944 * The cause for the update failure. |
| 3945 * Possible values are: |
| 3946 * - "TOO_LARGE": A batch request was issued with more events than are allowed |
| 3947 * in a single batch. |
| 3948 * - "TIME_PERIOD_EXPIRED": A batch was sent with data too far in the past to |
| 3949 * record. |
| 3950 * - "TIME_PERIOD_SHORT": A batch was sent with a time range that was too |
| 3951 * short. |
| 3952 * - "TIME_PERIOD_LONG": A batch was sent with a time range that was too long. |
| 3953 * - "ALREADY_UPDATED": An attempt was made to record a batch of data which |
| 3954 * was already seen. |
| 3955 * - "RECORD_RATE_HIGH": An attempt was made to record data faster than the |
| 3956 * server will apply updates. |
| 3957 */ |
| 3958 core.String failureCause; |
| 3959 |
| 3960 /** |
| 3961 * Uniquely identifies the type of this resource. Value is always the fixed |
| 3962 * string games#eventBatchRecordFailure. |
| 3963 */ |
| 3964 core.String kind; |
| 3965 |
| 3966 /** The time range which was rejected; empty for a request-wide failure. */ |
| 3967 EventPeriodRange range; |
| 3968 |
| 3969 |
| 3970 EventBatchRecordFailure(); |
| 3971 |
| 3972 EventBatchRecordFailure.fromJson(core.Map _json) { |
| 3973 if (_json.containsKey("failureCause")) { |
| 3974 failureCause = _json["failureCause"]; |
| 3975 } |
| 3976 if (_json.containsKey("kind")) { |
| 3977 kind = _json["kind"]; |
| 3978 } |
| 3979 if (_json.containsKey("range")) { |
| 3980 range = new EventPeriodRange.fromJson(_json["range"]); |
| 3981 } |
| 3982 } |
| 3983 |
| 3984 core.Map toJson() { |
| 3985 var _json = new core.Map(); |
| 3986 if (failureCause != null) { |
| 3987 _json["failureCause"] = failureCause; |
| 3988 } |
| 3989 if (kind != null) { |
| 3990 _json["kind"] = kind; |
| 3991 } |
| 3992 if (range != null) { |
| 3993 _json["range"] = (range).toJson(); |
| 3994 } |
| 3995 return _json; |
| 3996 } |
| 3997 } |
| 3998 |
| 3999 |
| 4000 /** This is a JSON template for an event child relationship resource. */ |
| 4001 class EventChild { |
| 4002 /** The ID of the child event. */ |
| 4003 core.String childId; |
| 4004 |
| 4005 /** |
| 4006 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4007 * string games#eventChild. |
| 4008 */ |
| 4009 core.String kind; |
| 4010 |
| 4011 |
| 4012 EventChild(); |
| 4013 |
| 4014 EventChild.fromJson(core.Map _json) { |
| 4015 if (_json.containsKey("childId")) { |
| 4016 childId = _json["childId"]; |
| 4017 } |
| 4018 if (_json.containsKey("kind")) { |
| 4019 kind = _json["kind"]; |
| 4020 } |
| 4021 } |
| 4022 |
| 4023 core.Map toJson() { |
| 4024 var _json = new core.Map(); |
| 4025 if (childId != null) { |
| 4026 _json["childId"] = childId; |
| 4027 } |
| 4028 if (kind != null) { |
| 4029 _json["kind"] = kind; |
| 4030 } |
| 4031 return _json; |
| 4032 } |
| 4033 } |
| 4034 |
| 4035 |
| 4036 /** This is a JSON template for an event definition resource. */ |
| 4037 class EventDefinition { |
| 4038 /** A list of events that are a child of this event. */ |
| 4039 core.List<EventChild> childEvents; |
| 4040 |
| 4041 /** Description of what this event represents. */ |
| 4042 core.String description; |
| 4043 |
| 4044 /** The name to display for the event. */ |
| 4045 core.String displayName; |
| 4046 |
| 4047 /** The ID of the event. */ |
| 4048 core.String id; |
| 4049 |
| 4050 /** The base URL for the image that represents the event. */ |
| 4051 core.String imageUrl; |
| 4052 |
| 4053 /** |
| 4054 * Indicates whether the icon image being returned is a default image, or is |
| 4055 * game-provided. |
| 4056 */ |
| 4057 core.bool isDefaultImageUrl; |
| 4058 |
| 4059 /** |
| 4060 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4061 * string games#eventDefinition. |
| 4062 */ |
| 4063 core.String kind; |
| 4064 |
| 4065 /** |
| 4066 * The visibility of event being tracked in this definition. |
| 4067 * Possible values are: |
| 4068 * - "REVEALED": This event should be visible to all users. |
| 4069 * - "HIDDEN": This event should only be shown to users that have recorded |
| 4070 * this event at least once. |
| 4071 */ |
| 4072 core.String visibility; |
| 4073 |
| 4074 |
| 4075 EventDefinition(); |
| 4076 |
| 4077 EventDefinition.fromJson(core.Map _json) { |
| 4078 if (_json.containsKey("childEvents")) { |
| 4079 childEvents = _json["childEvents"].map((value) => new EventChild.fromJson(
value)).toList(); |
| 4080 } |
| 4081 if (_json.containsKey("description")) { |
| 4082 description = _json["description"]; |
| 4083 } |
| 4084 if (_json.containsKey("displayName")) { |
| 4085 displayName = _json["displayName"]; |
| 4086 } |
| 4087 if (_json.containsKey("id")) { |
| 4088 id = _json["id"]; |
| 4089 } |
| 4090 if (_json.containsKey("imageUrl")) { |
| 4091 imageUrl = _json["imageUrl"]; |
| 4092 } |
| 4093 if (_json.containsKey("isDefaultImageUrl")) { |
| 4094 isDefaultImageUrl = _json["isDefaultImageUrl"]; |
| 4095 } |
| 4096 if (_json.containsKey("kind")) { |
| 4097 kind = _json["kind"]; |
| 4098 } |
| 4099 if (_json.containsKey("visibility")) { |
| 4100 visibility = _json["visibility"]; |
| 4101 } |
| 4102 } |
| 4103 |
| 4104 core.Map toJson() { |
| 4105 var _json = new core.Map(); |
| 4106 if (childEvents != null) { |
| 4107 _json["childEvents"] = childEvents.map((value) => (value).toJson()).toList
(); |
| 4108 } |
| 4109 if (description != null) { |
| 4110 _json["description"] = description; |
| 4111 } |
| 4112 if (displayName != null) { |
| 4113 _json["displayName"] = displayName; |
| 4114 } |
| 4115 if (id != null) { |
| 4116 _json["id"] = id; |
| 4117 } |
| 4118 if (imageUrl != null) { |
| 4119 _json["imageUrl"] = imageUrl; |
| 4120 } |
| 4121 if (isDefaultImageUrl != null) { |
| 4122 _json["isDefaultImageUrl"] = isDefaultImageUrl; |
| 4123 } |
| 4124 if (kind != null) { |
| 4125 _json["kind"] = kind; |
| 4126 } |
| 4127 if (visibility != null) { |
| 4128 _json["visibility"] = visibility; |
| 4129 } |
| 4130 return _json; |
| 4131 } |
| 4132 } |
| 4133 |
| 4134 |
| 4135 /** This is a JSON template for a ListDefinitions response. */ |
| 4136 class EventDefinitionListResponse { |
| 4137 /** The event definitions. */ |
| 4138 core.List<EventDefinition> items; |
| 4139 |
| 4140 /** |
| 4141 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4142 * string games#eventDefinitionListResponse. |
| 4143 */ |
| 4144 core.String kind; |
| 4145 |
| 4146 /** The pagination token for the next page of results. */ |
| 4147 core.String nextPageToken; |
| 4148 |
| 4149 |
| 4150 EventDefinitionListResponse(); |
| 4151 |
| 4152 EventDefinitionListResponse.fromJson(core.Map _json) { |
| 4153 if (_json.containsKey("items")) { |
| 4154 items = _json["items"].map((value) => new EventDefinition.fromJson(value))
.toList(); |
| 4155 } |
| 4156 if (_json.containsKey("kind")) { |
| 4157 kind = _json["kind"]; |
| 4158 } |
| 4159 if (_json.containsKey("nextPageToken")) { |
| 4160 nextPageToken = _json["nextPageToken"]; |
| 4161 } |
| 4162 } |
| 4163 |
| 4164 core.Map toJson() { |
| 4165 var _json = new core.Map(); |
| 4166 if (items != null) { |
| 4167 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 4168 } |
| 4169 if (kind != null) { |
| 4170 _json["kind"] = kind; |
| 4171 } |
| 4172 if (nextPageToken != null) { |
| 4173 _json["nextPageToken"] = nextPageToken; |
| 4174 } |
| 4175 return _json; |
| 4176 } |
| 4177 } |
| 4178 |
| 4179 |
| 4180 /** This is a JSON template for an event period time range. */ |
| 4181 class EventPeriodRange { |
| 4182 /** |
| 4183 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4184 * string games#eventPeriodRange. |
| 4185 */ |
| 4186 core.String kind; |
| 4187 |
| 4188 /** |
| 4189 * The time when this update period ends, in millis, since 1970 UTC (Unix |
| 4190 * Epoch). |
| 4191 */ |
| 4192 core.String periodEndMillis; |
| 4193 |
| 4194 /** |
| 4195 * The time when this update period begins, in millis, since 1970 UTC (Unix |
| 4196 * Epoch). |
| 4197 */ |
| 4198 core.String periodStartMillis; |
| 4199 |
| 4200 |
| 4201 EventPeriodRange(); |
| 4202 |
| 4203 EventPeriodRange.fromJson(core.Map _json) { |
| 4204 if (_json.containsKey("kind")) { |
| 4205 kind = _json["kind"]; |
| 4206 } |
| 4207 if (_json.containsKey("periodEndMillis")) { |
| 4208 periodEndMillis = _json["periodEndMillis"]; |
| 4209 } |
| 4210 if (_json.containsKey("periodStartMillis")) { |
| 4211 periodStartMillis = _json["periodStartMillis"]; |
| 4212 } |
| 4213 } |
| 4214 |
| 4215 core.Map toJson() { |
| 4216 var _json = new core.Map(); |
| 4217 if (kind != null) { |
| 4218 _json["kind"] = kind; |
| 4219 } |
| 4220 if (periodEndMillis != null) { |
| 4221 _json["periodEndMillis"] = periodEndMillis; |
| 4222 } |
| 4223 if (periodStartMillis != null) { |
| 4224 _json["periodStartMillis"] = periodStartMillis; |
| 4225 } |
| 4226 return _json; |
| 4227 } |
| 4228 } |
| 4229 |
| 4230 |
| 4231 /** This is a JSON template for an event period update resource. */ |
| 4232 class EventPeriodUpdate { |
| 4233 /** |
| 4234 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4235 * string games#eventPeriodUpdate. |
| 4236 */ |
| 4237 core.String kind; |
| 4238 |
| 4239 /** The time period being covered by this update. */ |
| 4240 EventPeriodRange timePeriod; |
| 4241 |
| 4242 /** The updates being made for this time period. */ |
| 4243 core.List<EventUpdateRequest> updates; |
| 4244 |
| 4245 |
| 4246 EventPeriodUpdate(); |
| 4247 |
| 4248 EventPeriodUpdate.fromJson(core.Map _json) { |
| 4249 if (_json.containsKey("kind")) { |
| 4250 kind = _json["kind"]; |
| 4251 } |
| 4252 if (_json.containsKey("timePeriod")) { |
| 4253 timePeriod = new EventPeriodRange.fromJson(_json["timePeriod"]); |
| 4254 } |
| 4255 if (_json.containsKey("updates")) { |
| 4256 updates = _json["updates"].map((value) => new EventUpdateRequest.fromJson(
value)).toList(); |
| 4257 } |
| 4258 } |
| 4259 |
| 4260 core.Map toJson() { |
| 4261 var _json = new core.Map(); |
| 4262 if (kind != null) { |
| 4263 _json["kind"] = kind; |
| 4264 } |
| 4265 if (timePeriod != null) { |
| 4266 _json["timePeriod"] = (timePeriod).toJson(); |
| 4267 } |
| 4268 if (updates != null) { |
| 4269 _json["updates"] = updates.map((value) => (value).toJson()).toList(); |
| 4270 } |
| 4271 return _json; |
| 4272 } |
| 4273 } |
| 4274 |
| 4275 |
| 4276 /** This is a JSON template for an event update failure resource. */ |
| 4277 class EventRecordFailure { |
| 4278 /** The ID of the event that was not updated. */ |
| 4279 core.String eventId; |
| 4280 |
| 4281 /** |
| 4282 * The cause for the update failure. |
| 4283 * Possible values are: |
| 4284 * - "NOT_FOUND" - An attempt was made to set an event that was not defined. |
| 4285 * - "INVALID_UPDATE_VALUE" - An attempt was made to increment an event by a |
| 4286 * non-positive value. |
| 4287 */ |
| 4288 core.String failureCause; |
| 4289 |
| 4290 /** |
| 4291 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4292 * string games#eventRecordFailure. |
| 4293 */ |
| 4294 core.String kind; |
| 4295 |
| 4296 |
| 4297 EventRecordFailure(); |
| 4298 |
| 4299 EventRecordFailure.fromJson(core.Map _json) { |
| 4300 if (_json.containsKey("eventId")) { |
| 4301 eventId = _json["eventId"]; |
| 4302 } |
| 4303 if (_json.containsKey("failureCause")) { |
| 4304 failureCause = _json["failureCause"]; |
| 4305 } |
| 4306 if (_json.containsKey("kind")) { |
| 4307 kind = _json["kind"]; |
| 4308 } |
| 4309 } |
| 4310 |
| 4311 core.Map toJson() { |
| 4312 var _json = new core.Map(); |
| 4313 if (eventId != null) { |
| 4314 _json["eventId"] = eventId; |
| 4315 } |
| 4316 if (failureCause != null) { |
| 4317 _json["failureCause"] = failureCause; |
| 4318 } |
| 4319 if (kind != null) { |
| 4320 _json["kind"] = kind; |
| 4321 } |
| 4322 return _json; |
| 4323 } |
| 4324 } |
| 4325 |
| 4326 |
| 4327 /** This is a JSON template for an event period update resource. */ |
| 4328 class EventRecordRequest { |
| 4329 /** |
| 4330 * The current time when this update was sent, in milliseconds, since 1970 UTC |
| 4331 * (Unix Epoch). |
| 4332 */ |
| 4333 core.String currentTimeMillis; |
| 4334 |
| 4335 /** |
| 4336 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4337 * string games#eventRecordRequest. |
| 4338 */ |
| 4339 core.String kind; |
| 4340 |
| 4341 /** The request ID used to identify this attempt to record events. */ |
| 4342 core.String requestId; |
| 4343 |
| 4344 /** A list of the time period updates being made in this request. */ |
| 4345 core.List<EventPeriodUpdate> timePeriods; |
| 4346 |
| 4347 |
| 4348 EventRecordRequest(); |
| 4349 |
| 4350 EventRecordRequest.fromJson(core.Map _json) { |
| 4351 if (_json.containsKey("currentTimeMillis")) { |
| 4352 currentTimeMillis = _json["currentTimeMillis"]; |
| 4353 } |
| 4354 if (_json.containsKey("kind")) { |
| 4355 kind = _json["kind"]; |
| 4356 } |
| 4357 if (_json.containsKey("requestId")) { |
| 4358 requestId = _json["requestId"]; |
| 4359 } |
| 4360 if (_json.containsKey("timePeriods")) { |
| 4361 timePeriods = _json["timePeriods"].map((value) => new EventPeriodUpdate.fr
omJson(value)).toList(); |
| 4362 } |
| 4363 } |
| 4364 |
| 4365 core.Map toJson() { |
| 4366 var _json = new core.Map(); |
| 4367 if (currentTimeMillis != null) { |
| 4368 _json["currentTimeMillis"] = currentTimeMillis; |
| 4369 } |
| 4370 if (kind != null) { |
| 4371 _json["kind"] = kind; |
| 4372 } |
| 4373 if (requestId != null) { |
| 4374 _json["requestId"] = requestId; |
| 4375 } |
| 4376 if (timePeriods != null) { |
| 4377 _json["timePeriods"] = timePeriods.map((value) => (value).toJson()).toList
(); |
| 4378 } |
| 4379 return _json; |
| 4380 } |
| 4381 } |
| 4382 |
| 4383 |
| 4384 /** This is a JSON template for an event period update resource. */ |
| 4385 class EventUpdateRequest { |
| 4386 /** The ID of the event being modified in this update. */ |
| 4387 core.String definitionId; |
| 4388 |
| 4389 /** |
| 4390 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4391 * string games#eventUpdateRequest. |
| 4392 */ |
| 4393 core.String kind; |
| 4394 |
| 4395 /** The number of times this event occurred in this time period. */ |
| 4396 core.String updateCount; |
| 4397 |
| 4398 |
| 4399 EventUpdateRequest(); |
| 4400 |
| 4401 EventUpdateRequest.fromJson(core.Map _json) { |
| 4402 if (_json.containsKey("definitionId")) { |
| 4403 definitionId = _json["definitionId"]; |
| 4404 } |
| 4405 if (_json.containsKey("kind")) { |
| 4406 kind = _json["kind"]; |
| 4407 } |
| 4408 if (_json.containsKey("updateCount")) { |
| 4409 updateCount = _json["updateCount"]; |
| 4410 } |
| 4411 } |
| 4412 |
| 4413 core.Map toJson() { |
| 4414 var _json = new core.Map(); |
| 4415 if (definitionId != null) { |
| 4416 _json["definitionId"] = definitionId; |
| 4417 } |
| 4418 if (kind != null) { |
| 4419 _json["kind"] = kind; |
| 4420 } |
| 4421 if (updateCount != null) { |
| 4422 _json["updateCount"] = updateCount; |
| 4423 } |
| 4424 return _json; |
| 4425 } |
| 4426 } |
| 4427 |
| 4428 |
| 4429 /** This is a JSON template for an event period update resource. */ |
| 4430 class EventUpdateResponse { |
| 4431 /** Any batch-wide failures which occurred applying updates. */ |
| 4432 core.List<EventBatchRecordFailure> batchFailures; |
| 4433 |
| 4434 /** Any failures updating a particular event. */ |
| 4435 core.List<EventRecordFailure> eventFailures; |
| 4436 |
| 4437 /** |
| 4438 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4439 * string games#eventUpdateResponse. |
| 4440 */ |
| 4441 core.String kind; |
| 4442 |
| 4443 /** The current status of any updated events */ |
| 4444 core.List<PlayerEvent> playerEvents; |
| 4445 |
| 4446 |
| 4447 EventUpdateResponse(); |
| 4448 |
| 4449 EventUpdateResponse.fromJson(core.Map _json) { |
| 4450 if (_json.containsKey("batchFailures")) { |
| 4451 batchFailures = _json["batchFailures"].map((value) => new EventBatchRecord
Failure.fromJson(value)).toList(); |
| 4452 } |
| 4453 if (_json.containsKey("eventFailures")) { |
| 4454 eventFailures = _json["eventFailures"].map((value) => new EventRecordFailu
re.fromJson(value)).toList(); |
| 4455 } |
| 4456 if (_json.containsKey("kind")) { |
| 4457 kind = _json["kind"]; |
| 4458 } |
| 4459 if (_json.containsKey("playerEvents")) { |
| 4460 playerEvents = _json["playerEvents"].map((value) => new PlayerEvent.fromJs
on(value)).toList(); |
| 4461 } |
| 4462 } |
| 4463 |
| 4464 core.Map toJson() { |
| 4465 var _json = new core.Map(); |
| 4466 if (batchFailures != null) { |
| 4467 _json["batchFailures"] = batchFailures.map((value) => (value).toJson()).to
List(); |
| 4468 } |
| 4469 if (eventFailures != null) { |
| 4470 _json["eventFailures"] = eventFailures.map((value) => (value).toJson()).to
List(); |
| 4471 } |
| 4472 if (kind != null) { |
| 4473 _json["kind"] = kind; |
| 4474 } |
| 4475 if (playerEvents != null) { |
| 4476 _json["playerEvents"] = playerEvents.map((value) => (value).toJson()).toLi
st(); |
| 4477 } |
| 4478 return _json; |
| 4479 } |
| 4480 } |
| 4481 |
| 4482 |
| 4483 /** |
| 4484 * This is a JSON template for the payload to request to increment an |
| 4485 * achievement. |
| 4486 */ |
| 4487 class GamesAchievementIncrement { |
| 4488 /** |
| 4489 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4490 * string games#GamesAchievementIncrement. |
| 4491 */ |
| 4492 core.String kind; |
| 4493 |
| 4494 /** The requestId associated with an increment to an achievement. */ |
| 4495 core.String requestId; |
| 4496 |
| 4497 /** The number of steps to be incremented. */ |
| 4498 core.int steps; |
| 4499 |
| 4500 |
| 4501 GamesAchievementIncrement(); |
| 4502 |
| 4503 GamesAchievementIncrement.fromJson(core.Map _json) { |
| 4504 if (_json.containsKey("kind")) { |
| 4505 kind = _json["kind"]; |
| 4506 } |
| 4507 if (_json.containsKey("requestId")) { |
| 4508 requestId = _json["requestId"]; |
| 4509 } |
| 4510 if (_json.containsKey("steps")) { |
| 4511 steps = _json["steps"]; |
| 4512 } |
| 4513 } |
| 4514 |
| 4515 core.Map toJson() { |
| 4516 var _json = new core.Map(); |
| 4517 if (kind != null) { |
| 4518 _json["kind"] = kind; |
| 4519 } |
| 4520 if (requestId != null) { |
| 4521 _json["requestId"] = requestId; |
| 4522 } |
| 4523 if (steps != null) { |
| 4524 _json["steps"] = steps; |
| 4525 } |
| 4526 return _json; |
| 4527 } |
| 4528 } |
| 4529 |
| 4530 |
| 4531 /** |
| 4532 * This is a JSON template for the payload to request to increment an |
| 4533 * achievement. |
| 4534 */ |
| 4535 class GamesAchievementSetStepsAtLeast { |
| 4536 /** |
| 4537 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4538 * string games#GamesAchievementSetStepsAtLeast. |
| 4539 */ |
| 4540 core.String kind; |
| 4541 |
| 4542 /** The minimum number of steps for the achievement to be set to. */ |
| 4543 core.int steps; |
| 4544 |
| 4545 |
| 4546 GamesAchievementSetStepsAtLeast(); |
| 4547 |
| 4548 GamesAchievementSetStepsAtLeast.fromJson(core.Map _json) { |
| 4549 if (_json.containsKey("kind")) { |
| 4550 kind = _json["kind"]; |
| 4551 } |
| 4552 if (_json.containsKey("steps")) { |
| 4553 steps = _json["steps"]; |
| 4554 } |
| 4555 } |
| 4556 |
| 4557 core.Map toJson() { |
| 4558 var _json = new core.Map(); |
| 4559 if (kind != null) { |
| 4560 _json["kind"] = kind; |
| 4561 } |
| 4562 if (steps != null) { |
| 4563 _json["steps"] = steps; |
| 4564 } |
| 4565 return _json; |
| 4566 } |
| 4567 } |
| 4568 |
| 4569 |
| 4570 /** This is a JSON template for an image asset object. */ |
| 4571 class ImageAsset { |
| 4572 /** The height of the asset. */ |
| 4573 core.int height; |
| 4574 |
| 4575 /** |
| 4576 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4577 * string games#imageAsset. |
| 4578 */ |
| 4579 core.String kind; |
| 4580 |
| 4581 /** The name of the asset. */ |
| 4582 core.String name; |
| 4583 |
| 4584 /** The URL of the asset. */ |
| 4585 core.String url; |
| 4586 |
| 4587 /** The width of the asset. */ |
| 4588 core.int width; |
| 4589 |
| 4590 |
| 4591 ImageAsset(); |
| 4592 |
| 4593 ImageAsset.fromJson(core.Map _json) { |
| 4594 if (_json.containsKey("height")) { |
| 4595 height = _json["height"]; |
| 4596 } |
| 4597 if (_json.containsKey("kind")) { |
| 4598 kind = _json["kind"]; |
| 4599 } |
| 4600 if (_json.containsKey("name")) { |
| 4601 name = _json["name"]; |
| 4602 } |
| 4603 if (_json.containsKey("url")) { |
| 4604 url = _json["url"]; |
| 4605 } |
| 4606 if (_json.containsKey("width")) { |
| 4607 width = _json["width"]; |
| 4608 } |
| 4609 } |
| 4610 |
| 4611 core.Map toJson() { |
| 4612 var _json = new core.Map(); |
| 4613 if (height != null) { |
| 4614 _json["height"] = height; |
| 4615 } |
| 4616 if (kind != null) { |
| 4617 _json["kind"] = kind; |
| 4618 } |
| 4619 if (name != null) { |
| 4620 _json["name"] = name; |
| 4621 } |
| 4622 if (url != null) { |
| 4623 _json["url"] = url; |
| 4624 } |
| 4625 if (width != null) { |
| 4626 _json["width"] = width; |
| 4627 } |
| 4628 return _json; |
| 4629 } |
| 4630 } |
| 4631 |
| 4632 |
| 4633 /** This is a JSON template for the Instance resource. */ |
| 4634 class Instance { |
| 4635 /** URI which shows where a user can acquire this instance. */ |
| 4636 core.String acquisitionUri; |
| 4637 |
| 4638 /** Platform dependent details for Android. */ |
| 4639 InstanceAndroidDetails androidInstance; |
| 4640 |
| 4641 /** Platform dependent details for iOS. */ |
| 4642 InstanceIosDetails iosInstance; |
| 4643 |
| 4644 /** |
| 4645 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4646 * string games#instance. |
| 4647 */ |
| 4648 core.String kind; |
| 4649 |
| 4650 /** Localized display name. */ |
| 4651 core.String name; |
| 4652 |
| 4653 /** |
| 4654 * The platform type. |
| 4655 * Possible values are: |
| 4656 * - "ANDROID" - Instance is for Android. |
| 4657 * - "IOS" - Instance is for iOS |
| 4658 * - "WEB_APP" - Instance is for Web App. |
| 4659 */ |
| 4660 core.String platformType; |
| 4661 |
| 4662 /** Flag to show if this game instance supports realtime play. */ |
| 4663 core.bool realtimePlay; |
| 4664 |
| 4665 /** Flag to show if this game instance supports turn based play. */ |
| 4666 core.bool turnBasedPlay; |
| 4667 |
| 4668 /** Platform dependent details for Web. */ |
| 4669 InstanceWebDetails webInstance; |
| 4670 |
| 4671 |
| 4672 Instance(); |
| 4673 |
| 4674 Instance.fromJson(core.Map _json) { |
| 4675 if (_json.containsKey("acquisitionUri")) { |
| 4676 acquisitionUri = _json["acquisitionUri"]; |
| 4677 } |
| 4678 if (_json.containsKey("androidInstance")) { |
| 4679 androidInstance = new InstanceAndroidDetails.fromJson(_json["androidInstan
ce"]); |
| 4680 } |
| 4681 if (_json.containsKey("iosInstance")) { |
| 4682 iosInstance = new InstanceIosDetails.fromJson(_json["iosInstance"]); |
| 4683 } |
| 4684 if (_json.containsKey("kind")) { |
| 4685 kind = _json["kind"]; |
| 4686 } |
| 4687 if (_json.containsKey("name")) { |
| 4688 name = _json["name"]; |
| 4689 } |
| 4690 if (_json.containsKey("platformType")) { |
| 4691 platformType = _json["platformType"]; |
| 4692 } |
| 4693 if (_json.containsKey("realtimePlay")) { |
| 4694 realtimePlay = _json["realtimePlay"]; |
| 4695 } |
| 4696 if (_json.containsKey("turnBasedPlay")) { |
| 4697 turnBasedPlay = _json["turnBasedPlay"]; |
| 4698 } |
| 4699 if (_json.containsKey("webInstance")) { |
| 4700 webInstance = new InstanceWebDetails.fromJson(_json["webInstance"]); |
| 4701 } |
| 4702 } |
| 4703 |
| 4704 core.Map toJson() { |
| 4705 var _json = new core.Map(); |
| 4706 if (acquisitionUri != null) { |
| 4707 _json["acquisitionUri"] = acquisitionUri; |
| 4708 } |
| 4709 if (androidInstance != null) { |
| 4710 _json["androidInstance"] = (androidInstance).toJson(); |
| 4711 } |
| 4712 if (iosInstance != null) { |
| 4713 _json["iosInstance"] = (iosInstance).toJson(); |
| 4714 } |
| 4715 if (kind != null) { |
| 4716 _json["kind"] = kind; |
| 4717 } |
| 4718 if (name != null) { |
| 4719 _json["name"] = name; |
| 4720 } |
| 4721 if (platformType != null) { |
| 4722 _json["platformType"] = platformType; |
| 4723 } |
| 4724 if (realtimePlay != null) { |
| 4725 _json["realtimePlay"] = realtimePlay; |
| 4726 } |
| 4727 if (turnBasedPlay != null) { |
| 4728 _json["turnBasedPlay"] = turnBasedPlay; |
| 4729 } |
| 4730 if (webInstance != null) { |
| 4731 _json["webInstance"] = (webInstance).toJson(); |
| 4732 } |
| 4733 return _json; |
| 4734 } |
| 4735 } |
| 4736 |
| 4737 |
| 4738 /** This is a JSON template for the Android instance details resource. */ |
| 4739 class InstanceAndroidDetails { |
| 4740 /** Flag indicating whether the anti-piracy check is enabled. */ |
| 4741 core.bool enablePiracyCheck; |
| 4742 |
| 4743 /** |
| 4744 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4745 * string games#instanceAndroidDetails. |
| 4746 */ |
| 4747 core.String kind; |
| 4748 |
| 4749 /** Android package name which maps to Google Play URL. */ |
| 4750 core.String packageName; |
| 4751 |
| 4752 /** Indicates that this instance is the default for new installations. */ |
| 4753 core.bool preferred; |
| 4754 |
| 4755 |
| 4756 InstanceAndroidDetails(); |
| 4757 |
| 4758 InstanceAndroidDetails.fromJson(core.Map _json) { |
| 4759 if (_json.containsKey("enablePiracyCheck")) { |
| 4760 enablePiracyCheck = _json["enablePiracyCheck"]; |
| 4761 } |
| 4762 if (_json.containsKey("kind")) { |
| 4763 kind = _json["kind"]; |
| 4764 } |
| 4765 if (_json.containsKey("packageName")) { |
| 4766 packageName = _json["packageName"]; |
| 4767 } |
| 4768 if (_json.containsKey("preferred")) { |
| 4769 preferred = _json["preferred"]; |
| 4770 } |
| 4771 } |
| 4772 |
| 4773 core.Map toJson() { |
| 4774 var _json = new core.Map(); |
| 4775 if (enablePiracyCheck != null) { |
| 4776 _json["enablePiracyCheck"] = enablePiracyCheck; |
| 4777 } |
| 4778 if (kind != null) { |
| 4779 _json["kind"] = kind; |
| 4780 } |
| 4781 if (packageName != null) { |
| 4782 _json["packageName"] = packageName; |
| 4783 } |
| 4784 if (preferred != null) { |
| 4785 _json["preferred"] = preferred; |
| 4786 } |
| 4787 return _json; |
| 4788 } |
| 4789 } |
| 4790 |
| 4791 |
| 4792 /** This is a JSON template for the iOS details resource. */ |
| 4793 class InstanceIosDetails { |
| 4794 /** Bundle identifier. */ |
| 4795 core.String bundleIdentifier; |
| 4796 |
| 4797 /** iTunes App ID. */ |
| 4798 core.String itunesAppId; |
| 4799 |
| 4800 /** |
| 4801 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4802 * string games#instanceIosDetails. |
| 4803 */ |
| 4804 core.String kind; |
| 4805 |
| 4806 /** |
| 4807 * Indicates that this instance is the default for new installations on iPad |
| 4808 * devices. |
| 4809 */ |
| 4810 core.bool preferredForIpad; |
| 4811 |
| 4812 /** |
| 4813 * Indicates that this instance is the default for new installations on iPhone |
| 4814 * devices. |
| 4815 */ |
| 4816 core.bool preferredForIphone; |
| 4817 |
| 4818 /** Flag to indicate if this instance supports iPad. */ |
| 4819 core.bool supportIpad; |
| 4820 |
| 4821 /** Flag to indicate if this instance supports iPhone. */ |
| 4822 core.bool supportIphone; |
| 4823 |
| 4824 |
| 4825 InstanceIosDetails(); |
| 4826 |
| 4827 InstanceIosDetails.fromJson(core.Map _json) { |
| 4828 if (_json.containsKey("bundleIdentifier")) { |
| 4829 bundleIdentifier = _json["bundleIdentifier"]; |
| 4830 } |
| 4831 if (_json.containsKey("itunesAppId")) { |
| 4832 itunesAppId = _json["itunesAppId"]; |
| 4833 } |
| 4834 if (_json.containsKey("kind")) { |
| 4835 kind = _json["kind"]; |
| 4836 } |
| 4837 if (_json.containsKey("preferredForIpad")) { |
| 4838 preferredForIpad = _json["preferredForIpad"]; |
| 4839 } |
| 4840 if (_json.containsKey("preferredForIphone")) { |
| 4841 preferredForIphone = _json["preferredForIphone"]; |
| 4842 } |
| 4843 if (_json.containsKey("supportIpad")) { |
| 4844 supportIpad = _json["supportIpad"]; |
| 4845 } |
| 4846 if (_json.containsKey("supportIphone")) { |
| 4847 supportIphone = _json["supportIphone"]; |
| 4848 } |
| 4849 } |
| 4850 |
| 4851 core.Map toJson() { |
| 4852 var _json = new core.Map(); |
| 4853 if (bundleIdentifier != null) { |
| 4854 _json["bundleIdentifier"] = bundleIdentifier; |
| 4855 } |
| 4856 if (itunesAppId != null) { |
| 4857 _json["itunesAppId"] = itunesAppId; |
| 4858 } |
| 4859 if (kind != null) { |
| 4860 _json["kind"] = kind; |
| 4861 } |
| 4862 if (preferredForIpad != null) { |
| 4863 _json["preferredForIpad"] = preferredForIpad; |
| 4864 } |
| 4865 if (preferredForIphone != null) { |
| 4866 _json["preferredForIphone"] = preferredForIphone; |
| 4867 } |
| 4868 if (supportIpad != null) { |
| 4869 _json["supportIpad"] = supportIpad; |
| 4870 } |
| 4871 if (supportIphone != null) { |
| 4872 _json["supportIphone"] = supportIphone; |
| 4873 } |
| 4874 return _json; |
| 4875 } |
| 4876 } |
| 4877 |
| 4878 |
| 4879 /** This is a JSON template for the Web details resource. */ |
| 4880 class InstanceWebDetails { |
| 4881 /** |
| 4882 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4883 * string games#instanceWebDetails. |
| 4884 */ |
| 4885 core.String kind; |
| 4886 |
| 4887 /** Launch URL for the game. */ |
| 4888 core.String launchUrl; |
| 4889 |
| 4890 /** Indicates that this instance is the default for new installations. */ |
| 4891 core.bool preferred; |
| 4892 |
| 4893 |
| 4894 InstanceWebDetails(); |
| 4895 |
| 4896 InstanceWebDetails.fromJson(core.Map _json) { |
| 4897 if (_json.containsKey("kind")) { |
| 4898 kind = _json["kind"]; |
| 4899 } |
| 4900 if (_json.containsKey("launchUrl")) { |
| 4901 launchUrl = _json["launchUrl"]; |
| 4902 } |
| 4903 if (_json.containsKey("preferred")) { |
| 4904 preferred = _json["preferred"]; |
| 4905 } |
| 4906 } |
| 4907 |
| 4908 core.Map toJson() { |
| 4909 var _json = new core.Map(); |
| 4910 if (kind != null) { |
| 4911 _json["kind"] = kind; |
| 4912 } |
| 4913 if (launchUrl != null) { |
| 4914 _json["launchUrl"] = launchUrl; |
| 4915 } |
| 4916 if (preferred != null) { |
| 4917 _json["preferred"] = preferred; |
| 4918 } |
| 4919 return _json; |
| 4920 } |
| 4921 } |
| 4922 |
| 4923 |
| 4924 /** This is a JSON template for the Leaderboard resource. */ |
| 4925 class Leaderboard { |
| 4926 /** The icon for the leaderboard. */ |
| 4927 core.String iconUrl; |
| 4928 |
| 4929 /** The leaderboard ID. */ |
| 4930 core.String id; |
| 4931 |
| 4932 /** |
| 4933 * Indicates whether the icon image being returned is a default image, or is |
| 4934 * game-provided. |
| 4935 */ |
| 4936 core.bool isIconUrlDefault; |
| 4937 |
| 4938 /** |
| 4939 * Uniquely identifies the type of this resource. Value is always the fixed |
| 4940 * string games#leaderboard. |
| 4941 */ |
| 4942 core.String kind; |
| 4943 |
| 4944 /** The name of the leaderboard. */ |
| 4945 core.String name; |
| 4946 |
| 4947 /** |
| 4948 * How scores are ordered. |
| 4949 * Possible values are: |
| 4950 * - "LARGER_IS_BETTER" - Larger values are better; scores are sorted in |
| 4951 * descending order. |
| 4952 * - "SMALLER_IS_BETTER" - Smaller values are better; scores are sorted in |
| 4953 * ascending order. |
| 4954 */ |
| 4955 core.String order; |
| 4956 |
| 4957 |
| 4958 Leaderboard(); |
| 4959 |
| 4960 Leaderboard.fromJson(core.Map _json) { |
| 4961 if (_json.containsKey("iconUrl")) { |
| 4962 iconUrl = _json["iconUrl"]; |
| 4963 } |
| 4964 if (_json.containsKey("id")) { |
| 4965 id = _json["id"]; |
| 4966 } |
| 4967 if (_json.containsKey("isIconUrlDefault")) { |
| 4968 isIconUrlDefault = _json["isIconUrlDefault"]; |
| 4969 } |
| 4970 if (_json.containsKey("kind")) { |
| 4971 kind = _json["kind"]; |
| 4972 } |
| 4973 if (_json.containsKey("name")) { |
| 4974 name = _json["name"]; |
| 4975 } |
| 4976 if (_json.containsKey("order")) { |
| 4977 order = _json["order"]; |
| 4978 } |
| 4979 } |
| 4980 |
| 4981 core.Map toJson() { |
| 4982 var _json = new core.Map(); |
| 4983 if (iconUrl != null) { |
| 4984 _json["iconUrl"] = iconUrl; |
| 4985 } |
| 4986 if (id != null) { |
| 4987 _json["id"] = id; |
| 4988 } |
| 4989 if (isIconUrlDefault != null) { |
| 4990 _json["isIconUrlDefault"] = isIconUrlDefault; |
| 4991 } |
| 4992 if (kind != null) { |
| 4993 _json["kind"] = kind; |
| 4994 } |
| 4995 if (name != null) { |
| 4996 _json["name"] = name; |
| 4997 } |
| 4998 if (order != null) { |
| 4999 _json["order"] = order; |
| 5000 } |
| 5001 return _json; |
| 5002 } |
| 5003 } |
| 5004 |
| 5005 |
| 5006 /** This is a JSON template for the Leaderboard Entry resource. */ |
| 5007 class LeaderboardEntry { |
| 5008 /** The localized string for the numerical value of this score. */ |
| 5009 core.String formattedScore; |
| 5010 |
| 5011 /** The localized string for the rank of this score for this leaderboard. */ |
| 5012 core.String formattedScoreRank; |
| 5013 |
| 5014 /** |
| 5015 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5016 * string games#leaderboardEntry. |
| 5017 */ |
| 5018 core.String kind; |
| 5019 |
| 5020 /** The player who holds this score. */ |
| 5021 Player player; |
| 5022 |
| 5023 /** The rank of this score for this leaderboard. */ |
| 5024 core.String scoreRank; |
| 5025 |
| 5026 /** |
| 5027 * Additional information about the score. Values must contain no more than 64 |
| 5028 * URI-safe characters as defined by section 2.3 of RFC 3986. |
| 5029 */ |
| 5030 core.String scoreTag; |
| 5031 |
| 5032 /** The numerical value of this score. */ |
| 5033 core.String scoreValue; |
| 5034 |
| 5035 /** |
| 5036 * The time span of this high score. |
| 5037 * Possible values are: |
| 5038 * - "ALL_TIME" - The score is an all-time high score. |
| 5039 * - "WEEKLY" - The score is a weekly high score. |
| 5040 * - "DAILY" - The score is a daily high score. |
| 5041 */ |
| 5042 core.String timeSpan; |
| 5043 |
| 5044 /** |
| 5045 * The timestamp at which this score was recorded, in milliseconds since the |
| 5046 * epoch in UTC. |
| 5047 */ |
| 5048 core.String writeTimestampMillis; |
| 5049 |
| 5050 |
| 5051 LeaderboardEntry(); |
| 5052 |
| 5053 LeaderboardEntry.fromJson(core.Map _json) { |
| 5054 if (_json.containsKey("formattedScore")) { |
| 5055 formattedScore = _json["formattedScore"]; |
| 5056 } |
| 5057 if (_json.containsKey("formattedScoreRank")) { |
| 5058 formattedScoreRank = _json["formattedScoreRank"]; |
| 5059 } |
| 5060 if (_json.containsKey("kind")) { |
| 5061 kind = _json["kind"]; |
| 5062 } |
| 5063 if (_json.containsKey("player")) { |
| 5064 player = new Player.fromJson(_json["player"]); |
| 5065 } |
| 5066 if (_json.containsKey("scoreRank")) { |
| 5067 scoreRank = _json["scoreRank"]; |
| 5068 } |
| 5069 if (_json.containsKey("scoreTag")) { |
| 5070 scoreTag = _json["scoreTag"]; |
| 5071 } |
| 5072 if (_json.containsKey("scoreValue")) { |
| 5073 scoreValue = _json["scoreValue"]; |
| 5074 } |
| 5075 if (_json.containsKey("timeSpan")) { |
| 5076 timeSpan = _json["timeSpan"]; |
| 5077 } |
| 5078 if (_json.containsKey("writeTimestampMillis")) { |
| 5079 writeTimestampMillis = _json["writeTimestampMillis"]; |
| 5080 } |
| 5081 } |
| 5082 |
| 5083 core.Map toJson() { |
| 5084 var _json = new core.Map(); |
| 5085 if (formattedScore != null) { |
| 5086 _json["formattedScore"] = formattedScore; |
| 5087 } |
| 5088 if (formattedScoreRank != null) { |
| 5089 _json["formattedScoreRank"] = formattedScoreRank; |
| 5090 } |
| 5091 if (kind != null) { |
| 5092 _json["kind"] = kind; |
| 5093 } |
| 5094 if (player != null) { |
| 5095 _json["player"] = (player).toJson(); |
| 5096 } |
| 5097 if (scoreRank != null) { |
| 5098 _json["scoreRank"] = scoreRank; |
| 5099 } |
| 5100 if (scoreTag != null) { |
| 5101 _json["scoreTag"] = scoreTag; |
| 5102 } |
| 5103 if (scoreValue != null) { |
| 5104 _json["scoreValue"] = scoreValue; |
| 5105 } |
| 5106 if (timeSpan != null) { |
| 5107 _json["timeSpan"] = timeSpan; |
| 5108 } |
| 5109 if (writeTimestampMillis != null) { |
| 5110 _json["writeTimestampMillis"] = writeTimestampMillis; |
| 5111 } |
| 5112 return _json; |
| 5113 } |
| 5114 } |
| 5115 |
| 5116 |
| 5117 /** This is a JSON template for a list of leaderboard objects. */ |
| 5118 class LeaderboardListResponse { |
| 5119 /** The leaderboards. */ |
| 5120 core.List<Leaderboard> items; |
| 5121 |
| 5122 /** |
| 5123 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5124 * string games#leaderboardListResponse. |
| 5125 */ |
| 5126 core.String kind; |
| 5127 |
| 5128 /** Token corresponding to the next page of results. */ |
| 5129 core.String nextPageToken; |
| 5130 |
| 5131 |
| 5132 LeaderboardListResponse(); |
| 5133 |
| 5134 LeaderboardListResponse.fromJson(core.Map _json) { |
| 5135 if (_json.containsKey("items")) { |
| 5136 items = _json["items"].map((value) => new Leaderboard.fromJson(value)).toL
ist(); |
| 5137 } |
| 5138 if (_json.containsKey("kind")) { |
| 5139 kind = _json["kind"]; |
| 5140 } |
| 5141 if (_json.containsKey("nextPageToken")) { |
| 5142 nextPageToken = _json["nextPageToken"]; |
| 5143 } |
| 5144 } |
| 5145 |
| 5146 core.Map toJson() { |
| 5147 var _json = new core.Map(); |
| 5148 if (items != null) { |
| 5149 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 5150 } |
| 5151 if (kind != null) { |
| 5152 _json["kind"] = kind; |
| 5153 } |
| 5154 if (nextPageToken != null) { |
| 5155 _json["nextPageToken"] = nextPageToken; |
| 5156 } |
| 5157 return _json; |
| 5158 } |
| 5159 } |
| 5160 |
| 5161 |
| 5162 /** This is a JSON template for a score rank in a leaderboard. */ |
| 5163 class LeaderboardScoreRank { |
| 5164 /** The number of scores in the leaderboard as a string. */ |
| 5165 core.String formattedNumScores; |
| 5166 |
| 5167 /** The rank in the leaderboard as a string. */ |
| 5168 core.String formattedRank; |
| 5169 |
| 5170 /** |
| 5171 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5172 * string games#leaderboardScoreRank. |
| 5173 */ |
| 5174 core.String kind; |
| 5175 |
| 5176 /** The number of scores in the leaderboard. */ |
| 5177 core.String numScores; |
| 5178 |
| 5179 /** The rank in the leaderboard. */ |
| 5180 core.String rank; |
| 5181 |
| 5182 |
| 5183 LeaderboardScoreRank(); |
| 5184 |
| 5185 LeaderboardScoreRank.fromJson(core.Map _json) { |
| 5186 if (_json.containsKey("formattedNumScores")) { |
| 5187 formattedNumScores = _json["formattedNumScores"]; |
| 5188 } |
| 5189 if (_json.containsKey("formattedRank")) { |
| 5190 formattedRank = _json["formattedRank"]; |
| 5191 } |
| 5192 if (_json.containsKey("kind")) { |
| 5193 kind = _json["kind"]; |
| 5194 } |
| 5195 if (_json.containsKey("numScores")) { |
| 5196 numScores = _json["numScores"]; |
| 5197 } |
| 5198 if (_json.containsKey("rank")) { |
| 5199 rank = _json["rank"]; |
| 5200 } |
| 5201 } |
| 5202 |
| 5203 core.Map toJson() { |
| 5204 var _json = new core.Map(); |
| 5205 if (formattedNumScores != null) { |
| 5206 _json["formattedNumScores"] = formattedNumScores; |
| 5207 } |
| 5208 if (formattedRank != null) { |
| 5209 _json["formattedRank"] = formattedRank; |
| 5210 } |
| 5211 if (kind != null) { |
| 5212 _json["kind"] = kind; |
| 5213 } |
| 5214 if (numScores != null) { |
| 5215 _json["numScores"] = numScores; |
| 5216 } |
| 5217 if (rank != null) { |
| 5218 _json["rank"] = rank; |
| 5219 } |
| 5220 return _json; |
| 5221 } |
| 5222 } |
| 5223 |
| 5224 |
| 5225 /** This is a JSON template for a ListScores response. */ |
| 5226 class LeaderboardScores { |
| 5227 /** The scores in the leaderboard. */ |
| 5228 core.List<LeaderboardEntry> items; |
| 5229 |
| 5230 /** |
| 5231 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5232 * string games#leaderboardScores. |
| 5233 */ |
| 5234 core.String kind; |
| 5235 |
| 5236 /** The pagination token for the next page of results. */ |
| 5237 core.String nextPageToken; |
| 5238 |
| 5239 /** The total number of scores in the leaderboard. */ |
| 5240 core.String numScores; |
| 5241 |
| 5242 /** |
| 5243 * The score of the requesting player on the leaderboard. The player's score |
| 5244 * may appear both here and in the list of scores above. If you are viewing a |
| 5245 * public leaderboard and the player is not sharing their gameplay information |
| 5246 * publicly, the scoreRank and formattedScoreRank values will not be present. |
| 5247 */ |
| 5248 LeaderboardEntry playerScore; |
| 5249 |
| 5250 /** The pagination token for the previous page of results. */ |
| 5251 core.String prevPageToken; |
| 5252 |
| 5253 |
| 5254 LeaderboardScores(); |
| 5255 |
| 5256 LeaderboardScores.fromJson(core.Map _json) { |
| 5257 if (_json.containsKey("items")) { |
| 5258 items = _json["items"].map((value) => new LeaderboardEntry.fromJson(value)
).toList(); |
| 5259 } |
| 5260 if (_json.containsKey("kind")) { |
| 5261 kind = _json["kind"]; |
| 5262 } |
| 5263 if (_json.containsKey("nextPageToken")) { |
| 5264 nextPageToken = _json["nextPageToken"]; |
| 5265 } |
| 5266 if (_json.containsKey("numScores")) { |
| 5267 numScores = _json["numScores"]; |
| 5268 } |
| 5269 if (_json.containsKey("playerScore")) { |
| 5270 playerScore = new LeaderboardEntry.fromJson(_json["playerScore"]); |
| 5271 } |
| 5272 if (_json.containsKey("prevPageToken")) { |
| 5273 prevPageToken = _json["prevPageToken"]; |
| 5274 } |
| 5275 } |
| 5276 |
| 5277 core.Map toJson() { |
| 5278 var _json = new core.Map(); |
| 5279 if (items != null) { |
| 5280 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 5281 } |
| 5282 if (kind != null) { |
| 5283 _json["kind"] = kind; |
| 5284 } |
| 5285 if (nextPageToken != null) { |
| 5286 _json["nextPageToken"] = nextPageToken; |
| 5287 } |
| 5288 if (numScores != null) { |
| 5289 _json["numScores"] = numScores; |
| 5290 } |
| 5291 if (playerScore != null) { |
| 5292 _json["playerScore"] = (playerScore).toJson(); |
| 5293 } |
| 5294 if (prevPageToken != null) { |
| 5295 _json["prevPageToken"] = prevPageToken; |
| 5296 } |
| 5297 return _json; |
| 5298 } |
| 5299 } |
| 5300 |
| 5301 |
| 5302 /** This is a JSON template for the metagame config resource */ |
| 5303 class MetagameConfig { |
| 5304 /** |
| 5305 * Current version of the metagame configuration data. When this data is |
| 5306 * updated, the version number will be increased by one. |
| 5307 */ |
| 5308 core.int currentVersion; |
| 5309 |
| 5310 /** |
| 5311 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5312 * string games#metagameConfig. |
| 5313 */ |
| 5314 core.String kind; |
| 5315 |
| 5316 /** The list of player levels. */ |
| 5317 core.List<PlayerLevel> playerLevels; |
| 5318 |
| 5319 |
| 5320 MetagameConfig(); |
| 5321 |
| 5322 MetagameConfig.fromJson(core.Map _json) { |
| 5323 if (_json.containsKey("currentVersion")) { |
| 5324 currentVersion = _json["currentVersion"]; |
| 5325 } |
| 5326 if (_json.containsKey("kind")) { |
| 5327 kind = _json["kind"]; |
| 5328 } |
| 5329 if (_json.containsKey("playerLevels")) { |
| 5330 playerLevels = _json["playerLevels"].map((value) => new PlayerLevel.fromJs
on(value)).toList(); |
| 5331 } |
| 5332 } |
| 5333 |
| 5334 core.Map toJson() { |
| 5335 var _json = new core.Map(); |
| 5336 if (currentVersion != null) { |
| 5337 _json["currentVersion"] = currentVersion; |
| 5338 } |
| 5339 if (kind != null) { |
| 5340 _json["kind"] = kind; |
| 5341 } |
| 5342 if (playerLevels != null) { |
| 5343 _json["playerLevels"] = playerLevels.map((value) => (value).toJson()).toLi
st(); |
| 5344 } |
| 5345 return _json; |
| 5346 } |
| 5347 } |
| 5348 |
| 5349 |
| 5350 /** This is a JSON template for network diagnostics reported for a client. */ |
| 5351 class NetworkDiagnostics { |
| 5352 /** The Android network subtype. */ |
| 5353 core.int androidNetworkSubtype; |
| 5354 |
| 5355 /** The Android network type. */ |
| 5356 core.int androidNetworkType; |
| 5357 |
| 5358 /** iOS network type as defined in Reachability.h. */ |
| 5359 core.int iosNetworkType; |
| 5360 |
| 5361 /** |
| 5362 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5363 * string games#networkDiagnostics. |
| 5364 */ |
| 5365 core.String kind; |
| 5366 |
| 5367 /** |
| 5368 * The MCC+MNC code for the client's network connection. On Android: |
| 5369 * http://developer.android.com/reference/android/telephony/TelephonyManager.h
tml#getNetworkOperator() |
| 5370 * On iOS, see: |
| 5371 * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Re
ference/CTCarrier/Reference/Reference.html |
| 5372 */ |
| 5373 core.String networkOperatorCode; |
| 5374 |
| 5375 /** |
| 5376 * The name of the carrier of the client's network connection. On Android: |
| 5377 * http://developer.android.com/reference/android/telephony/TelephonyManager.h
tml#getNetworkOperatorName() |
| 5378 * On iOS: |
| 5379 * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Re
ference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carri
erName |
| 5380 */ |
| 5381 core.String networkOperatorName; |
| 5382 |
| 5383 /** |
| 5384 * The amount of time in milliseconds it took for the client to establish a |
| 5385 * connection with the XMPP server. |
| 5386 */ |
| 5387 core.int registrationLatencyMillis; |
| 5388 |
| 5389 |
| 5390 NetworkDiagnostics(); |
| 5391 |
| 5392 NetworkDiagnostics.fromJson(core.Map _json) { |
| 5393 if (_json.containsKey("androidNetworkSubtype")) { |
| 5394 androidNetworkSubtype = _json["androidNetworkSubtype"]; |
| 5395 } |
| 5396 if (_json.containsKey("androidNetworkType")) { |
| 5397 androidNetworkType = _json["androidNetworkType"]; |
| 5398 } |
| 5399 if (_json.containsKey("iosNetworkType")) { |
| 5400 iosNetworkType = _json["iosNetworkType"]; |
| 5401 } |
| 5402 if (_json.containsKey("kind")) { |
| 5403 kind = _json["kind"]; |
| 5404 } |
| 5405 if (_json.containsKey("networkOperatorCode")) { |
| 5406 networkOperatorCode = _json["networkOperatorCode"]; |
| 5407 } |
| 5408 if (_json.containsKey("networkOperatorName")) { |
| 5409 networkOperatorName = _json["networkOperatorName"]; |
| 5410 } |
| 5411 if (_json.containsKey("registrationLatencyMillis")) { |
| 5412 registrationLatencyMillis = _json["registrationLatencyMillis"]; |
| 5413 } |
| 5414 } |
| 5415 |
| 5416 core.Map toJson() { |
| 5417 var _json = new core.Map(); |
| 5418 if (androidNetworkSubtype != null) { |
| 5419 _json["androidNetworkSubtype"] = androidNetworkSubtype; |
| 5420 } |
| 5421 if (androidNetworkType != null) { |
| 5422 _json["androidNetworkType"] = androidNetworkType; |
| 5423 } |
| 5424 if (iosNetworkType != null) { |
| 5425 _json["iosNetworkType"] = iosNetworkType; |
| 5426 } |
| 5427 if (kind != null) { |
| 5428 _json["kind"] = kind; |
| 5429 } |
| 5430 if (networkOperatorCode != null) { |
| 5431 _json["networkOperatorCode"] = networkOperatorCode; |
| 5432 } |
| 5433 if (networkOperatorName != null) { |
| 5434 _json["networkOperatorName"] = networkOperatorName; |
| 5435 } |
| 5436 if (registrationLatencyMillis != null) { |
| 5437 _json["registrationLatencyMillis"] = registrationLatencyMillis; |
| 5438 } |
| 5439 return _json; |
| 5440 } |
| 5441 } |
| 5442 |
| 5443 |
| 5444 /** This is a JSON template for a result for a match participant. */ |
| 5445 class ParticipantResult { |
| 5446 /** |
| 5447 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5448 * string games#participantResult. |
| 5449 */ |
| 5450 core.String kind; |
| 5451 |
| 5452 /** The ID of the participant. */ |
| 5453 core.String participantId; |
| 5454 |
| 5455 /** |
| 5456 * The placement or ranking of the participant in the match results; a number |
| 5457 * from one to the number of participants in the match. Multiple participants |
| 5458 * may have the same placing value in case of a type. |
| 5459 */ |
| 5460 core.int placing; |
| 5461 |
| 5462 /** |
| 5463 * The result of the participant for this match. |
| 5464 * Possible values are: |
| 5465 * - "MATCH_RESULT_WIN" - The participant won the match. |
| 5466 * - "MATCH_RESULT_LOSS" - The participant lost the match. |
| 5467 * - "MATCH_RESULT_TIE" - The participant tied the match. |
| 5468 * - "MATCH_RESULT_NONE" - There was no winner for the match (nobody wins or |
| 5469 * loses this kind of game.) |
| 5470 * - "MATCH_RESULT_DISCONNECT" - The participant disconnected / left during |
| 5471 * the match. |
| 5472 * - "MATCH_RESULT_DISAGREED" - Different clients reported different results |
| 5473 * for this participant. |
| 5474 */ |
| 5475 core.String result; |
| 5476 |
| 5477 |
| 5478 ParticipantResult(); |
| 5479 |
| 5480 ParticipantResult.fromJson(core.Map _json) { |
| 5481 if (_json.containsKey("kind")) { |
| 5482 kind = _json["kind"]; |
| 5483 } |
| 5484 if (_json.containsKey("participantId")) { |
| 5485 participantId = _json["participantId"]; |
| 5486 } |
| 5487 if (_json.containsKey("placing")) { |
| 5488 placing = _json["placing"]; |
| 5489 } |
| 5490 if (_json.containsKey("result")) { |
| 5491 result = _json["result"]; |
| 5492 } |
| 5493 } |
| 5494 |
| 5495 core.Map toJson() { |
| 5496 var _json = new core.Map(); |
| 5497 if (kind != null) { |
| 5498 _json["kind"] = kind; |
| 5499 } |
| 5500 if (participantId != null) { |
| 5501 _json["participantId"] = participantId; |
| 5502 } |
| 5503 if (placing != null) { |
| 5504 _json["placing"] = placing; |
| 5505 } |
| 5506 if (result != null) { |
| 5507 _json["result"] = result; |
| 5508 } |
| 5509 return _json; |
| 5510 } |
| 5511 } |
| 5512 |
| 5513 |
| 5514 /** This is a JSON template for peer channel diagnostics. */ |
| 5515 class PeerChannelDiagnostics { |
| 5516 /** Number of bytes received. */ |
| 5517 AggregateStats bytesReceived; |
| 5518 |
| 5519 /** Number of bytes sent. */ |
| 5520 AggregateStats bytesSent; |
| 5521 |
| 5522 /** |
| 5523 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5524 * string games#peerChannelDiagnostics. |
| 5525 */ |
| 5526 core.String kind; |
| 5527 |
| 5528 /** Number of messages lost. */ |
| 5529 core.int numMessagesLost; |
| 5530 |
| 5531 /** Number of messages received. */ |
| 5532 core.int numMessagesReceived; |
| 5533 |
| 5534 /** Number of messages sent. */ |
| 5535 core.int numMessagesSent; |
| 5536 |
| 5537 /** Number of send failures. */ |
| 5538 core.int numSendFailures; |
| 5539 |
| 5540 /** Roundtrip latency stats in milliseconds. */ |
| 5541 AggregateStats roundtripLatencyMillis; |
| 5542 |
| 5543 |
| 5544 PeerChannelDiagnostics(); |
| 5545 |
| 5546 PeerChannelDiagnostics.fromJson(core.Map _json) { |
| 5547 if (_json.containsKey("bytesReceived")) { |
| 5548 bytesReceived = new AggregateStats.fromJson(_json["bytesReceived"]); |
| 5549 } |
| 5550 if (_json.containsKey("bytesSent")) { |
| 5551 bytesSent = new AggregateStats.fromJson(_json["bytesSent"]); |
| 5552 } |
| 5553 if (_json.containsKey("kind")) { |
| 5554 kind = _json["kind"]; |
| 5555 } |
| 5556 if (_json.containsKey("numMessagesLost")) { |
| 5557 numMessagesLost = _json["numMessagesLost"]; |
| 5558 } |
| 5559 if (_json.containsKey("numMessagesReceived")) { |
| 5560 numMessagesReceived = _json["numMessagesReceived"]; |
| 5561 } |
| 5562 if (_json.containsKey("numMessagesSent")) { |
| 5563 numMessagesSent = _json["numMessagesSent"]; |
| 5564 } |
| 5565 if (_json.containsKey("numSendFailures")) { |
| 5566 numSendFailures = _json["numSendFailures"]; |
| 5567 } |
| 5568 if (_json.containsKey("roundtripLatencyMillis")) { |
| 5569 roundtripLatencyMillis = new AggregateStats.fromJson(_json["roundtripLaten
cyMillis"]); |
| 5570 } |
| 5571 } |
| 5572 |
| 5573 core.Map toJson() { |
| 5574 var _json = new core.Map(); |
| 5575 if (bytesReceived != null) { |
| 5576 _json["bytesReceived"] = (bytesReceived).toJson(); |
| 5577 } |
| 5578 if (bytesSent != null) { |
| 5579 _json["bytesSent"] = (bytesSent).toJson(); |
| 5580 } |
| 5581 if (kind != null) { |
| 5582 _json["kind"] = kind; |
| 5583 } |
| 5584 if (numMessagesLost != null) { |
| 5585 _json["numMessagesLost"] = numMessagesLost; |
| 5586 } |
| 5587 if (numMessagesReceived != null) { |
| 5588 _json["numMessagesReceived"] = numMessagesReceived; |
| 5589 } |
| 5590 if (numMessagesSent != null) { |
| 5591 _json["numMessagesSent"] = numMessagesSent; |
| 5592 } |
| 5593 if (numSendFailures != null) { |
| 5594 _json["numSendFailures"] = numSendFailures; |
| 5595 } |
| 5596 if (roundtripLatencyMillis != null) { |
| 5597 _json["roundtripLatencyMillis"] = (roundtripLatencyMillis).toJson(); |
| 5598 } |
| 5599 return _json; |
| 5600 } |
| 5601 } |
| 5602 |
| 5603 |
| 5604 /** This is a JSON template for peer session diagnostics. */ |
| 5605 class PeerSessionDiagnostics { |
| 5606 /** Connected time in milliseconds. */ |
| 5607 core.String connectedTimestampMillis; |
| 5608 |
| 5609 /** |
| 5610 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5611 * string games#peerSessionDiagnostics. |
| 5612 */ |
| 5613 core.String kind; |
| 5614 |
| 5615 /** The participant ID of the peer. */ |
| 5616 core.String participantId; |
| 5617 |
| 5618 /** Reliable channel diagnostics. */ |
| 5619 PeerChannelDiagnostics reliableChannel; |
| 5620 |
| 5621 /** Unreliable channel diagnostics. */ |
| 5622 PeerChannelDiagnostics unreliableChannel; |
| 5623 |
| 5624 |
| 5625 PeerSessionDiagnostics(); |
| 5626 |
| 5627 PeerSessionDiagnostics.fromJson(core.Map _json) { |
| 5628 if (_json.containsKey("connectedTimestampMillis")) { |
| 5629 connectedTimestampMillis = _json["connectedTimestampMillis"]; |
| 5630 } |
| 5631 if (_json.containsKey("kind")) { |
| 5632 kind = _json["kind"]; |
| 5633 } |
| 5634 if (_json.containsKey("participantId")) { |
| 5635 participantId = _json["participantId"]; |
| 5636 } |
| 5637 if (_json.containsKey("reliableChannel")) { |
| 5638 reliableChannel = new PeerChannelDiagnostics.fromJson(_json["reliableChann
el"]); |
| 5639 } |
| 5640 if (_json.containsKey("unreliableChannel")) { |
| 5641 unreliableChannel = new PeerChannelDiagnostics.fromJson(_json["unreliableC
hannel"]); |
| 5642 } |
| 5643 } |
| 5644 |
| 5645 core.Map toJson() { |
| 5646 var _json = new core.Map(); |
| 5647 if (connectedTimestampMillis != null) { |
| 5648 _json["connectedTimestampMillis"] = connectedTimestampMillis; |
| 5649 } |
| 5650 if (kind != null) { |
| 5651 _json["kind"] = kind; |
| 5652 } |
| 5653 if (participantId != null) { |
| 5654 _json["participantId"] = participantId; |
| 5655 } |
| 5656 if (reliableChannel != null) { |
| 5657 _json["reliableChannel"] = (reliableChannel).toJson(); |
| 5658 } |
| 5659 if (unreliableChannel != null) { |
| 5660 _json["unreliableChannel"] = (unreliableChannel).toJson(); |
| 5661 } |
| 5662 return _json; |
| 5663 } |
| 5664 } |
| 5665 |
| 5666 |
| 5667 /** |
| 5668 * This is a JSON template for metadata about a player playing a game with the |
| 5669 * currently authenticated user. |
| 5670 */ |
| 5671 class Played { |
| 5672 /** |
| 5673 * True if the player was auto-matched with the currently authenticated user. |
| 5674 */ |
| 5675 core.bool autoMatched; |
| 5676 |
| 5677 /** |
| 5678 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5679 * string games#played. |
| 5680 */ |
| 5681 core.String kind; |
| 5682 |
| 5683 /** |
| 5684 * The last time the player played the game in milliseconds since the epoch in |
| 5685 * UTC. |
| 5686 */ |
| 5687 core.String timeMillis; |
| 5688 |
| 5689 |
| 5690 Played(); |
| 5691 |
| 5692 Played.fromJson(core.Map _json) { |
| 5693 if (_json.containsKey("autoMatched")) { |
| 5694 autoMatched = _json["autoMatched"]; |
| 5695 } |
| 5696 if (_json.containsKey("kind")) { |
| 5697 kind = _json["kind"]; |
| 5698 } |
| 5699 if (_json.containsKey("timeMillis")) { |
| 5700 timeMillis = _json["timeMillis"]; |
| 5701 } |
| 5702 } |
| 5703 |
| 5704 core.Map toJson() { |
| 5705 var _json = new core.Map(); |
| 5706 if (autoMatched != null) { |
| 5707 _json["autoMatched"] = autoMatched; |
| 5708 } |
| 5709 if (kind != null) { |
| 5710 _json["kind"] = kind; |
| 5711 } |
| 5712 if (timeMillis != null) { |
| 5713 _json["timeMillis"] = timeMillis; |
| 5714 } |
| 5715 return _json; |
| 5716 } |
| 5717 } |
| 5718 |
| 5719 |
| 5720 /** |
| 5721 * An object representation of the individual components of the player's name. |
| 5722 * For some players, these fields may not be present. |
| 5723 */ |
| 5724 class PlayerName { |
| 5725 /** |
| 5726 * The family name of this player. In some places, this is known as the last |
| 5727 * name. |
| 5728 */ |
| 5729 core.String familyName; |
| 5730 |
| 5731 /** |
| 5732 * The given name of this player. In some places, this is known as the first |
| 5733 * name. |
| 5734 */ |
| 5735 core.String givenName; |
| 5736 |
| 5737 |
| 5738 PlayerName(); |
| 5739 |
| 5740 PlayerName.fromJson(core.Map _json) { |
| 5741 if (_json.containsKey("familyName")) { |
| 5742 familyName = _json["familyName"]; |
| 5743 } |
| 5744 if (_json.containsKey("givenName")) { |
| 5745 givenName = _json["givenName"]; |
| 5746 } |
| 5747 } |
| 5748 |
| 5749 core.Map toJson() { |
| 5750 var _json = new core.Map(); |
| 5751 if (familyName != null) { |
| 5752 _json["familyName"] = familyName; |
| 5753 } |
| 5754 if (givenName != null) { |
| 5755 _json["givenName"] = givenName; |
| 5756 } |
| 5757 return _json; |
| 5758 } |
| 5759 } |
| 5760 |
| 5761 |
| 5762 /** This is a JSON template for a Player resource. */ |
| 5763 class Player { |
| 5764 /** The base URL for the image that represents the player. */ |
| 5765 core.String avatarImageUrl; |
| 5766 |
| 5767 /** The name to display for the player. */ |
| 5768 core.String displayName; |
| 5769 |
| 5770 /** |
| 5771 * An object to represent Play Game experience information for the player. |
| 5772 */ |
| 5773 PlayerExperienceInfo experienceInfo; |
| 5774 |
| 5775 /** |
| 5776 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5777 * string games#player. |
| 5778 */ |
| 5779 core.String kind; |
| 5780 |
| 5781 /** |
| 5782 * Details about the last time this player played a multiplayer game with the |
| 5783 * currently authenticated player. Populated for PLAYED_WITH player collection |
| 5784 * members. |
| 5785 */ |
| 5786 Played lastPlayedWith; |
| 5787 |
| 5788 /** |
| 5789 * An object representation of the individual components of the player's name. |
| 5790 * For some players, these fields may not be present. |
| 5791 */ |
| 5792 PlayerName name; |
| 5793 |
| 5794 /** The ID of the player. */ |
| 5795 core.String playerId; |
| 5796 |
| 5797 /** The player's title rewarded for their game activities. */ |
| 5798 core.String title; |
| 5799 |
| 5800 |
| 5801 Player(); |
| 5802 |
| 5803 Player.fromJson(core.Map _json) { |
| 5804 if (_json.containsKey("avatarImageUrl")) { |
| 5805 avatarImageUrl = _json["avatarImageUrl"]; |
| 5806 } |
| 5807 if (_json.containsKey("displayName")) { |
| 5808 displayName = _json["displayName"]; |
| 5809 } |
| 5810 if (_json.containsKey("experienceInfo")) { |
| 5811 experienceInfo = new PlayerExperienceInfo.fromJson(_json["experienceInfo"]
); |
| 5812 } |
| 5813 if (_json.containsKey("kind")) { |
| 5814 kind = _json["kind"]; |
| 5815 } |
| 5816 if (_json.containsKey("lastPlayedWith")) { |
| 5817 lastPlayedWith = new Played.fromJson(_json["lastPlayedWith"]); |
| 5818 } |
| 5819 if (_json.containsKey("name")) { |
| 5820 name = new PlayerName.fromJson(_json["name"]); |
| 5821 } |
| 5822 if (_json.containsKey("playerId")) { |
| 5823 playerId = _json["playerId"]; |
| 5824 } |
| 5825 if (_json.containsKey("title")) { |
| 5826 title = _json["title"]; |
| 5827 } |
| 5828 } |
| 5829 |
| 5830 core.Map toJson() { |
| 5831 var _json = new core.Map(); |
| 5832 if (avatarImageUrl != null) { |
| 5833 _json["avatarImageUrl"] = avatarImageUrl; |
| 5834 } |
| 5835 if (displayName != null) { |
| 5836 _json["displayName"] = displayName; |
| 5837 } |
| 5838 if (experienceInfo != null) { |
| 5839 _json["experienceInfo"] = (experienceInfo).toJson(); |
| 5840 } |
| 5841 if (kind != null) { |
| 5842 _json["kind"] = kind; |
| 5843 } |
| 5844 if (lastPlayedWith != null) { |
| 5845 _json["lastPlayedWith"] = (lastPlayedWith).toJson(); |
| 5846 } |
| 5847 if (name != null) { |
| 5848 _json["name"] = (name).toJson(); |
| 5849 } |
| 5850 if (playerId != null) { |
| 5851 _json["playerId"] = playerId; |
| 5852 } |
| 5853 if (title != null) { |
| 5854 _json["title"] = title; |
| 5855 } |
| 5856 return _json; |
| 5857 } |
| 5858 } |
| 5859 |
| 5860 |
| 5861 /** This is a JSON template for an achievement object. */ |
| 5862 class PlayerAchievement { |
| 5863 /** |
| 5864 * The state of the achievement. |
| 5865 * Possible values are: |
| 5866 * - "HIDDEN" - Achievement is hidden. |
| 5867 * - "REVEALED" - Achievement is revealed. |
| 5868 * - "UNLOCKED" - Achievement is unlocked. |
| 5869 */ |
| 5870 core.String achievementState; |
| 5871 |
| 5872 /** The current steps for an incremental achievement. */ |
| 5873 core.int currentSteps; |
| 5874 |
| 5875 /** |
| 5876 * Experience points earned for the achievement. This field is absent for |
| 5877 * achievements that have not yet been unlocked and 0 for achievements that |
| 5878 * have been unlocked by testers but that are unpublished. |
| 5879 */ |
| 5880 core.String experiencePoints; |
| 5881 |
| 5882 /** The current steps for an incremental achievement as a string. */ |
| 5883 core.String formattedCurrentStepsString; |
| 5884 |
| 5885 /** The ID of the achievement. */ |
| 5886 core.String id; |
| 5887 |
| 5888 /** |
| 5889 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5890 * string games#playerAchievement. |
| 5891 */ |
| 5892 core.String kind; |
| 5893 |
| 5894 /** The timestamp of the last modification to this achievement's state. */ |
| 5895 core.String lastUpdatedTimestamp; |
| 5896 |
| 5897 |
| 5898 PlayerAchievement(); |
| 5899 |
| 5900 PlayerAchievement.fromJson(core.Map _json) { |
| 5901 if (_json.containsKey("achievementState")) { |
| 5902 achievementState = _json["achievementState"]; |
| 5903 } |
| 5904 if (_json.containsKey("currentSteps")) { |
| 5905 currentSteps = _json["currentSteps"]; |
| 5906 } |
| 5907 if (_json.containsKey("experiencePoints")) { |
| 5908 experiencePoints = _json["experiencePoints"]; |
| 5909 } |
| 5910 if (_json.containsKey("formattedCurrentStepsString")) { |
| 5911 formattedCurrentStepsString = _json["formattedCurrentStepsString"]; |
| 5912 } |
| 5913 if (_json.containsKey("id")) { |
| 5914 id = _json["id"]; |
| 5915 } |
| 5916 if (_json.containsKey("kind")) { |
| 5917 kind = _json["kind"]; |
| 5918 } |
| 5919 if (_json.containsKey("lastUpdatedTimestamp")) { |
| 5920 lastUpdatedTimestamp = _json["lastUpdatedTimestamp"]; |
| 5921 } |
| 5922 } |
| 5923 |
| 5924 core.Map toJson() { |
| 5925 var _json = new core.Map(); |
| 5926 if (achievementState != null) { |
| 5927 _json["achievementState"] = achievementState; |
| 5928 } |
| 5929 if (currentSteps != null) { |
| 5930 _json["currentSteps"] = currentSteps; |
| 5931 } |
| 5932 if (experiencePoints != null) { |
| 5933 _json["experiencePoints"] = experiencePoints; |
| 5934 } |
| 5935 if (formattedCurrentStepsString != null) { |
| 5936 _json["formattedCurrentStepsString"] = formattedCurrentStepsString; |
| 5937 } |
| 5938 if (id != null) { |
| 5939 _json["id"] = id; |
| 5940 } |
| 5941 if (kind != null) { |
| 5942 _json["kind"] = kind; |
| 5943 } |
| 5944 if (lastUpdatedTimestamp != null) { |
| 5945 _json["lastUpdatedTimestamp"] = lastUpdatedTimestamp; |
| 5946 } |
| 5947 return _json; |
| 5948 } |
| 5949 } |
| 5950 |
| 5951 |
| 5952 /** This is a JSON template for a list of achievement objects. */ |
| 5953 class PlayerAchievementListResponse { |
| 5954 /** The achievements. */ |
| 5955 core.List<PlayerAchievement> items; |
| 5956 |
| 5957 /** |
| 5958 * Uniquely identifies the type of this resource. Value is always the fixed |
| 5959 * string games#playerAchievementListResponse. |
| 5960 */ |
| 5961 core.String kind; |
| 5962 |
| 5963 /** Token corresponding to the next page of results. */ |
| 5964 core.String nextPageToken; |
| 5965 |
| 5966 |
| 5967 PlayerAchievementListResponse(); |
| 5968 |
| 5969 PlayerAchievementListResponse.fromJson(core.Map _json) { |
| 5970 if (_json.containsKey("items")) { |
| 5971 items = _json["items"].map((value) => new PlayerAchievement.fromJson(value
)).toList(); |
| 5972 } |
| 5973 if (_json.containsKey("kind")) { |
| 5974 kind = _json["kind"]; |
| 5975 } |
| 5976 if (_json.containsKey("nextPageToken")) { |
| 5977 nextPageToken = _json["nextPageToken"]; |
| 5978 } |
| 5979 } |
| 5980 |
| 5981 core.Map toJson() { |
| 5982 var _json = new core.Map(); |
| 5983 if (items != null) { |
| 5984 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 5985 } |
| 5986 if (kind != null) { |
| 5987 _json["kind"] = kind; |
| 5988 } |
| 5989 if (nextPageToken != null) { |
| 5990 _json["nextPageToken"] = nextPageToken; |
| 5991 } |
| 5992 return _json; |
| 5993 } |
| 5994 } |
| 5995 |
| 5996 |
| 5997 /** This is a JSON template for an event status resource. */ |
| 5998 class PlayerEvent { |
| 5999 /** The ID of the event definition. */ |
| 6000 core.String definitionId; |
| 6001 |
| 6002 /** |
| 6003 * The current number of times this event has occurred, as a string. The |
| 6004 * formatting of this string depends on the configuration of your event in the |
| 6005 * Play Games Developer Console. |
| 6006 */ |
| 6007 core.String formattedNumEvents; |
| 6008 |
| 6009 /** |
| 6010 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6011 * string games#playerEvent. |
| 6012 */ |
| 6013 core.String kind; |
| 6014 |
| 6015 /** The current number of times this event has occurred. */ |
| 6016 core.String numEvents; |
| 6017 |
| 6018 /** The ID of the player. */ |
| 6019 core.String playerId; |
| 6020 |
| 6021 |
| 6022 PlayerEvent(); |
| 6023 |
| 6024 PlayerEvent.fromJson(core.Map _json) { |
| 6025 if (_json.containsKey("definitionId")) { |
| 6026 definitionId = _json["definitionId"]; |
| 6027 } |
| 6028 if (_json.containsKey("formattedNumEvents")) { |
| 6029 formattedNumEvents = _json["formattedNumEvents"]; |
| 6030 } |
| 6031 if (_json.containsKey("kind")) { |
| 6032 kind = _json["kind"]; |
| 6033 } |
| 6034 if (_json.containsKey("numEvents")) { |
| 6035 numEvents = _json["numEvents"]; |
| 6036 } |
| 6037 if (_json.containsKey("playerId")) { |
| 6038 playerId = _json["playerId"]; |
| 6039 } |
| 6040 } |
| 6041 |
| 6042 core.Map toJson() { |
| 6043 var _json = new core.Map(); |
| 6044 if (definitionId != null) { |
| 6045 _json["definitionId"] = definitionId; |
| 6046 } |
| 6047 if (formattedNumEvents != null) { |
| 6048 _json["formattedNumEvents"] = formattedNumEvents; |
| 6049 } |
| 6050 if (kind != null) { |
| 6051 _json["kind"] = kind; |
| 6052 } |
| 6053 if (numEvents != null) { |
| 6054 _json["numEvents"] = numEvents; |
| 6055 } |
| 6056 if (playerId != null) { |
| 6057 _json["playerId"] = playerId; |
| 6058 } |
| 6059 return _json; |
| 6060 } |
| 6061 } |
| 6062 |
| 6063 |
| 6064 /** This is a JSON template for a ListByPlayer response. */ |
| 6065 class PlayerEventListResponse { |
| 6066 /** The player events. */ |
| 6067 core.List<PlayerEvent> items; |
| 6068 |
| 6069 /** |
| 6070 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6071 * string games#playerEventListResponse. |
| 6072 */ |
| 6073 core.String kind; |
| 6074 |
| 6075 /** The pagination token for the next page of results. */ |
| 6076 core.String nextPageToken; |
| 6077 |
| 6078 |
| 6079 PlayerEventListResponse(); |
| 6080 |
| 6081 PlayerEventListResponse.fromJson(core.Map _json) { |
| 6082 if (_json.containsKey("items")) { |
| 6083 items = _json["items"].map((value) => new PlayerEvent.fromJson(value)).toL
ist(); |
| 6084 } |
| 6085 if (_json.containsKey("kind")) { |
| 6086 kind = _json["kind"]; |
| 6087 } |
| 6088 if (_json.containsKey("nextPageToken")) { |
| 6089 nextPageToken = _json["nextPageToken"]; |
| 6090 } |
| 6091 } |
| 6092 |
| 6093 core.Map toJson() { |
| 6094 var _json = new core.Map(); |
| 6095 if (items != null) { |
| 6096 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 6097 } |
| 6098 if (kind != null) { |
| 6099 _json["kind"] = kind; |
| 6100 } |
| 6101 if (nextPageToken != null) { |
| 6102 _json["nextPageToken"] = nextPageToken; |
| 6103 } |
| 6104 return _json; |
| 6105 } |
| 6106 } |
| 6107 |
| 6108 |
| 6109 /** |
| 6110 * This is a JSON template for 1P/3P metadata about the player's experience. |
| 6111 */ |
| 6112 class PlayerExperienceInfo { |
| 6113 /** The current number of experience points for the player. */ |
| 6114 core.String currentExperiencePoints; |
| 6115 |
| 6116 /** The current level of the player. */ |
| 6117 PlayerLevel currentLevel; |
| 6118 |
| 6119 /** |
| 6120 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6121 * string games#playerExperienceInfo. |
| 6122 */ |
| 6123 core.String kind; |
| 6124 |
| 6125 /** |
| 6126 * The timestamp when the player was leveled up, in millis since Unix epoch |
| 6127 * UTC. |
| 6128 */ |
| 6129 core.String lastLevelUpTimestampMillis; |
| 6130 |
| 6131 /** |
| 6132 * The next level of the player. If the current level is the maximum level, |
| 6133 * this should be same as the current level. |
| 6134 */ |
| 6135 PlayerLevel nextLevel; |
| 6136 |
| 6137 |
| 6138 PlayerExperienceInfo(); |
| 6139 |
| 6140 PlayerExperienceInfo.fromJson(core.Map _json) { |
| 6141 if (_json.containsKey("currentExperiencePoints")) { |
| 6142 currentExperiencePoints = _json["currentExperiencePoints"]; |
| 6143 } |
| 6144 if (_json.containsKey("currentLevel")) { |
| 6145 currentLevel = new PlayerLevel.fromJson(_json["currentLevel"]); |
| 6146 } |
| 6147 if (_json.containsKey("kind")) { |
| 6148 kind = _json["kind"]; |
| 6149 } |
| 6150 if (_json.containsKey("lastLevelUpTimestampMillis")) { |
| 6151 lastLevelUpTimestampMillis = _json["lastLevelUpTimestampMillis"]; |
| 6152 } |
| 6153 if (_json.containsKey("nextLevel")) { |
| 6154 nextLevel = new PlayerLevel.fromJson(_json["nextLevel"]); |
| 6155 } |
| 6156 } |
| 6157 |
| 6158 core.Map toJson() { |
| 6159 var _json = new core.Map(); |
| 6160 if (currentExperiencePoints != null) { |
| 6161 _json["currentExperiencePoints"] = currentExperiencePoints; |
| 6162 } |
| 6163 if (currentLevel != null) { |
| 6164 _json["currentLevel"] = (currentLevel).toJson(); |
| 6165 } |
| 6166 if (kind != null) { |
| 6167 _json["kind"] = kind; |
| 6168 } |
| 6169 if (lastLevelUpTimestampMillis != null) { |
| 6170 _json["lastLevelUpTimestampMillis"] = lastLevelUpTimestampMillis; |
| 6171 } |
| 6172 if (nextLevel != null) { |
| 6173 _json["nextLevel"] = (nextLevel).toJson(); |
| 6174 } |
| 6175 return _json; |
| 6176 } |
| 6177 } |
| 6178 |
| 6179 |
| 6180 /** This is a JSON template for a player leaderboard score object. */ |
| 6181 class PlayerLeaderboardScore { |
| 6182 /** |
| 6183 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6184 * string games#playerLeaderboardScore. |
| 6185 */ |
| 6186 core.String kind; |
| 6187 |
| 6188 /** The ID of the leaderboard this score is in. */ |
| 6189 core.String leaderboardId; |
| 6190 |
| 6191 /** |
| 6192 * The public rank of the score in this leaderboard. This object will not be |
| 6193 * present if the user is not sharing their scores publicly. |
| 6194 */ |
| 6195 LeaderboardScoreRank publicRank; |
| 6196 |
| 6197 /** The formatted value of this score. */ |
| 6198 core.String scoreString; |
| 6199 |
| 6200 /** |
| 6201 * Additional information about the score. Values must contain no more than 64 |
| 6202 * URI-safe characters as defined by section 2.3 of RFC 3986. |
| 6203 */ |
| 6204 core.String scoreTag; |
| 6205 |
| 6206 /** The numerical value of this score. */ |
| 6207 core.String scoreValue; |
| 6208 |
| 6209 /** The social rank of the score in this leaderboard. */ |
| 6210 LeaderboardScoreRank socialRank; |
| 6211 |
| 6212 /** |
| 6213 * The time span of this score. |
| 6214 * Possible values are: |
| 6215 * - "ALL_TIME" - The score is an all-time score. |
| 6216 * - "WEEKLY" - The score is a weekly score. |
| 6217 * - "DAILY" - The score is a daily score. |
| 6218 */ |
| 6219 core.String timeSpan; |
| 6220 |
| 6221 /** |
| 6222 * The timestamp at which this score was recorded, in milliseconds since the |
| 6223 * epoch in UTC. |
| 6224 */ |
| 6225 core.String writeTimestamp; |
| 6226 |
| 6227 |
| 6228 PlayerLeaderboardScore(); |
| 6229 |
| 6230 PlayerLeaderboardScore.fromJson(core.Map _json) { |
| 6231 if (_json.containsKey("kind")) { |
| 6232 kind = _json["kind"]; |
| 6233 } |
| 6234 if (_json.containsKey("leaderboard_id")) { |
| 6235 leaderboardId = _json["leaderboard_id"]; |
| 6236 } |
| 6237 if (_json.containsKey("publicRank")) { |
| 6238 publicRank = new LeaderboardScoreRank.fromJson(_json["publicRank"]); |
| 6239 } |
| 6240 if (_json.containsKey("scoreString")) { |
| 6241 scoreString = _json["scoreString"]; |
| 6242 } |
| 6243 if (_json.containsKey("scoreTag")) { |
| 6244 scoreTag = _json["scoreTag"]; |
| 6245 } |
| 6246 if (_json.containsKey("scoreValue")) { |
| 6247 scoreValue = _json["scoreValue"]; |
| 6248 } |
| 6249 if (_json.containsKey("socialRank")) { |
| 6250 socialRank = new LeaderboardScoreRank.fromJson(_json["socialRank"]); |
| 6251 } |
| 6252 if (_json.containsKey("timeSpan")) { |
| 6253 timeSpan = _json["timeSpan"]; |
| 6254 } |
| 6255 if (_json.containsKey("writeTimestamp")) { |
| 6256 writeTimestamp = _json["writeTimestamp"]; |
| 6257 } |
| 6258 } |
| 6259 |
| 6260 core.Map toJson() { |
| 6261 var _json = new core.Map(); |
| 6262 if (kind != null) { |
| 6263 _json["kind"] = kind; |
| 6264 } |
| 6265 if (leaderboardId != null) { |
| 6266 _json["leaderboard_id"] = leaderboardId; |
| 6267 } |
| 6268 if (publicRank != null) { |
| 6269 _json["publicRank"] = (publicRank).toJson(); |
| 6270 } |
| 6271 if (scoreString != null) { |
| 6272 _json["scoreString"] = scoreString; |
| 6273 } |
| 6274 if (scoreTag != null) { |
| 6275 _json["scoreTag"] = scoreTag; |
| 6276 } |
| 6277 if (scoreValue != null) { |
| 6278 _json["scoreValue"] = scoreValue; |
| 6279 } |
| 6280 if (socialRank != null) { |
| 6281 _json["socialRank"] = (socialRank).toJson(); |
| 6282 } |
| 6283 if (timeSpan != null) { |
| 6284 _json["timeSpan"] = timeSpan; |
| 6285 } |
| 6286 if (writeTimestamp != null) { |
| 6287 _json["writeTimestamp"] = writeTimestamp; |
| 6288 } |
| 6289 return _json; |
| 6290 } |
| 6291 } |
| 6292 |
| 6293 |
| 6294 /** This is a JSON template for a list of player leaderboard scores. */ |
| 6295 class PlayerLeaderboardScoreListResponse { |
| 6296 /** The leaderboard scores. */ |
| 6297 core.List<PlayerLeaderboardScore> items; |
| 6298 |
| 6299 /** |
| 6300 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6301 * string games#playerLeaderboardScoreListResponse. |
| 6302 */ |
| 6303 core.String kind; |
| 6304 |
| 6305 /** The pagination token for the next page of results. */ |
| 6306 core.String nextPageToken; |
| 6307 |
| 6308 /** The Player resources for the owner of this score. */ |
| 6309 Player player; |
| 6310 |
| 6311 |
| 6312 PlayerLeaderboardScoreListResponse(); |
| 6313 |
| 6314 PlayerLeaderboardScoreListResponse.fromJson(core.Map _json) { |
| 6315 if (_json.containsKey("items")) { |
| 6316 items = _json["items"].map((value) => new PlayerLeaderboardScore.fromJson(
value)).toList(); |
| 6317 } |
| 6318 if (_json.containsKey("kind")) { |
| 6319 kind = _json["kind"]; |
| 6320 } |
| 6321 if (_json.containsKey("nextPageToken")) { |
| 6322 nextPageToken = _json["nextPageToken"]; |
| 6323 } |
| 6324 if (_json.containsKey("player")) { |
| 6325 player = new Player.fromJson(_json["player"]); |
| 6326 } |
| 6327 } |
| 6328 |
| 6329 core.Map toJson() { |
| 6330 var _json = new core.Map(); |
| 6331 if (items != null) { |
| 6332 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 6333 } |
| 6334 if (kind != null) { |
| 6335 _json["kind"] = kind; |
| 6336 } |
| 6337 if (nextPageToken != null) { |
| 6338 _json["nextPageToken"] = nextPageToken; |
| 6339 } |
| 6340 if (player != null) { |
| 6341 _json["player"] = (player).toJson(); |
| 6342 } |
| 6343 return _json; |
| 6344 } |
| 6345 } |
| 6346 |
| 6347 |
| 6348 /** This is a JSON template for 1P/3P metadata about a user's level. */ |
| 6349 class PlayerLevel { |
| 6350 /** |
| 6351 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6352 * string games#playerLevel. |
| 6353 */ |
| 6354 core.String kind; |
| 6355 |
| 6356 /** The level for the user. */ |
| 6357 core.int level; |
| 6358 |
| 6359 /** The maximum experience points for this level. */ |
| 6360 core.String maxExperiencePoints; |
| 6361 |
| 6362 /** The minimum experience points for this level. */ |
| 6363 core.String minExperiencePoints; |
| 6364 |
| 6365 |
| 6366 PlayerLevel(); |
| 6367 |
| 6368 PlayerLevel.fromJson(core.Map _json) { |
| 6369 if (_json.containsKey("kind")) { |
| 6370 kind = _json["kind"]; |
| 6371 } |
| 6372 if (_json.containsKey("level")) { |
| 6373 level = _json["level"]; |
| 6374 } |
| 6375 if (_json.containsKey("maxExperiencePoints")) { |
| 6376 maxExperiencePoints = _json["maxExperiencePoints"]; |
| 6377 } |
| 6378 if (_json.containsKey("minExperiencePoints")) { |
| 6379 minExperiencePoints = _json["minExperiencePoints"]; |
| 6380 } |
| 6381 } |
| 6382 |
| 6383 core.Map toJson() { |
| 6384 var _json = new core.Map(); |
| 6385 if (kind != null) { |
| 6386 _json["kind"] = kind; |
| 6387 } |
| 6388 if (level != null) { |
| 6389 _json["level"] = level; |
| 6390 } |
| 6391 if (maxExperiencePoints != null) { |
| 6392 _json["maxExperiencePoints"] = maxExperiencePoints; |
| 6393 } |
| 6394 if (minExperiencePoints != null) { |
| 6395 _json["minExperiencePoints"] = minExperiencePoints; |
| 6396 } |
| 6397 return _json; |
| 6398 } |
| 6399 } |
| 6400 |
| 6401 |
| 6402 /** This is a JSON template for a third party player list response. */ |
| 6403 class PlayerListResponse { |
| 6404 /** The players. */ |
| 6405 core.List<Player> items; |
| 6406 |
| 6407 /** |
| 6408 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6409 * string games#playerListResponse. |
| 6410 */ |
| 6411 core.String kind; |
| 6412 |
| 6413 /** Token corresponding to the next page of results. */ |
| 6414 core.String nextPageToken; |
| 6415 |
| 6416 |
| 6417 PlayerListResponse(); |
| 6418 |
| 6419 PlayerListResponse.fromJson(core.Map _json) { |
| 6420 if (_json.containsKey("items")) { |
| 6421 items = _json["items"].map((value) => new Player.fromJson(value)).toList()
; |
| 6422 } |
| 6423 if (_json.containsKey("kind")) { |
| 6424 kind = _json["kind"]; |
| 6425 } |
| 6426 if (_json.containsKey("nextPageToken")) { |
| 6427 nextPageToken = _json["nextPageToken"]; |
| 6428 } |
| 6429 } |
| 6430 |
| 6431 core.Map toJson() { |
| 6432 var _json = new core.Map(); |
| 6433 if (items != null) { |
| 6434 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 6435 } |
| 6436 if (kind != null) { |
| 6437 _json["kind"] = kind; |
| 6438 } |
| 6439 if (nextPageToken != null) { |
| 6440 _json["nextPageToken"] = nextPageToken; |
| 6441 } |
| 6442 return _json; |
| 6443 } |
| 6444 } |
| 6445 |
| 6446 |
| 6447 /** This is a JSON template for a player score. */ |
| 6448 class PlayerScore { |
| 6449 /** The formatted score for this player score. */ |
| 6450 core.String formattedScore; |
| 6451 |
| 6452 /** |
| 6453 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6454 * string games#playerScore. |
| 6455 */ |
| 6456 core.String kind; |
| 6457 |
| 6458 /** The numerical value for this player score. */ |
| 6459 core.String score; |
| 6460 |
| 6461 /** |
| 6462 * Additional information about this score. Values will contain no more than |
| 6463 * 64 URI-safe characters as defined by section 2.3 of RFC 3986. |
| 6464 */ |
| 6465 core.String scoreTag; |
| 6466 |
| 6467 /** |
| 6468 * The time span for this player score. |
| 6469 * Possible values are: |
| 6470 * - "ALL_TIME" - The score is an all-time score. |
| 6471 * - "WEEKLY" - The score is a weekly score. |
| 6472 * - "DAILY" - The score is a daily score. |
| 6473 */ |
| 6474 core.String timeSpan; |
| 6475 |
| 6476 |
| 6477 PlayerScore(); |
| 6478 |
| 6479 PlayerScore.fromJson(core.Map _json) { |
| 6480 if (_json.containsKey("formattedScore")) { |
| 6481 formattedScore = _json["formattedScore"]; |
| 6482 } |
| 6483 if (_json.containsKey("kind")) { |
| 6484 kind = _json["kind"]; |
| 6485 } |
| 6486 if (_json.containsKey("score")) { |
| 6487 score = _json["score"]; |
| 6488 } |
| 6489 if (_json.containsKey("scoreTag")) { |
| 6490 scoreTag = _json["scoreTag"]; |
| 6491 } |
| 6492 if (_json.containsKey("timeSpan")) { |
| 6493 timeSpan = _json["timeSpan"]; |
| 6494 } |
| 6495 } |
| 6496 |
| 6497 core.Map toJson() { |
| 6498 var _json = new core.Map(); |
| 6499 if (formattedScore != null) { |
| 6500 _json["formattedScore"] = formattedScore; |
| 6501 } |
| 6502 if (kind != null) { |
| 6503 _json["kind"] = kind; |
| 6504 } |
| 6505 if (score != null) { |
| 6506 _json["score"] = score; |
| 6507 } |
| 6508 if (scoreTag != null) { |
| 6509 _json["scoreTag"] = scoreTag; |
| 6510 } |
| 6511 if (timeSpan != null) { |
| 6512 _json["timeSpan"] = timeSpan; |
| 6513 } |
| 6514 return _json; |
| 6515 } |
| 6516 } |
| 6517 |
| 6518 |
| 6519 /** This is a JSON template for a list of score submission statuses. */ |
| 6520 class PlayerScoreListResponse { |
| 6521 /** |
| 6522 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6523 * string games#playerScoreListResponse. |
| 6524 */ |
| 6525 core.String kind; |
| 6526 |
| 6527 /** The score submissions statuses. */ |
| 6528 core.List<PlayerScoreResponse> submittedScores; |
| 6529 |
| 6530 |
| 6531 PlayerScoreListResponse(); |
| 6532 |
| 6533 PlayerScoreListResponse.fromJson(core.Map _json) { |
| 6534 if (_json.containsKey("kind")) { |
| 6535 kind = _json["kind"]; |
| 6536 } |
| 6537 if (_json.containsKey("submittedScores")) { |
| 6538 submittedScores = _json["submittedScores"].map((value) => new PlayerScoreR
esponse.fromJson(value)).toList(); |
| 6539 } |
| 6540 } |
| 6541 |
| 6542 core.Map toJson() { |
| 6543 var _json = new core.Map(); |
| 6544 if (kind != null) { |
| 6545 _json["kind"] = kind; |
| 6546 } |
| 6547 if (submittedScores != null) { |
| 6548 _json["submittedScores"] = submittedScores.map((value) => (value).toJson()
).toList(); |
| 6549 } |
| 6550 return _json; |
| 6551 } |
| 6552 } |
| 6553 |
| 6554 |
| 6555 /** This is a JSON template for a list of leaderboard entry resources. */ |
| 6556 class PlayerScoreResponse { |
| 6557 /** |
| 6558 * The time spans where the submitted score is better than the existing score |
| 6559 * for that time span. |
| 6560 * Possible values are: |
| 6561 * - "ALL_TIME" - The score is an all-time score. |
| 6562 * - "WEEKLY" - The score is a weekly score. |
| 6563 * - "DAILY" - The score is a daily score. |
| 6564 */ |
| 6565 core.List<core.String> beatenScoreTimeSpans; |
| 6566 |
| 6567 /** The formatted value of the submitted score. */ |
| 6568 core.String formattedScore; |
| 6569 |
| 6570 /** |
| 6571 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6572 * string games#playerScoreResponse. |
| 6573 */ |
| 6574 core.String kind; |
| 6575 |
| 6576 /** The leaderboard ID that this score was submitted to. */ |
| 6577 core.String leaderboardId; |
| 6578 |
| 6579 /** |
| 6580 * Additional information about this score. Values will contain no more than |
| 6581 * 64 URI-safe characters as defined by section 2.3 of RFC 3986. |
| 6582 */ |
| 6583 core.String scoreTag; |
| 6584 |
| 6585 /** |
| 6586 * The scores in time spans that have not been beaten. As an example, the |
| 6587 * submitted score may be better than the player's DAILY score, but not better |
| 6588 * than the player's scores for the WEEKLY or ALL_TIME time spans. |
| 6589 */ |
| 6590 core.List<PlayerScore> unbeatenScores; |
| 6591 |
| 6592 |
| 6593 PlayerScoreResponse(); |
| 6594 |
| 6595 PlayerScoreResponse.fromJson(core.Map _json) { |
| 6596 if (_json.containsKey("beatenScoreTimeSpans")) { |
| 6597 beatenScoreTimeSpans = _json["beatenScoreTimeSpans"]; |
| 6598 } |
| 6599 if (_json.containsKey("formattedScore")) { |
| 6600 formattedScore = _json["formattedScore"]; |
| 6601 } |
| 6602 if (_json.containsKey("kind")) { |
| 6603 kind = _json["kind"]; |
| 6604 } |
| 6605 if (_json.containsKey("leaderboardId")) { |
| 6606 leaderboardId = _json["leaderboardId"]; |
| 6607 } |
| 6608 if (_json.containsKey("scoreTag")) { |
| 6609 scoreTag = _json["scoreTag"]; |
| 6610 } |
| 6611 if (_json.containsKey("unbeatenScores")) { |
| 6612 unbeatenScores = _json["unbeatenScores"].map((value) => new PlayerScore.fr
omJson(value)).toList(); |
| 6613 } |
| 6614 } |
| 6615 |
| 6616 core.Map toJson() { |
| 6617 var _json = new core.Map(); |
| 6618 if (beatenScoreTimeSpans != null) { |
| 6619 _json["beatenScoreTimeSpans"] = beatenScoreTimeSpans; |
| 6620 } |
| 6621 if (formattedScore != null) { |
| 6622 _json["formattedScore"] = formattedScore; |
| 6623 } |
| 6624 if (kind != null) { |
| 6625 _json["kind"] = kind; |
| 6626 } |
| 6627 if (leaderboardId != null) { |
| 6628 _json["leaderboardId"] = leaderboardId; |
| 6629 } |
| 6630 if (scoreTag != null) { |
| 6631 _json["scoreTag"] = scoreTag; |
| 6632 } |
| 6633 if (unbeatenScores != null) { |
| 6634 _json["unbeatenScores"] = unbeatenScores.map((value) => (value).toJson()).
toList(); |
| 6635 } |
| 6636 return _json; |
| 6637 } |
| 6638 } |
| 6639 |
| 6640 |
| 6641 /** This is a JSON template for a list of score submission requests */ |
| 6642 class PlayerScoreSubmissionList { |
| 6643 /** |
| 6644 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6645 * string games#playerScoreSubmissionList. |
| 6646 */ |
| 6647 core.String kind; |
| 6648 |
| 6649 /** The score submissions. */ |
| 6650 core.List<ScoreSubmission> scores; |
| 6651 |
| 6652 |
| 6653 PlayerScoreSubmissionList(); |
| 6654 |
| 6655 PlayerScoreSubmissionList.fromJson(core.Map _json) { |
| 6656 if (_json.containsKey("kind")) { |
| 6657 kind = _json["kind"]; |
| 6658 } |
| 6659 if (_json.containsKey("scores")) { |
| 6660 scores = _json["scores"].map((value) => new ScoreSubmission.fromJson(value
)).toList(); |
| 6661 } |
| 6662 } |
| 6663 |
| 6664 core.Map toJson() { |
| 6665 var _json = new core.Map(); |
| 6666 if (kind != null) { |
| 6667 _json["kind"] = kind; |
| 6668 } |
| 6669 if (scores != null) { |
| 6670 _json["scores"] = scores.map((value) => (value).toJson()).toList(); |
| 6671 } |
| 6672 return _json; |
| 6673 } |
| 6674 } |
| 6675 |
| 6676 |
| 6677 /** This is a JSON template for a push token resource. */ |
| 6678 class PushToken { |
| 6679 /** |
| 6680 * The revision of the client SDK used by your application, in the same format |
| 6681 * that's used by revisions.check. Used to send backward compatible messages. |
| 6682 * Format: [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE |
| 6683 * are: |
| 6684 * - IOS - Push token is for iOS |
| 6685 */ |
| 6686 core.String clientRevision; |
| 6687 |
| 6688 /** Unique identifier for this push token. */ |
| 6689 PushTokenId id; |
| 6690 |
| 6691 /** |
| 6692 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6693 * string games#pushToken. |
| 6694 */ |
| 6695 core.String kind; |
| 6696 |
| 6697 /** |
| 6698 * The preferred language for notifications that are sent using this token. |
| 6699 */ |
| 6700 core.String language; |
| 6701 |
| 6702 |
| 6703 PushToken(); |
| 6704 |
| 6705 PushToken.fromJson(core.Map _json) { |
| 6706 if (_json.containsKey("clientRevision")) { |
| 6707 clientRevision = _json["clientRevision"]; |
| 6708 } |
| 6709 if (_json.containsKey("id")) { |
| 6710 id = new PushTokenId.fromJson(_json["id"]); |
| 6711 } |
| 6712 if (_json.containsKey("kind")) { |
| 6713 kind = _json["kind"]; |
| 6714 } |
| 6715 if (_json.containsKey("language")) { |
| 6716 language = _json["language"]; |
| 6717 } |
| 6718 } |
| 6719 |
| 6720 core.Map toJson() { |
| 6721 var _json = new core.Map(); |
| 6722 if (clientRevision != null) { |
| 6723 _json["clientRevision"] = clientRevision; |
| 6724 } |
| 6725 if (id != null) { |
| 6726 _json["id"] = (id).toJson(); |
| 6727 } |
| 6728 if (kind != null) { |
| 6729 _json["kind"] = kind; |
| 6730 } |
| 6731 if (language != null) { |
| 6732 _json["language"] = language; |
| 6733 } |
| 6734 return _json; |
| 6735 } |
| 6736 } |
| 6737 |
| 6738 |
| 6739 /** A push token ID for iOS devices. */ |
| 6740 class PushTokenIdIos { |
| 6741 /** |
| 6742 * Device token supplied by an iOS system call to register for remote |
| 6743 * notifications. Encode this field as web-safe base64. |
| 6744 */ |
| 6745 core.String apnsDeviceToken; |
| 6746 |
| 6747 core.List<core.int> get apnsDeviceTokenAsBytes { |
| 6748 return crypto.CryptoUtils.base64StringToBytes(apnsDeviceToken); |
| 6749 } |
| 6750 |
| 6751 void set apnsDeviceTokenAsBytes(core.List<core.int> _bytes) { |
| 6752 apnsDeviceToken = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); |
| 6753 } |
| 6754 |
| 6755 /** |
| 6756 * Indicates whether this token should be used for the production or sandbox |
| 6757 * APNS server. |
| 6758 */ |
| 6759 core.String apnsEnvironment; |
| 6760 |
| 6761 |
| 6762 PushTokenIdIos(); |
| 6763 |
| 6764 PushTokenIdIos.fromJson(core.Map _json) { |
| 6765 if (_json.containsKey("apns_device_token")) { |
| 6766 apnsDeviceToken = _json["apns_device_token"]; |
| 6767 } |
| 6768 if (_json.containsKey("apns_environment")) { |
| 6769 apnsEnvironment = _json["apns_environment"]; |
| 6770 } |
| 6771 } |
| 6772 |
| 6773 core.Map toJson() { |
| 6774 var _json = new core.Map(); |
| 6775 if (apnsDeviceToken != null) { |
| 6776 _json["apns_device_token"] = apnsDeviceToken; |
| 6777 } |
| 6778 if (apnsEnvironment != null) { |
| 6779 _json["apns_environment"] = apnsEnvironment; |
| 6780 } |
| 6781 return _json; |
| 6782 } |
| 6783 } |
| 6784 |
| 6785 |
| 6786 /** This is a JSON template for a push token ID resource. */ |
| 6787 class PushTokenId { |
| 6788 /** A push token ID for iOS devices. */ |
| 6789 PushTokenIdIos ios; |
| 6790 |
| 6791 /** |
| 6792 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6793 * string games#pushTokenId. |
| 6794 */ |
| 6795 core.String kind; |
| 6796 |
| 6797 |
| 6798 PushTokenId(); |
| 6799 |
| 6800 PushTokenId.fromJson(core.Map _json) { |
| 6801 if (_json.containsKey("ios")) { |
| 6802 ios = new PushTokenIdIos.fromJson(_json["ios"]); |
| 6803 } |
| 6804 if (_json.containsKey("kind")) { |
| 6805 kind = _json["kind"]; |
| 6806 } |
| 6807 } |
| 6808 |
| 6809 core.Map toJson() { |
| 6810 var _json = new core.Map(); |
| 6811 if (ios != null) { |
| 6812 _json["ios"] = (ios).toJson(); |
| 6813 } |
| 6814 if (kind != null) { |
| 6815 _json["kind"] = kind; |
| 6816 } |
| 6817 return _json; |
| 6818 } |
| 6819 } |
| 6820 |
| 6821 |
| 6822 /** This is a JSON template for a Quest resource. */ |
| 6823 class Quest { |
| 6824 /** |
| 6825 * The timestamp at which the user accepted the quest in milliseconds since |
| 6826 * the epoch in UTC. Only present if the player has accepted the quest. |
| 6827 */ |
| 6828 core.String acceptedTimestampMillis; |
| 6829 |
| 6830 /** The ID of the application this quest is part of. */ |
| 6831 core.String applicationId; |
| 6832 |
| 6833 /** The banner image URL for the quest. */ |
| 6834 core.String bannerUrl; |
| 6835 |
| 6836 /** The description of the quest. */ |
| 6837 core.String description; |
| 6838 |
| 6839 /** |
| 6840 * The timestamp at which the quest ceases to be active in milliseconds since |
| 6841 * the epoch in UTC. |
| 6842 */ |
| 6843 core.String endTimestampMillis; |
| 6844 |
| 6845 /** The icon image URL for the quest. */ |
| 6846 core.String iconUrl; |
| 6847 |
| 6848 /** The ID of the quest. */ |
| 6849 core.String id; |
| 6850 |
| 6851 /** |
| 6852 * Indicates whether the banner image being returned is a default image, or is |
| 6853 * game-provided. |
| 6854 */ |
| 6855 core.bool isDefaultBannerUrl; |
| 6856 |
| 6857 /** |
| 6858 * Indicates whether the icon image being returned is a default image, or is |
| 6859 * game-provided. |
| 6860 */ |
| 6861 core.bool isDefaultIconUrl; |
| 6862 |
| 6863 /** |
| 6864 * Uniquely identifies the type of this resource. Value is always the fixed |
| 6865 * string games#quest. |
| 6866 */ |
| 6867 core.String kind; |
| 6868 |
| 6869 /** |
| 6870 * The timestamp at which the quest was last updated by the user in |
| 6871 * milliseconds since the epoch in UTC. Only present if the player has |
| 6872 * accepted the quest. |
| 6873 */ |
| 6874 core.String lastUpdatedTimestampMillis; |
| 6875 |
| 6876 /** The quest milestones. */ |
| 6877 core.List<QuestMilestone> milestones; |
| 6878 |
| 6879 /** The name of the quest. */ |
| 6880 core.String name; |
| 6881 |
| 6882 /** |
| 6883 * The timestamp at which the user should be notified that the quest will end |
| 6884 * soon in milliseconds since the epoch in UTC. |
| 6885 */ |
| 6886 core.String notifyTimestampMillis; |
| 6887 |
| 6888 /** |
| 6889 * The timestamp at which the quest becomes active in milliseconds since the |
| 6890 * epoch in UTC. |
| 6891 */ |
| 6892 core.String startTimestampMillis; |
| 6893 |
| 6894 /** |
| 6895 * The state of the quest. |
| 6896 * Possible values are: |
| 6897 * - "UPCOMING": The quest is upcoming. The user can see the quest, but cannot |
| 6898 * accept it until it is open. |
| 6899 * - "OPEN": The quest is currently open and may be accepted at this time. |
| 6900 * - "ACCEPTED": The user is currently participating in this quest. |
| 6901 * - "COMPLETED": The user has completed the quest. |
| 6902 * - "FAILED": The quest was attempted but was not completed before the |
| 6903 * deadline expired. |
| 6904 * - "EXPIRED": The quest has expired and was not accepted. |
| 6905 * - "DELETED": The quest should be deleted from the local database. |
| 6906 */ |
| 6907 core.String state; |
| 6908 |
| 6909 |
| 6910 Quest(); |
| 6911 |
| 6912 Quest.fromJson(core.Map _json) { |
| 6913 if (_json.containsKey("acceptedTimestampMillis")) { |
| 6914 acceptedTimestampMillis = _json["acceptedTimestampMillis"]; |
| 6915 } |
| 6916 if (_json.containsKey("applicationId")) { |
| 6917 applicationId = _json["applicationId"]; |
| 6918 } |
| 6919 if (_json.containsKey("bannerUrl")) { |
| 6920 bannerUrl = _json["bannerUrl"]; |
| 6921 } |
| 6922 if (_json.containsKey("description")) { |
| 6923 description = _json["description"]; |
| 6924 } |
| 6925 if (_json.containsKey("endTimestampMillis")) { |
| 6926 endTimestampMillis = _json["endTimestampMillis"]; |
| 6927 } |
| 6928 if (_json.containsKey("iconUrl")) { |
| 6929 iconUrl = _json["iconUrl"]; |
| 6930 } |
| 6931 if (_json.containsKey("id")) { |
| 6932 id = _json["id"]; |
| 6933 } |
| 6934 if (_json.containsKey("isDefaultBannerUrl")) { |
| 6935 isDefaultBannerUrl = _json["isDefaultBannerUrl"]; |
| 6936 } |
| 6937 if (_json.containsKey("isDefaultIconUrl")) { |
| 6938 isDefaultIconUrl = _json["isDefaultIconUrl"]; |
| 6939 } |
| 6940 if (_json.containsKey("kind")) { |
| 6941 kind = _json["kind"]; |
| 6942 } |
| 6943 if (_json.containsKey("lastUpdatedTimestampMillis")) { |
| 6944 lastUpdatedTimestampMillis = _json["lastUpdatedTimestampMillis"]; |
| 6945 } |
| 6946 if (_json.containsKey("milestones")) { |
| 6947 milestones = _json["milestones"].map((value) => new QuestMilestone.fromJso
n(value)).toList(); |
| 6948 } |
| 6949 if (_json.containsKey("name")) { |
| 6950 name = _json["name"]; |
| 6951 } |
| 6952 if (_json.containsKey("notifyTimestampMillis")) { |
| 6953 notifyTimestampMillis = _json["notifyTimestampMillis"]; |
| 6954 } |
| 6955 if (_json.containsKey("startTimestampMillis")) { |
| 6956 startTimestampMillis = _json["startTimestampMillis"]; |
| 6957 } |
| 6958 if (_json.containsKey("state")) { |
| 6959 state = _json["state"]; |
| 6960 } |
| 6961 } |
| 6962 |
| 6963 core.Map toJson() { |
| 6964 var _json = new core.Map(); |
| 6965 if (acceptedTimestampMillis != null) { |
| 6966 _json["acceptedTimestampMillis"] = acceptedTimestampMillis; |
| 6967 } |
| 6968 if (applicationId != null) { |
| 6969 _json["applicationId"] = applicationId; |
| 6970 } |
| 6971 if (bannerUrl != null) { |
| 6972 _json["bannerUrl"] = bannerUrl; |
| 6973 } |
| 6974 if (description != null) { |
| 6975 _json["description"] = description; |
| 6976 } |
| 6977 if (endTimestampMillis != null) { |
| 6978 _json["endTimestampMillis"] = endTimestampMillis; |
| 6979 } |
| 6980 if (iconUrl != null) { |
| 6981 _json["iconUrl"] = iconUrl; |
| 6982 } |
| 6983 if (id != null) { |
| 6984 _json["id"] = id; |
| 6985 } |
| 6986 if (isDefaultBannerUrl != null) { |
| 6987 _json["isDefaultBannerUrl"] = isDefaultBannerUrl; |
| 6988 } |
| 6989 if (isDefaultIconUrl != null) { |
| 6990 _json["isDefaultIconUrl"] = isDefaultIconUrl; |
| 6991 } |
| 6992 if (kind != null) { |
| 6993 _json["kind"] = kind; |
| 6994 } |
| 6995 if (lastUpdatedTimestampMillis != null) { |
| 6996 _json["lastUpdatedTimestampMillis"] = lastUpdatedTimestampMillis; |
| 6997 } |
| 6998 if (milestones != null) { |
| 6999 _json["milestones"] = milestones.map((value) => (value).toJson()).toList()
; |
| 7000 } |
| 7001 if (name != null) { |
| 7002 _json["name"] = name; |
| 7003 } |
| 7004 if (notifyTimestampMillis != null) { |
| 7005 _json["notifyTimestampMillis"] = notifyTimestampMillis; |
| 7006 } |
| 7007 if (startTimestampMillis != null) { |
| 7008 _json["startTimestampMillis"] = startTimestampMillis; |
| 7009 } |
| 7010 if (state != null) { |
| 7011 _json["state"] = state; |
| 7012 } |
| 7013 return _json; |
| 7014 } |
| 7015 } |
| 7016 |
| 7017 |
| 7018 /** This is a JSON template for a Quest Criterion Contribution resource. */ |
| 7019 class QuestContribution { |
| 7020 /** |
| 7021 * The formatted value of the contribution as a string. Format depends on the |
| 7022 * configuration for the associated event definition in the Play Games |
| 7023 * Developer Console. |
| 7024 */ |
| 7025 core.String formattedValue; |
| 7026 |
| 7027 /** |
| 7028 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7029 * string games#questContribution. |
| 7030 */ |
| 7031 core.String kind; |
| 7032 |
| 7033 /** The value of the contribution. */ |
| 7034 core.String value; |
| 7035 |
| 7036 |
| 7037 QuestContribution(); |
| 7038 |
| 7039 QuestContribution.fromJson(core.Map _json) { |
| 7040 if (_json.containsKey("formattedValue")) { |
| 7041 formattedValue = _json["formattedValue"]; |
| 7042 } |
| 7043 if (_json.containsKey("kind")) { |
| 7044 kind = _json["kind"]; |
| 7045 } |
| 7046 if (_json.containsKey("value")) { |
| 7047 value = _json["value"]; |
| 7048 } |
| 7049 } |
| 7050 |
| 7051 core.Map toJson() { |
| 7052 var _json = new core.Map(); |
| 7053 if (formattedValue != null) { |
| 7054 _json["formattedValue"] = formattedValue; |
| 7055 } |
| 7056 if (kind != null) { |
| 7057 _json["kind"] = kind; |
| 7058 } |
| 7059 if (value != null) { |
| 7060 _json["value"] = value; |
| 7061 } |
| 7062 return _json; |
| 7063 } |
| 7064 } |
| 7065 |
| 7066 |
| 7067 /** This is a JSON template for a Quest Criterion resource. */ |
| 7068 class QuestCriterion { |
| 7069 /** |
| 7070 * The total number of times the associated event must be incremented for the |
| 7071 * player to complete this quest. |
| 7072 */ |
| 7073 QuestContribution completionContribution; |
| 7074 |
| 7075 /** |
| 7076 * The number of increments the player has made toward the completion count |
| 7077 * event increments required to complete the quest. This value will not exceed |
| 7078 * the completion contribution. |
| 7079 * There will be no currentContribution until the player has accepted the |
| 7080 * quest. |
| 7081 */ |
| 7082 QuestContribution currentContribution; |
| 7083 |
| 7084 /** The ID of the event the criterion corresponds to. */ |
| 7085 core.String eventId; |
| 7086 |
| 7087 /** |
| 7088 * The value of the event associated with this quest at the time that the |
| 7089 * quest was accepted. This value may change if event increments that took |
| 7090 * place before the start of quest are uploaded after the quest starts. |
| 7091 * There will be no initialPlayerProgress until the player has accepted the |
| 7092 * quest. |
| 7093 */ |
| 7094 QuestContribution initialPlayerProgress; |
| 7095 |
| 7096 /** |
| 7097 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7098 * string games#questCriterion. |
| 7099 */ |
| 7100 core.String kind; |
| 7101 |
| 7102 |
| 7103 QuestCriterion(); |
| 7104 |
| 7105 QuestCriterion.fromJson(core.Map _json) { |
| 7106 if (_json.containsKey("completionContribution")) { |
| 7107 completionContribution = new QuestContribution.fromJson(_json["completionC
ontribution"]); |
| 7108 } |
| 7109 if (_json.containsKey("currentContribution")) { |
| 7110 currentContribution = new QuestContribution.fromJson(_json["currentContrib
ution"]); |
| 7111 } |
| 7112 if (_json.containsKey("eventId")) { |
| 7113 eventId = _json["eventId"]; |
| 7114 } |
| 7115 if (_json.containsKey("initialPlayerProgress")) { |
| 7116 initialPlayerProgress = new QuestContribution.fromJson(_json["initialPlaye
rProgress"]); |
| 7117 } |
| 7118 if (_json.containsKey("kind")) { |
| 7119 kind = _json["kind"]; |
| 7120 } |
| 7121 } |
| 7122 |
| 7123 core.Map toJson() { |
| 7124 var _json = new core.Map(); |
| 7125 if (completionContribution != null) { |
| 7126 _json["completionContribution"] = (completionContribution).toJson(); |
| 7127 } |
| 7128 if (currentContribution != null) { |
| 7129 _json["currentContribution"] = (currentContribution).toJson(); |
| 7130 } |
| 7131 if (eventId != null) { |
| 7132 _json["eventId"] = eventId; |
| 7133 } |
| 7134 if (initialPlayerProgress != null) { |
| 7135 _json["initialPlayerProgress"] = (initialPlayerProgress).toJson(); |
| 7136 } |
| 7137 if (kind != null) { |
| 7138 _json["kind"] = kind; |
| 7139 } |
| 7140 return _json; |
| 7141 } |
| 7142 } |
| 7143 |
| 7144 |
| 7145 /** This is a JSON template for a list of quest objects. */ |
| 7146 class QuestListResponse { |
| 7147 /** The quests. */ |
| 7148 core.List<Quest> items; |
| 7149 |
| 7150 /** |
| 7151 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7152 * string games#questListResponse. |
| 7153 */ |
| 7154 core.String kind; |
| 7155 |
| 7156 /** Token corresponding to the next page of results. */ |
| 7157 core.String nextPageToken; |
| 7158 |
| 7159 |
| 7160 QuestListResponse(); |
| 7161 |
| 7162 QuestListResponse.fromJson(core.Map _json) { |
| 7163 if (_json.containsKey("items")) { |
| 7164 items = _json["items"].map((value) => new Quest.fromJson(value)).toList(); |
| 7165 } |
| 7166 if (_json.containsKey("kind")) { |
| 7167 kind = _json["kind"]; |
| 7168 } |
| 7169 if (_json.containsKey("nextPageToken")) { |
| 7170 nextPageToken = _json["nextPageToken"]; |
| 7171 } |
| 7172 } |
| 7173 |
| 7174 core.Map toJson() { |
| 7175 var _json = new core.Map(); |
| 7176 if (items != null) { |
| 7177 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 7178 } |
| 7179 if (kind != null) { |
| 7180 _json["kind"] = kind; |
| 7181 } |
| 7182 if (nextPageToken != null) { |
| 7183 _json["nextPageToken"] = nextPageToken; |
| 7184 } |
| 7185 return _json; |
| 7186 } |
| 7187 } |
| 7188 |
| 7189 |
| 7190 /** This is a JSON template for a Quest Milestone resource. */ |
| 7191 class QuestMilestone { |
| 7192 /** |
| 7193 * The completion reward data of the milestone, represented as a |
| 7194 * Base64-encoded string. This is a developer-specified binary blob with size |
| 7195 * between 0 and 2 KB before encoding. |
| 7196 */ |
| 7197 core.String completionRewardData; |
| 7198 |
| 7199 core.List<core.int> get completionRewardDataAsBytes { |
| 7200 return crypto.CryptoUtils.base64StringToBytes(completionRewardData); |
| 7201 } |
| 7202 |
| 7203 void set completionRewardDataAsBytes(core.List<core.int> _bytes) { |
| 7204 completionRewardData = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: tru
e); |
| 7205 } |
| 7206 |
| 7207 /** The criteria of the milestone. */ |
| 7208 core.List<QuestCriterion> criteria; |
| 7209 |
| 7210 /** The milestone ID. */ |
| 7211 core.String id; |
| 7212 |
| 7213 /** |
| 7214 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7215 * string games#questMilestone. |
| 7216 */ |
| 7217 core.String kind; |
| 7218 |
| 7219 /** |
| 7220 * The current state of the milestone. |
| 7221 * Possible values are: |
| 7222 * - "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has not yet been |
| 7223 * claimed. |
| 7224 * - "CLAIMED" - The milestone is complete and has been claimed. |
| 7225 * - "NOT_COMPLETED" - The milestone has not yet been completed. |
| 7226 * - "NOT_STARTED" - The milestone is for a quest that has not yet been |
| 7227 * accepted. |
| 7228 */ |
| 7229 core.String state; |
| 7230 |
| 7231 |
| 7232 QuestMilestone(); |
| 7233 |
| 7234 QuestMilestone.fromJson(core.Map _json) { |
| 7235 if (_json.containsKey("completionRewardData")) { |
| 7236 completionRewardData = _json["completionRewardData"]; |
| 7237 } |
| 7238 if (_json.containsKey("criteria")) { |
| 7239 criteria = _json["criteria"].map((value) => new QuestCriterion.fromJson(va
lue)).toList(); |
| 7240 } |
| 7241 if (_json.containsKey("id")) { |
| 7242 id = _json["id"]; |
| 7243 } |
| 7244 if (_json.containsKey("kind")) { |
| 7245 kind = _json["kind"]; |
| 7246 } |
| 7247 if (_json.containsKey("state")) { |
| 7248 state = _json["state"]; |
| 7249 } |
| 7250 } |
| 7251 |
| 7252 core.Map toJson() { |
| 7253 var _json = new core.Map(); |
| 7254 if (completionRewardData != null) { |
| 7255 _json["completionRewardData"] = completionRewardData; |
| 7256 } |
| 7257 if (criteria != null) { |
| 7258 _json["criteria"] = criteria.map((value) => (value).toJson()).toList(); |
| 7259 } |
| 7260 if (id != null) { |
| 7261 _json["id"] = id; |
| 7262 } |
| 7263 if (kind != null) { |
| 7264 _json["kind"] = kind; |
| 7265 } |
| 7266 if (state != null) { |
| 7267 _json["state"] = state; |
| 7268 } |
| 7269 return _json; |
| 7270 } |
| 7271 } |
| 7272 |
| 7273 |
| 7274 /** This is a JSON template for the result of checking a revision. */ |
| 7275 class RevisionCheckResponse { |
| 7276 /** |
| 7277 * The version of the API this client revision should use when calling API |
| 7278 * methods. |
| 7279 */ |
| 7280 core.String apiVersion; |
| 7281 |
| 7282 /** |
| 7283 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7284 * string games#revisionCheckResponse. |
| 7285 */ |
| 7286 core.String kind; |
| 7287 |
| 7288 /** |
| 7289 * The result of the revision check. |
| 7290 * Possible values are: |
| 7291 * - "OK" - The revision being used is current. |
| 7292 * - "DEPRECATED" - There is currently a newer version available, but the |
| 7293 * revision being used still works. |
| 7294 * - "INVALID" - The revision being used is not supported in any released |
| 7295 * version. |
| 7296 */ |
| 7297 core.String revisionStatus; |
| 7298 |
| 7299 |
| 7300 RevisionCheckResponse(); |
| 7301 |
| 7302 RevisionCheckResponse.fromJson(core.Map _json) { |
| 7303 if (_json.containsKey("apiVersion")) { |
| 7304 apiVersion = _json["apiVersion"]; |
| 7305 } |
| 7306 if (_json.containsKey("kind")) { |
| 7307 kind = _json["kind"]; |
| 7308 } |
| 7309 if (_json.containsKey("revisionStatus")) { |
| 7310 revisionStatus = _json["revisionStatus"]; |
| 7311 } |
| 7312 } |
| 7313 |
| 7314 core.Map toJson() { |
| 7315 var _json = new core.Map(); |
| 7316 if (apiVersion != null) { |
| 7317 _json["apiVersion"] = apiVersion; |
| 7318 } |
| 7319 if (kind != null) { |
| 7320 _json["kind"] = kind; |
| 7321 } |
| 7322 if (revisionStatus != null) { |
| 7323 _json["revisionStatus"] = revisionStatus; |
| 7324 } |
| 7325 return _json; |
| 7326 } |
| 7327 } |
| 7328 |
| 7329 |
| 7330 /** This is a JSON template for a room resource object. */ |
| 7331 class Room { |
| 7332 /** The ID of the application being played. */ |
| 7333 core.String applicationId; |
| 7334 |
| 7335 /** Criteria for auto-matching players into this room. */ |
| 7336 RoomAutoMatchingCriteria autoMatchingCriteria; |
| 7337 |
| 7338 /** |
| 7339 * Auto-matching status for this room. Not set if the room is not currently in |
| 7340 * the auto-matching queue. |
| 7341 */ |
| 7342 RoomAutoMatchStatus autoMatchingStatus; |
| 7343 |
| 7344 /** Details about the room creation. */ |
| 7345 RoomModification creationDetails; |
| 7346 |
| 7347 /** |
| 7348 * This short description is generated by our servers and worded relative to |
| 7349 * the player requesting the room. It is intended to be displayed when the |
| 7350 * room is shown in a list (that is, an invitation to a room.) |
| 7351 */ |
| 7352 core.String description; |
| 7353 |
| 7354 /** |
| 7355 * The ID of the participant that invited the user to the room. Not set if the |
| 7356 * user was not invited to the room. |
| 7357 */ |
| 7358 core.String inviterId; |
| 7359 |
| 7360 /** |
| 7361 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7362 * string games#room. |
| 7363 */ |
| 7364 core.String kind; |
| 7365 |
| 7366 /** Details about the last update to the room. */ |
| 7367 RoomModification lastUpdateDetails; |
| 7368 |
| 7369 /** |
| 7370 * The participants involved in the room, along with their statuses. Includes |
| 7371 * participants who have left or declined invitations. |
| 7372 */ |
| 7373 core.List<RoomParticipant> participants; |
| 7374 |
| 7375 /** Globally unique ID for a room. */ |
| 7376 core.String roomId; |
| 7377 |
| 7378 /** |
| 7379 * The version of the room status: an increasing counter, used by the client |
| 7380 * to ignore out-of-order updates to room status. |
| 7381 */ |
| 7382 core.int roomStatusVersion; |
| 7383 |
| 7384 /** |
| 7385 * The status of the room. |
| 7386 * Possible values are: |
| 7387 * - "ROOM_INVITING" - One or more players have been invited and not |
| 7388 * responded. |
| 7389 * - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by |
| 7390 * auto-matching. |
| 7391 * - "ROOM_CONNECTING" - Players have joined and are connecting to each other |
| 7392 * (either before or after auto-matching). |
| 7393 * - "ROOM_ACTIVE" - All players have joined and connected to each other. |
| 7394 * - "ROOM_DELETED" - The room should no longer be shown on the client. |
| 7395 * Returned in sync calls when a player joins a room (as a tombstone), or for |
| 7396 * rooms where all joined participants have left. |
| 7397 */ |
| 7398 core.String status; |
| 7399 |
| 7400 /** |
| 7401 * The variant / mode of the application being played; can be any integer |
| 7402 * value, or left blank. |
| 7403 */ |
| 7404 core.int variant; |
| 7405 |
| 7406 |
| 7407 Room(); |
| 7408 |
| 7409 Room.fromJson(core.Map _json) { |
| 7410 if (_json.containsKey("applicationId")) { |
| 7411 applicationId = _json["applicationId"]; |
| 7412 } |
| 7413 if (_json.containsKey("autoMatchingCriteria")) { |
| 7414 autoMatchingCriteria = new RoomAutoMatchingCriteria.fromJson(_json["autoMa
tchingCriteria"]); |
| 7415 } |
| 7416 if (_json.containsKey("autoMatchingStatus")) { |
| 7417 autoMatchingStatus = new RoomAutoMatchStatus.fromJson(_json["autoMatchingS
tatus"]); |
| 7418 } |
| 7419 if (_json.containsKey("creationDetails")) { |
| 7420 creationDetails = new RoomModification.fromJson(_json["creationDetails"]); |
| 7421 } |
| 7422 if (_json.containsKey("description")) { |
| 7423 description = _json["description"]; |
| 7424 } |
| 7425 if (_json.containsKey("inviterId")) { |
| 7426 inviterId = _json["inviterId"]; |
| 7427 } |
| 7428 if (_json.containsKey("kind")) { |
| 7429 kind = _json["kind"]; |
| 7430 } |
| 7431 if (_json.containsKey("lastUpdateDetails")) { |
| 7432 lastUpdateDetails = new RoomModification.fromJson(_json["lastUpdateDetails
"]); |
| 7433 } |
| 7434 if (_json.containsKey("participants")) { |
| 7435 participants = _json["participants"].map((value) => new RoomParticipant.fr
omJson(value)).toList(); |
| 7436 } |
| 7437 if (_json.containsKey("roomId")) { |
| 7438 roomId = _json["roomId"]; |
| 7439 } |
| 7440 if (_json.containsKey("roomStatusVersion")) { |
| 7441 roomStatusVersion = _json["roomStatusVersion"]; |
| 7442 } |
| 7443 if (_json.containsKey("status")) { |
| 7444 status = _json["status"]; |
| 7445 } |
| 7446 if (_json.containsKey("variant")) { |
| 7447 variant = _json["variant"]; |
| 7448 } |
| 7449 } |
| 7450 |
| 7451 core.Map toJson() { |
| 7452 var _json = new core.Map(); |
| 7453 if (applicationId != null) { |
| 7454 _json["applicationId"] = applicationId; |
| 7455 } |
| 7456 if (autoMatchingCriteria != null) { |
| 7457 _json["autoMatchingCriteria"] = (autoMatchingCriteria).toJson(); |
| 7458 } |
| 7459 if (autoMatchingStatus != null) { |
| 7460 _json["autoMatchingStatus"] = (autoMatchingStatus).toJson(); |
| 7461 } |
| 7462 if (creationDetails != null) { |
| 7463 _json["creationDetails"] = (creationDetails).toJson(); |
| 7464 } |
| 7465 if (description != null) { |
| 7466 _json["description"] = description; |
| 7467 } |
| 7468 if (inviterId != null) { |
| 7469 _json["inviterId"] = inviterId; |
| 7470 } |
| 7471 if (kind != null) { |
| 7472 _json["kind"] = kind; |
| 7473 } |
| 7474 if (lastUpdateDetails != null) { |
| 7475 _json["lastUpdateDetails"] = (lastUpdateDetails).toJson(); |
| 7476 } |
| 7477 if (participants != null) { |
| 7478 _json["participants"] = participants.map((value) => (value).toJson()).toLi
st(); |
| 7479 } |
| 7480 if (roomId != null) { |
| 7481 _json["roomId"] = roomId; |
| 7482 } |
| 7483 if (roomStatusVersion != null) { |
| 7484 _json["roomStatusVersion"] = roomStatusVersion; |
| 7485 } |
| 7486 if (status != null) { |
| 7487 _json["status"] = status; |
| 7488 } |
| 7489 if (variant != null) { |
| 7490 _json["variant"] = variant; |
| 7491 } |
| 7492 return _json; |
| 7493 } |
| 7494 } |
| 7495 |
| 7496 |
| 7497 /** |
| 7498 * This is a JSON template for status of room automatching that is in progress. |
| 7499 */ |
| 7500 class RoomAutoMatchStatus { |
| 7501 /** |
| 7502 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7503 * string games#roomAutoMatchStatus. |
| 7504 */ |
| 7505 core.String kind; |
| 7506 |
| 7507 /** |
| 7508 * An estimate for the amount of time (in seconds) that auto-matching is |
| 7509 * expected to take to complete. |
| 7510 */ |
| 7511 core.int waitEstimateSeconds; |
| 7512 |
| 7513 |
| 7514 RoomAutoMatchStatus(); |
| 7515 |
| 7516 RoomAutoMatchStatus.fromJson(core.Map _json) { |
| 7517 if (_json.containsKey("kind")) { |
| 7518 kind = _json["kind"]; |
| 7519 } |
| 7520 if (_json.containsKey("waitEstimateSeconds")) { |
| 7521 waitEstimateSeconds = _json["waitEstimateSeconds"]; |
| 7522 } |
| 7523 } |
| 7524 |
| 7525 core.Map toJson() { |
| 7526 var _json = new core.Map(); |
| 7527 if (kind != null) { |
| 7528 _json["kind"] = kind; |
| 7529 } |
| 7530 if (waitEstimateSeconds != null) { |
| 7531 _json["waitEstimateSeconds"] = waitEstimateSeconds; |
| 7532 } |
| 7533 return _json; |
| 7534 } |
| 7535 } |
| 7536 |
| 7537 |
| 7538 /** This is a JSON template for a room auto-match criteria object. */ |
| 7539 class RoomAutoMatchingCriteria { |
| 7540 /** |
| 7541 * A bitmask indicating when auto-matches are valid. When ANDed with other |
| 7542 * exclusive bitmasks, the result must be zero. Can be used to support |
| 7543 * exclusive roles within a game. |
| 7544 */ |
| 7545 core.String exclusiveBitmask; |
| 7546 |
| 7547 /** |
| 7548 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7549 * string games#roomAutoMatchingCriteria. |
| 7550 */ |
| 7551 core.String kind; |
| 7552 |
| 7553 /** |
| 7554 * The maximum number of players that should be added to the room by |
| 7555 * auto-matching. |
| 7556 */ |
| 7557 core.int maxAutoMatchingPlayers; |
| 7558 |
| 7559 /** |
| 7560 * The minimum number of players that should be added to the room by |
| 7561 * auto-matching. |
| 7562 */ |
| 7563 core.int minAutoMatchingPlayers; |
| 7564 |
| 7565 |
| 7566 RoomAutoMatchingCriteria(); |
| 7567 |
| 7568 RoomAutoMatchingCriteria.fromJson(core.Map _json) { |
| 7569 if (_json.containsKey("exclusiveBitmask")) { |
| 7570 exclusiveBitmask = _json["exclusiveBitmask"]; |
| 7571 } |
| 7572 if (_json.containsKey("kind")) { |
| 7573 kind = _json["kind"]; |
| 7574 } |
| 7575 if (_json.containsKey("maxAutoMatchingPlayers")) { |
| 7576 maxAutoMatchingPlayers = _json["maxAutoMatchingPlayers"]; |
| 7577 } |
| 7578 if (_json.containsKey("minAutoMatchingPlayers")) { |
| 7579 minAutoMatchingPlayers = _json["minAutoMatchingPlayers"]; |
| 7580 } |
| 7581 } |
| 7582 |
| 7583 core.Map toJson() { |
| 7584 var _json = new core.Map(); |
| 7585 if (exclusiveBitmask != null) { |
| 7586 _json["exclusiveBitmask"] = exclusiveBitmask; |
| 7587 } |
| 7588 if (kind != null) { |
| 7589 _json["kind"] = kind; |
| 7590 } |
| 7591 if (maxAutoMatchingPlayers != null) { |
| 7592 _json["maxAutoMatchingPlayers"] = maxAutoMatchingPlayers; |
| 7593 } |
| 7594 if (minAutoMatchingPlayers != null) { |
| 7595 _json["minAutoMatchingPlayers"] = minAutoMatchingPlayers; |
| 7596 } |
| 7597 return _json; |
| 7598 } |
| 7599 } |
| 7600 |
| 7601 |
| 7602 /** This is a JSON template for the client address when setting up a room. */ |
| 7603 class RoomClientAddress { |
| 7604 /** |
| 7605 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7606 * string games#roomClientAddress. |
| 7607 */ |
| 7608 core.String kind; |
| 7609 |
| 7610 /** The XMPP address of the client on the Google Games XMPP network. */ |
| 7611 core.String xmppAddress; |
| 7612 |
| 7613 |
| 7614 RoomClientAddress(); |
| 7615 |
| 7616 RoomClientAddress.fromJson(core.Map _json) { |
| 7617 if (_json.containsKey("kind")) { |
| 7618 kind = _json["kind"]; |
| 7619 } |
| 7620 if (_json.containsKey("xmppAddress")) { |
| 7621 xmppAddress = _json["xmppAddress"]; |
| 7622 } |
| 7623 } |
| 7624 |
| 7625 core.Map toJson() { |
| 7626 var _json = new core.Map(); |
| 7627 if (kind != null) { |
| 7628 _json["kind"] = kind; |
| 7629 } |
| 7630 if (xmppAddress != null) { |
| 7631 _json["xmppAddress"] = xmppAddress; |
| 7632 } |
| 7633 return _json; |
| 7634 } |
| 7635 } |
| 7636 |
| 7637 |
| 7638 /** This is a JSON template for a room creation request. */ |
| 7639 class RoomCreateRequest { |
| 7640 /** Criteria for auto-matching players into this room. */ |
| 7641 RoomAutoMatchingCriteria autoMatchingCriteria; |
| 7642 |
| 7643 /** The capabilities that this client supports for realtime communication. */ |
| 7644 core.List<core.String> capabilities; |
| 7645 |
| 7646 /** Client address for the player creating the room. */ |
| 7647 RoomClientAddress clientAddress; |
| 7648 |
| 7649 /** The player IDs to invite to the room. */ |
| 7650 core.List<core.String> invitedPlayerIds; |
| 7651 |
| 7652 /** |
| 7653 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7654 * string games#roomCreateRequest. |
| 7655 */ |
| 7656 core.String kind; |
| 7657 |
| 7658 /** Network diagnostics for the client creating the room. */ |
| 7659 NetworkDiagnostics networkDiagnostics; |
| 7660 |
| 7661 /** |
| 7662 * A randomly generated numeric ID. This number is used at the server to |
| 7663 * ensure that the request is handled correctly across retries. |
| 7664 */ |
| 7665 core.String requestId; |
| 7666 |
| 7667 /** |
| 7668 * The variant / mode of the application to be played. This can be any integer |
| 7669 * value, or left blank. You should use a small number of variants to keep the |
| 7670 * auto-matching pool as large as possible. |
| 7671 */ |
| 7672 core.int variant; |
| 7673 |
| 7674 |
| 7675 RoomCreateRequest(); |
| 7676 |
| 7677 RoomCreateRequest.fromJson(core.Map _json) { |
| 7678 if (_json.containsKey("autoMatchingCriteria")) { |
| 7679 autoMatchingCriteria = new RoomAutoMatchingCriteria.fromJson(_json["autoMa
tchingCriteria"]); |
| 7680 } |
| 7681 if (_json.containsKey("capabilities")) { |
| 7682 capabilities = _json["capabilities"]; |
| 7683 } |
| 7684 if (_json.containsKey("clientAddress")) { |
| 7685 clientAddress = new RoomClientAddress.fromJson(_json["clientAddress"]); |
| 7686 } |
| 7687 if (_json.containsKey("invitedPlayerIds")) { |
| 7688 invitedPlayerIds = _json["invitedPlayerIds"]; |
| 7689 } |
| 7690 if (_json.containsKey("kind")) { |
| 7691 kind = _json["kind"]; |
| 7692 } |
| 7693 if (_json.containsKey("networkDiagnostics")) { |
| 7694 networkDiagnostics = new NetworkDiagnostics.fromJson(_json["networkDiagnos
tics"]); |
| 7695 } |
| 7696 if (_json.containsKey("requestId")) { |
| 7697 requestId = _json["requestId"]; |
| 7698 } |
| 7699 if (_json.containsKey("variant")) { |
| 7700 variant = _json["variant"]; |
| 7701 } |
| 7702 } |
| 7703 |
| 7704 core.Map toJson() { |
| 7705 var _json = new core.Map(); |
| 7706 if (autoMatchingCriteria != null) { |
| 7707 _json["autoMatchingCriteria"] = (autoMatchingCriteria).toJson(); |
| 7708 } |
| 7709 if (capabilities != null) { |
| 7710 _json["capabilities"] = capabilities; |
| 7711 } |
| 7712 if (clientAddress != null) { |
| 7713 _json["clientAddress"] = (clientAddress).toJson(); |
| 7714 } |
| 7715 if (invitedPlayerIds != null) { |
| 7716 _json["invitedPlayerIds"] = invitedPlayerIds; |
| 7717 } |
| 7718 if (kind != null) { |
| 7719 _json["kind"] = kind; |
| 7720 } |
| 7721 if (networkDiagnostics != null) { |
| 7722 _json["networkDiagnostics"] = (networkDiagnostics).toJson(); |
| 7723 } |
| 7724 if (requestId != null) { |
| 7725 _json["requestId"] = requestId; |
| 7726 } |
| 7727 if (variant != null) { |
| 7728 _json["variant"] = variant; |
| 7729 } |
| 7730 return _json; |
| 7731 } |
| 7732 } |
| 7733 |
| 7734 |
| 7735 /** This is a JSON template for a join room request. */ |
| 7736 class RoomJoinRequest { |
| 7737 /** The capabilities that this client supports for realtime communication. */ |
| 7738 core.List<core.String> capabilities; |
| 7739 |
| 7740 /** Client address for the player joining the room. */ |
| 7741 RoomClientAddress clientAddress; |
| 7742 |
| 7743 /** |
| 7744 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7745 * string games#roomJoinRequest. |
| 7746 */ |
| 7747 core.String kind; |
| 7748 |
| 7749 /** Network diagnostics for the client joining the room. */ |
| 7750 NetworkDiagnostics networkDiagnostics; |
| 7751 |
| 7752 |
| 7753 RoomJoinRequest(); |
| 7754 |
| 7755 RoomJoinRequest.fromJson(core.Map _json) { |
| 7756 if (_json.containsKey("capabilities")) { |
| 7757 capabilities = _json["capabilities"]; |
| 7758 } |
| 7759 if (_json.containsKey("clientAddress")) { |
| 7760 clientAddress = new RoomClientAddress.fromJson(_json["clientAddress"]); |
| 7761 } |
| 7762 if (_json.containsKey("kind")) { |
| 7763 kind = _json["kind"]; |
| 7764 } |
| 7765 if (_json.containsKey("networkDiagnostics")) { |
| 7766 networkDiagnostics = new NetworkDiagnostics.fromJson(_json["networkDiagnos
tics"]); |
| 7767 } |
| 7768 } |
| 7769 |
| 7770 core.Map toJson() { |
| 7771 var _json = new core.Map(); |
| 7772 if (capabilities != null) { |
| 7773 _json["capabilities"] = capabilities; |
| 7774 } |
| 7775 if (clientAddress != null) { |
| 7776 _json["clientAddress"] = (clientAddress).toJson(); |
| 7777 } |
| 7778 if (kind != null) { |
| 7779 _json["kind"] = kind; |
| 7780 } |
| 7781 if (networkDiagnostics != null) { |
| 7782 _json["networkDiagnostics"] = (networkDiagnostics).toJson(); |
| 7783 } |
| 7784 return _json; |
| 7785 } |
| 7786 } |
| 7787 |
| 7788 |
| 7789 /** This is a JSON template for room leave diagnostics. */ |
| 7790 class RoomLeaveDiagnostics { |
| 7791 /** |
| 7792 * Android network subtype. |
| 7793 * http://developer.android.com/reference/android/net/NetworkInfo.html#getSubt
ype() |
| 7794 */ |
| 7795 core.int androidNetworkSubtype; |
| 7796 |
| 7797 /** |
| 7798 * Android network type. |
| 7799 * http://developer.android.com/reference/android/net/NetworkInfo.html#getType
() |
| 7800 */ |
| 7801 core.int androidNetworkType; |
| 7802 |
| 7803 /** iOS network type as defined in Reachability.h. */ |
| 7804 core.int iosNetworkType; |
| 7805 |
| 7806 /** |
| 7807 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7808 * string games#roomLeaveDiagnostics. |
| 7809 */ |
| 7810 core.String kind; |
| 7811 |
| 7812 /** |
| 7813 * The MCC+MNC code for the client's network connection. On Android: |
| 7814 * http://developer.android.com/reference/android/telephony/TelephonyManager.h
tml#getNetworkOperator() |
| 7815 * On iOS, see: |
| 7816 * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Re
ference/CTCarrier/Reference/Reference.html |
| 7817 */ |
| 7818 core.String networkOperatorCode; |
| 7819 |
| 7820 /** |
| 7821 * The name of the carrier of the client's network connection. On Android: |
| 7822 * http://developer.android.com/reference/android/telephony/TelephonyManager.h
tml#getNetworkOperatorName() |
| 7823 * On iOS: |
| 7824 * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Re
ference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carri
erName |
| 7825 */ |
| 7826 core.String networkOperatorName; |
| 7827 |
| 7828 /** Diagnostics about all peer sessions. */ |
| 7829 core.List<PeerSessionDiagnostics> peerSession; |
| 7830 |
| 7831 /** Whether or not sockets were used. */ |
| 7832 core.bool socketsUsed; |
| 7833 |
| 7834 |
| 7835 RoomLeaveDiagnostics(); |
| 7836 |
| 7837 RoomLeaveDiagnostics.fromJson(core.Map _json) { |
| 7838 if (_json.containsKey("androidNetworkSubtype")) { |
| 7839 androidNetworkSubtype = _json["androidNetworkSubtype"]; |
| 7840 } |
| 7841 if (_json.containsKey("androidNetworkType")) { |
| 7842 androidNetworkType = _json["androidNetworkType"]; |
| 7843 } |
| 7844 if (_json.containsKey("iosNetworkType")) { |
| 7845 iosNetworkType = _json["iosNetworkType"]; |
| 7846 } |
| 7847 if (_json.containsKey("kind")) { |
| 7848 kind = _json["kind"]; |
| 7849 } |
| 7850 if (_json.containsKey("networkOperatorCode")) { |
| 7851 networkOperatorCode = _json["networkOperatorCode"]; |
| 7852 } |
| 7853 if (_json.containsKey("networkOperatorName")) { |
| 7854 networkOperatorName = _json["networkOperatorName"]; |
| 7855 } |
| 7856 if (_json.containsKey("peerSession")) { |
| 7857 peerSession = _json["peerSession"].map((value) => new PeerSessionDiagnosti
cs.fromJson(value)).toList(); |
| 7858 } |
| 7859 if (_json.containsKey("socketsUsed")) { |
| 7860 socketsUsed = _json["socketsUsed"]; |
| 7861 } |
| 7862 } |
| 7863 |
| 7864 core.Map toJson() { |
| 7865 var _json = new core.Map(); |
| 7866 if (androidNetworkSubtype != null) { |
| 7867 _json["androidNetworkSubtype"] = androidNetworkSubtype; |
| 7868 } |
| 7869 if (androidNetworkType != null) { |
| 7870 _json["androidNetworkType"] = androidNetworkType; |
| 7871 } |
| 7872 if (iosNetworkType != null) { |
| 7873 _json["iosNetworkType"] = iosNetworkType; |
| 7874 } |
| 7875 if (kind != null) { |
| 7876 _json["kind"] = kind; |
| 7877 } |
| 7878 if (networkOperatorCode != null) { |
| 7879 _json["networkOperatorCode"] = networkOperatorCode; |
| 7880 } |
| 7881 if (networkOperatorName != null) { |
| 7882 _json["networkOperatorName"] = networkOperatorName; |
| 7883 } |
| 7884 if (peerSession != null) { |
| 7885 _json["peerSession"] = peerSession.map((value) => (value).toJson()).toList
(); |
| 7886 } |
| 7887 if (socketsUsed != null) { |
| 7888 _json["socketsUsed"] = socketsUsed; |
| 7889 } |
| 7890 return _json; |
| 7891 } |
| 7892 } |
| 7893 |
| 7894 |
| 7895 /** This is a JSON template for a leave room request. */ |
| 7896 class RoomLeaveRequest { |
| 7897 /** |
| 7898 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7899 * string games#roomLeaveRequest. |
| 7900 */ |
| 7901 core.String kind; |
| 7902 |
| 7903 /** Diagnostics for a player leaving the room. */ |
| 7904 RoomLeaveDiagnostics leaveDiagnostics; |
| 7905 |
| 7906 /** |
| 7907 * Reason for leaving the match. |
| 7908 * Possible values are: |
| 7909 * - "PLAYER_LEFT" - The player chose to leave the room.. |
| 7910 * - "GAME_LEFT" - The game chose to remove the player from the room. |
| 7911 * - "REALTIME_ABANDONED" - The player switched to another application and |
| 7912 * abandoned the room. |
| 7913 * - "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to establish a |
| 7914 * connection to other peer(s). |
| 7915 * - "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to |
| 7916 * communicate with the server. |
| 7917 * - "REALTIME_SERVER_ERROR" - The client received an error response when it |
| 7918 * tried to communicate with the server. |
| 7919 * - "REALTIME_TIMEOUT" - The client timed out while waiting for a room. |
| 7920 * - "REALTIME_CLIENT_DISCONNECTING" - The client disconnects without first |
| 7921 * calling Leave. |
| 7922 * - "REALTIME_SIGN_OUT" - The user signed out of G+ while in the room. |
| 7923 * - "REALTIME_GAME_CRASHED" - The game crashed. |
| 7924 * - "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed. |
| 7925 * - "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is trying to |
| 7926 * enter a room. |
| 7927 * - "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is trying to |
| 7928 * enter a new room. |
| 7929 */ |
| 7930 core.String reason; |
| 7931 |
| 7932 |
| 7933 RoomLeaveRequest(); |
| 7934 |
| 7935 RoomLeaveRequest.fromJson(core.Map _json) { |
| 7936 if (_json.containsKey("kind")) { |
| 7937 kind = _json["kind"]; |
| 7938 } |
| 7939 if (_json.containsKey("leaveDiagnostics")) { |
| 7940 leaveDiagnostics = new RoomLeaveDiagnostics.fromJson(_json["leaveDiagnosti
cs"]); |
| 7941 } |
| 7942 if (_json.containsKey("reason")) { |
| 7943 reason = _json["reason"]; |
| 7944 } |
| 7945 } |
| 7946 |
| 7947 core.Map toJson() { |
| 7948 var _json = new core.Map(); |
| 7949 if (kind != null) { |
| 7950 _json["kind"] = kind; |
| 7951 } |
| 7952 if (leaveDiagnostics != null) { |
| 7953 _json["leaveDiagnostics"] = (leaveDiagnostics).toJson(); |
| 7954 } |
| 7955 if (reason != null) { |
| 7956 _json["reason"] = reason; |
| 7957 } |
| 7958 return _json; |
| 7959 } |
| 7960 } |
| 7961 |
| 7962 |
| 7963 /** This is a JSON template for a list of rooms. */ |
| 7964 class RoomList { |
| 7965 /** The rooms. */ |
| 7966 core.List<Room> items; |
| 7967 |
| 7968 /** |
| 7969 * Uniquely identifies the type of this resource. Value is always the fixed |
| 7970 * string games#roomList. |
| 7971 */ |
| 7972 core.String kind; |
| 7973 |
| 7974 /** The pagination token for the next page of results. */ |
| 7975 core.String nextPageToken; |
| 7976 |
| 7977 |
| 7978 RoomList(); |
| 7979 |
| 7980 RoomList.fromJson(core.Map _json) { |
| 7981 if (_json.containsKey("items")) { |
| 7982 items = _json["items"].map((value) => new Room.fromJson(value)).toList(); |
| 7983 } |
| 7984 if (_json.containsKey("kind")) { |
| 7985 kind = _json["kind"]; |
| 7986 } |
| 7987 if (_json.containsKey("nextPageToken")) { |
| 7988 nextPageToken = _json["nextPageToken"]; |
| 7989 } |
| 7990 } |
| 7991 |
| 7992 core.Map toJson() { |
| 7993 var _json = new core.Map(); |
| 7994 if (items != null) { |
| 7995 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 7996 } |
| 7997 if (kind != null) { |
| 7998 _json["kind"] = kind; |
| 7999 } |
| 8000 if (nextPageToken != null) { |
| 8001 _json["nextPageToken"] = nextPageToken; |
| 8002 } |
| 8003 return _json; |
| 8004 } |
| 8005 } |
| 8006 |
| 8007 |
| 8008 /** This is a JSON template for room modification metadata. */ |
| 8009 class RoomModification { |
| 8010 /** |
| 8011 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8012 * string games#roomModification. |
| 8013 */ |
| 8014 core.String kind; |
| 8015 |
| 8016 /** |
| 8017 * The timestamp at which they modified the room, in milliseconds since the |
| 8018 * epoch in UTC. |
| 8019 */ |
| 8020 core.String modifiedTimestampMillis; |
| 8021 |
| 8022 /** The ID of the participant that modified the room. */ |
| 8023 core.String participantId; |
| 8024 |
| 8025 |
| 8026 RoomModification(); |
| 8027 |
| 8028 RoomModification.fromJson(core.Map _json) { |
| 8029 if (_json.containsKey("kind")) { |
| 8030 kind = _json["kind"]; |
| 8031 } |
| 8032 if (_json.containsKey("modifiedTimestampMillis")) { |
| 8033 modifiedTimestampMillis = _json["modifiedTimestampMillis"]; |
| 8034 } |
| 8035 if (_json.containsKey("participantId")) { |
| 8036 participantId = _json["participantId"]; |
| 8037 } |
| 8038 } |
| 8039 |
| 8040 core.Map toJson() { |
| 8041 var _json = new core.Map(); |
| 8042 if (kind != null) { |
| 8043 _json["kind"] = kind; |
| 8044 } |
| 8045 if (modifiedTimestampMillis != null) { |
| 8046 _json["modifiedTimestampMillis"] = modifiedTimestampMillis; |
| 8047 } |
| 8048 if (participantId != null) { |
| 8049 _json["participantId"] = participantId; |
| 8050 } |
| 8051 return _json; |
| 8052 } |
| 8053 } |
| 8054 |
| 8055 |
| 8056 /** This is a JSON template for an update on the status of a peer in a room. */ |
| 8057 class RoomP2PStatus { |
| 8058 /** |
| 8059 * The amount of time in milliseconds it took to establish connections with |
| 8060 * this peer. |
| 8061 */ |
| 8062 core.int connectionSetupLatencyMillis; |
| 8063 |
| 8064 /** |
| 8065 * The error code in event of a failure. |
| 8066 * Possible values are: |
| 8067 * - "P2P_FAILED" - The client failed to establish a P2P connection with the |
| 8068 * peer. |
| 8069 * - "PRESENCE_FAILED" - The client failed to register to receive P2P |
| 8070 * connections. |
| 8071 * - "RELAY_SERVER_FAILED" - The client received an error when trying to use |
| 8072 * the relay server to establish a P2P connection with the peer. |
| 8073 */ |
| 8074 core.String error; |
| 8075 |
| 8076 /** More detailed diagnostic message returned in event of a failure. */ |
| 8077 core.String errorReason; |
| 8078 |
| 8079 /** |
| 8080 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8081 * string games#roomP2PStatus. |
| 8082 */ |
| 8083 core.String kind; |
| 8084 |
| 8085 /** The ID of the participant. */ |
| 8086 core.String participantId; |
| 8087 |
| 8088 /** |
| 8089 * The status of the peer in the room. |
| 8090 * Possible values are: |
| 8091 * - "CONNECTION_ESTABLISHED" - The client established a P2P connection with |
| 8092 * the peer. |
| 8093 * - "CONNECTION_FAILED" - The client failed to establish directed presence |
| 8094 * with the peer. |
| 8095 */ |
| 8096 core.String status; |
| 8097 |
| 8098 /** |
| 8099 * The amount of time in milliseconds it took to send packets back and forth |
| 8100 * on the unreliable channel with this peer. |
| 8101 */ |
| 8102 core.int unreliableRoundtripLatencyMillis; |
| 8103 |
| 8104 |
| 8105 RoomP2PStatus(); |
| 8106 |
| 8107 RoomP2PStatus.fromJson(core.Map _json) { |
| 8108 if (_json.containsKey("connectionSetupLatencyMillis")) { |
| 8109 connectionSetupLatencyMillis = _json["connectionSetupLatencyMillis"]; |
| 8110 } |
| 8111 if (_json.containsKey("error")) { |
| 8112 error = _json["error"]; |
| 8113 } |
| 8114 if (_json.containsKey("error_reason")) { |
| 8115 errorReason = _json["error_reason"]; |
| 8116 } |
| 8117 if (_json.containsKey("kind")) { |
| 8118 kind = _json["kind"]; |
| 8119 } |
| 8120 if (_json.containsKey("participantId")) { |
| 8121 participantId = _json["participantId"]; |
| 8122 } |
| 8123 if (_json.containsKey("status")) { |
| 8124 status = _json["status"]; |
| 8125 } |
| 8126 if (_json.containsKey("unreliableRoundtripLatencyMillis")) { |
| 8127 unreliableRoundtripLatencyMillis = _json["unreliableRoundtripLatencyMillis
"]; |
| 8128 } |
| 8129 } |
| 8130 |
| 8131 core.Map toJson() { |
| 8132 var _json = new core.Map(); |
| 8133 if (connectionSetupLatencyMillis != null) { |
| 8134 _json["connectionSetupLatencyMillis"] = connectionSetupLatencyMillis; |
| 8135 } |
| 8136 if (error != null) { |
| 8137 _json["error"] = error; |
| 8138 } |
| 8139 if (errorReason != null) { |
| 8140 _json["error_reason"] = errorReason; |
| 8141 } |
| 8142 if (kind != null) { |
| 8143 _json["kind"] = kind; |
| 8144 } |
| 8145 if (participantId != null) { |
| 8146 _json["participantId"] = participantId; |
| 8147 } |
| 8148 if (status != null) { |
| 8149 _json["status"] = status; |
| 8150 } |
| 8151 if (unreliableRoundtripLatencyMillis != null) { |
| 8152 _json["unreliableRoundtripLatencyMillis"] = unreliableRoundtripLatencyMill
is; |
| 8153 } |
| 8154 return _json; |
| 8155 } |
| 8156 } |
| 8157 |
| 8158 |
| 8159 /** This is a JSON template for an update on the status of peers in a room. */ |
| 8160 class RoomP2PStatuses { |
| 8161 /** |
| 8162 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8163 * string games#roomP2PStatuses. |
| 8164 */ |
| 8165 core.String kind; |
| 8166 |
| 8167 /** The updates for the peers. */ |
| 8168 core.List<RoomP2PStatus> updates; |
| 8169 |
| 8170 |
| 8171 RoomP2PStatuses(); |
| 8172 |
| 8173 RoomP2PStatuses.fromJson(core.Map _json) { |
| 8174 if (_json.containsKey("kind")) { |
| 8175 kind = _json["kind"]; |
| 8176 } |
| 8177 if (_json.containsKey("updates")) { |
| 8178 updates = _json["updates"].map((value) => new RoomP2PStatus.fromJson(value
)).toList(); |
| 8179 } |
| 8180 } |
| 8181 |
| 8182 core.Map toJson() { |
| 8183 var _json = new core.Map(); |
| 8184 if (kind != null) { |
| 8185 _json["kind"] = kind; |
| 8186 } |
| 8187 if (updates != null) { |
| 8188 _json["updates"] = updates.map((value) => (value).toJson()).toList(); |
| 8189 } |
| 8190 return _json; |
| 8191 } |
| 8192 } |
| 8193 |
| 8194 |
| 8195 /** This is a JSON template for a participant in a room. */ |
| 8196 class RoomParticipant { |
| 8197 /** True if this participant was auto-matched with the requesting player. */ |
| 8198 core.bool autoMatched; |
| 8199 |
| 8200 /** |
| 8201 * Information about a player that has been anonymously auto-matched against |
| 8202 * the requesting player. (Either player or autoMatchedPlayer will be set.) |
| 8203 */ |
| 8204 AnonymousPlayer autoMatchedPlayer; |
| 8205 |
| 8206 /** |
| 8207 * The capabilities which can be used when communicating with this |
| 8208 * participant. |
| 8209 */ |
| 8210 core.List<core.String> capabilities; |
| 8211 |
| 8212 /** Client address for the participant. */ |
| 8213 RoomClientAddress clientAddress; |
| 8214 |
| 8215 /** |
| 8216 * True if this participant is in the fully connected set of peers in the |
| 8217 * room. |
| 8218 */ |
| 8219 core.bool connected; |
| 8220 |
| 8221 /** |
| 8222 * An identifier for the participant in the scope of the room. Cannot be used |
| 8223 * to identify a player across rooms or in other contexts. |
| 8224 */ |
| 8225 core.String id; |
| 8226 |
| 8227 /** |
| 8228 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8229 * string games#roomParticipant. |
| 8230 */ |
| 8231 core.String kind; |
| 8232 |
| 8233 /** |
| 8234 * The reason the participant left the room; populated if the participant |
| 8235 * status is PARTICIPANT_LEFT. |
| 8236 * Possible values are: |
| 8237 * - "PLAYER_LEFT" - The player explicitly chose to leave the room. |
| 8238 * - "GAME_LEFT" - The game chose to remove the player from the room. |
| 8239 * - "ABANDONED" - The player switched to another application and abandoned |
| 8240 * the room. |
| 8241 * - "PEER_CONNECTION_FAILURE" - The client was unable to establish or |
| 8242 * maintain a connection to other peer(s) in the room. |
| 8243 * - "SERVER_ERROR" - The client received an error response when it tried to |
| 8244 * communicate with the server. |
| 8245 * - "TIMEOUT" - The client timed out while waiting for players to join and |
| 8246 * connect. |
| 8247 * - "PRESENCE_FAILURE" - The client's XMPP connection ended abruptly. |
| 8248 */ |
| 8249 core.String leaveReason; |
| 8250 |
| 8251 /** |
| 8252 * Information about the player. Not populated if this player was anonymously |
| 8253 * auto-matched against the requesting player. (Either player or |
| 8254 * autoMatchedPlayer will be set.) |
| 8255 */ |
| 8256 Player player; |
| 8257 |
| 8258 /** |
| 8259 * The status of the participant with respect to the room. |
| 8260 * Possible values are: |
| 8261 * - "PARTICIPANT_INVITED" - The participant has been invited to join the |
| 8262 * room, but has not yet responded. |
| 8263 * - "PARTICIPANT_JOINED" - The participant has joined the room (either after |
| 8264 * creating it or accepting an invitation.) |
| 8265 * - "PARTICIPANT_DECLINED" - The participant declined an invitation to join |
| 8266 * the room. |
| 8267 * - "PARTICIPANT_LEFT" - The participant joined the room and then left it. |
| 8268 */ |
| 8269 core.String status; |
| 8270 |
| 8271 |
| 8272 RoomParticipant(); |
| 8273 |
| 8274 RoomParticipant.fromJson(core.Map _json) { |
| 8275 if (_json.containsKey("autoMatched")) { |
| 8276 autoMatched = _json["autoMatched"]; |
| 8277 } |
| 8278 if (_json.containsKey("autoMatchedPlayer")) { |
| 8279 autoMatchedPlayer = new AnonymousPlayer.fromJson(_json["autoMatchedPlayer"
]); |
| 8280 } |
| 8281 if (_json.containsKey("capabilities")) { |
| 8282 capabilities = _json["capabilities"]; |
| 8283 } |
| 8284 if (_json.containsKey("clientAddress")) { |
| 8285 clientAddress = new RoomClientAddress.fromJson(_json["clientAddress"]); |
| 8286 } |
| 8287 if (_json.containsKey("connected")) { |
| 8288 connected = _json["connected"]; |
| 8289 } |
| 8290 if (_json.containsKey("id")) { |
| 8291 id = _json["id"]; |
| 8292 } |
| 8293 if (_json.containsKey("kind")) { |
| 8294 kind = _json["kind"]; |
| 8295 } |
| 8296 if (_json.containsKey("leaveReason")) { |
| 8297 leaveReason = _json["leaveReason"]; |
| 8298 } |
| 8299 if (_json.containsKey("player")) { |
| 8300 player = new Player.fromJson(_json["player"]); |
| 8301 } |
| 8302 if (_json.containsKey("status")) { |
| 8303 status = _json["status"]; |
| 8304 } |
| 8305 } |
| 8306 |
| 8307 core.Map toJson() { |
| 8308 var _json = new core.Map(); |
| 8309 if (autoMatched != null) { |
| 8310 _json["autoMatched"] = autoMatched; |
| 8311 } |
| 8312 if (autoMatchedPlayer != null) { |
| 8313 _json["autoMatchedPlayer"] = (autoMatchedPlayer).toJson(); |
| 8314 } |
| 8315 if (capabilities != null) { |
| 8316 _json["capabilities"] = capabilities; |
| 8317 } |
| 8318 if (clientAddress != null) { |
| 8319 _json["clientAddress"] = (clientAddress).toJson(); |
| 8320 } |
| 8321 if (connected != null) { |
| 8322 _json["connected"] = connected; |
| 8323 } |
| 8324 if (id != null) { |
| 8325 _json["id"] = id; |
| 8326 } |
| 8327 if (kind != null) { |
| 8328 _json["kind"] = kind; |
| 8329 } |
| 8330 if (leaveReason != null) { |
| 8331 _json["leaveReason"] = leaveReason; |
| 8332 } |
| 8333 if (player != null) { |
| 8334 _json["player"] = (player).toJson(); |
| 8335 } |
| 8336 if (status != null) { |
| 8337 _json["status"] = status; |
| 8338 } |
| 8339 return _json; |
| 8340 } |
| 8341 } |
| 8342 |
| 8343 |
| 8344 /** |
| 8345 * This is a JSON template for the status of a room that the player has joined. |
| 8346 */ |
| 8347 class RoomStatus { |
| 8348 /** |
| 8349 * Auto-matching status for this room. Not set if the room is not currently in |
| 8350 * the automatching queue. |
| 8351 */ |
| 8352 RoomAutoMatchStatus autoMatchingStatus; |
| 8353 |
| 8354 /** |
| 8355 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8356 * string games#roomStatus. |
| 8357 */ |
| 8358 core.String kind; |
| 8359 |
| 8360 /** |
| 8361 * The participants involved in the room, along with their statuses. Includes |
| 8362 * participants who have left or declined invitations. |
| 8363 */ |
| 8364 core.List<RoomParticipant> participants; |
| 8365 |
| 8366 /** Globally unique ID for a room. */ |
| 8367 core.String roomId; |
| 8368 |
| 8369 /** |
| 8370 * The status of the room. |
| 8371 * Possible values are: |
| 8372 * - "ROOM_INVITING" - One or more players have been invited and not |
| 8373 * responded. |
| 8374 * - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by |
| 8375 * auto-matching. |
| 8376 * - "ROOM_CONNECTING" - Players have joined are connecting to each other |
| 8377 * (either before or after auto-matching). |
| 8378 * - "ROOM_ACTIVE" - All players have joined and connected to each other. |
| 8379 * - "ROOM_DELETED" - All joined players have left. |
| 8380 */ |
| 8381 core.String status; |
| 8382 |
| 8383 /** |
| 8384 * The version of the status for the room: an increasing counter, used by the |
| 8385 * client to ignore out-of-order updates to room status. |
| 8386 */ |
| 8387 core.int statusVersion; |
| 8388 |
| 8389 |
| 8390 RoomStatus(); |
| 8391 |
| 8392 RoomStatus.fromJson(core.Map _json) { |
| 8393 if (_json.containsKey("autoMatchingStatus")) { |
| 8394 autoMatchingStatus = new RoomAutoMatchStatus.fromJson(_json["autoMatchingS
tatus"]); |
| 8395 } |
| 8396 if (_json.containsKey("kind")) { |
| 8397 kind = _json["kind"]; |
| 8398 } |
| 8399 if (_json.containsKey("participants")) { |
| 8400 participants = _json["participants"].map((value) => new RoomParticipant.fr
omJson(value)).toList(); |
| 8401 } |
| 8402 if (_json.containsKey("roomId")) { |
| 8403 roomId = _json["roomId"]; |
| 8404 } |
| 8405 if (_json.containsKey("status")) { |
| 8406 status = _json["status"]; |
| 8407 } |
| 8408 if (_json.containsKey("statusVersion")) { |
| 8409 statusVersion = _json["statusVersion"]; |
| 8410 } |
| 8411 } |
| 8412 |
| 8413 core.Map toJson() { |
| 8414 var _json = new core.Map(); |
| 8415 if (autoMatchingStatus != null) { |
| 8416 _json["autoMatchingStatus"] = (autoMatchingStatus).toJson(); |
| 8417 } |
| 8418 if (kind != null) { |
| 8419 _json["kind"] = kind; |
| 8420 } |
| 8421 if (participants != null) { |
| 8422 _json["participants"] = participants.map((value) => (value).toJson()).toLi
st(); |
| 8423 } |
| 8424 if (roomId != null) { |
| 8425 _json["roomId"] = roomId; |
| 8426 } |
| 8427 if (status != null) { |
| 8428 _json["status"] = status; |
| 8429 } |
| 8430 if (statusVersion != null) { |
| 8431 _json["statusVersion"] = statusVersion; |
| 8432 } |
| 8433 return _json; |
| 8434 } |
| 8435 } |
| 8436 |
| 8437 |
| 8438 /** This is a JSON template for a request to submit a score to leaderboards. */ |
| 8439 class ScoreSubmission { |
| 8440 /** |
| 8441 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8442 * string games#scoreSubmission. |
| 8443 */ |
| 8444 core.String kind; |
| 8445 |
| 8446 /** The leaderboard this score is being submitted to. */ |
| 8447 core.String leaderboardId; |
| 8448 |
| 8449 /** The new score being submitted. */ |
| 8450 core.String score; |
| 8451 |
| 8452 /** |
| 8453 * Additional information about this score. Values will contain no more than |
| 8454 * 64 URI-safe characters as defined by section 2.3 of RFC 3986. |
| 8455 */ |
| 8456 core.String scoreTag; |
| 8457 |
| 8458 /** |
| 8459 * Signature Values will contain URI-safe characters as defined by section 2.3 |
| 8460 * of RFC 3986. |
| 8461 */ |
| 8462 core.String signature; |
| 8463 |
| 8464 |
| 8465 ScoreSubmission(); |
| 8466 |
| 8467 ScoreSubmission.fromJson(core.Map _json) { |
| 8468 if (_json.containsKey("kind")) { |
| 8469 kind = _json["kind"]; |
| 8470 } |
| 8471 if (_json.containsKey("leaderboardId")) { |
| 8472 leaderboardId = _json["leaderboardId"]; |
| 8473 } |
| 8474 if (_json.containsKey("score")) { |
| 8475 score = _json["score"]; |
| 8476 } |
| 8477 if (_json.containsKey("scoreTag")) { |
| 8478 scoreTag = _json["scoreTag"]; |
| 8479 } |
| 8480 if (_json.containsKey("signature")) { |
| 8481 signature = _json["signature"]; |
| 8482 } |
| 8483 } |
| 8484 |
| 8485 core.Map toJson() { |
| 8486 var _json = new core.Map(); |
| 8487 if (kind != null) { |
| 8488 _json["kind"] = kind; |
| 8489 } |
| 8490 if (leaderboardId != null) { |
| 8491 _json["leaderboardId"] = leaderboardId; |
| 8492 } |
| 8493 if (score != null) { |
| 8494 _json["score"] = score; |
| 8495 } |
| 8496 if (scoreTag != null) { |
| 8497 _json["scoreTag"] = scoreTag; |
| 8498 } |
| 8499 if (signature != null) { |
| 8500 _json["signature"] = signature; |
| 8501 } |
| 8502 return _json; |
| 8503 } |
| 8504 } |
| 8505 |
| 8506 |
| 8507 /** This is a JSON template for an snapshot object. */ |
| 8508 class Snapshot { |
| 8509 /** The cover image of this snapshot. May be absent if there is no image. */ |
| 8510 SnapshotImage coverImage; |
| 8511 |
| 8512 /** The description of this snapshot. */ |
| 8513 core.String description; |
| 8514 |
| 8515 /** |
| 8516 * The ID of the file underlying this snapshot in the Drive API. Only present |
| 8517 * if the snapshot is a view on a Drive file and the file is owned by the |
| 8518 * caller. |
| 8519 */ |
| 8520 core.String driveId; |
| 8521 |
| 8522 /** The duration associated with this snapshot, in millis. */ |
| 8523 core.String durationMillis; |
| 8524 |
| 8525 /** The ID of the snapshot. */ |
| 8526 core.String id; |
| 8527 |
| 8528 /** |
| 8529 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8530 * string games#snapshot. |
| 8531 */ |
| 8532 core.String kind; |
| 8533 |
| 8534 /** |
| 8535 * The timestamp (in millis since Unix epoch) of the last modification to this |
| 8536 * snapshot. |
| 8537 */ |
| 8538 core.String lastModifiedMillis; |
| 8539 |
| 8540 /** The title of this snapshot. */ |
| 8541 core.String title; |
| 8542 |
| 8543 /** |
| 8544 * The type of this snapshot. |
| 8545 * Possible values are: |
| 8546 * - "SAVE_GAME" - A snapshot representing a save game. |
| 8547 */ |
| 8548 core.String type; |
| 8549 |
| 8550 /** The unique name provided when the snapshot was created. */ |
| 8551 core.String uniqueName; |
| 8552 |
| 8553 |
| 8554 Snapshot(); |
| 8555 |
| 8556 Snapshot.fromJson(core.Map _json) { |
| 8557 if (_json.containsKey("coverImage")) { |
| 8558 coverImage = new SnapshotImage.fromJson(_json["coverImage"]); |
| 8559 } |
| 8560 if (_json.containsKey("description")) { |
| 8561 description = _json["description"]; |
| 8562 } |
| 8563 if (_json.containsKey("driveId")) { |
| 8564 driveId = _json["driveId"]; |
| 8565 } |
| 8566 if (_json.containsKey("durationMillis")) { |
| 8567 durationMillis = _json["durationMillis"]; |
| 8568 } |
| 8569 if (_json.containsKey("id")) { |
| 8570 id = _json["id"]; |
| 8571 } |
| 8572 if (_json.containsKey("kind")) { |
| 8573 kind = _json["kind"]; |
| 8574 } |
| 8575 if (_json.containsKey("lastModifiedMillis")) { |
| 8576 lastModifiedMillis = _json["lastModifiedMillis"]; |
| 8577 } |
| 8578 if (_json.containsKey("title")) { |
| 8579 title = _json["title"]; |
| 8580 } |
| 8581 if (_json.containsKey("type")) { |
| 8582 type = _json["type"]; |
| 8583 } |
| 8584 if (_json.containsKey("uniqueName")) { |
| 8585 uniqueName = _json["uniqueName"]; |
| 8586 } |
| 8587 } |
| 8588 |
| 8589 core.Map toJson() { |
| 8590 var _json = new core.Map(); |
| 8591 if (coverImage != null) { |
| 8592 _json["coverImage"] = (coverImage).toJson(); |
| 8593 } |
| 8594 if (description != null) { |
| 8595 _json["description"] = description; |
| 8596 } |
| 8597 if (driveId != null) { |
| 8598 _json["driveId"] = driveId; |
| 8599 } |
| 8600 if (durationMillis != null) { |
| 8601 _json["durationMillis"] = durationMillis; |
| 8602 } |
| 8603 if (id != null) { |
| 8604 _json["id"] = id; |
| 8605 } |
| 8606 if (kind != null) { |
| 8607 _json["kind"] = kind; |
| 8608 } |
| 8609 if (lastModifiedMillis != null) { |
| 8610 _json["lastModifiedMillis"] = lastModifiedMillis; |
| 8611 } |
| 8612 if (title != null) { |
| 8613 _json["title"] = title; |
| 8614 } |
| 8615 if (type != null) { |
| 8616 _json["type"] = type; |
| 8617 } |
| 8618 if (uniqueName != null) { |
| 8619 _json["uniqueName"] = uniqueName; |
| 8620 } |
| 8621 return _json; |
| 8622 } |
| 8623 } |
| 8624 |
| 8625 |
| 8626 /** This is a JSON template for an image of a snapshot. */ |
| 8627 class SnapshotImage { |
| 8628 /** The height of the image. */ |
| 8629 core.int height; |
| 8630 |
| 8631 /** |
| 8632 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8633 * string games#snapshotImage. |
| 8634 */ |
| 8635 core.String kind; |
| 8636 |
| 8637 /** The MIME type of the image. */ |
| 8638 core.String mimeType; |
| 8639 |
| 8640 /** |
| 8641 * The URL of the image. This URL may be invalidated at any time and should |
| 8642 * not be cached. |
| 8643 */ |
| 8644 core.String url; |
| 8645 |
| 8646 /** The width of the image. */ |
| 8647 core.int width; |
| 8648 |
| 8649 |
| 8650 SnapshotImage(); |
| 8651 |
| 8652 SnapshotImage.fromJson(core.Map _json) { |
| 8653 if (_json.containsKey("height")) { |
| 8654 height = _json["height"]; |
| 8655 } |
| 8656 if (_json.containsKey("kind")) { |
| 8657 kind = _json["kind"]; |
| 8658 } |
| 8659 if (_json.containsKey("mime_type")) { |
| 8660 mimeType = _json["mime_type"]; |
| 8661 } |
| 8662 if (_json.containsKey("url")) { |
| 8663 url = _json["url"]; |
| 8664 } |
| 8665 if (_json.containsKey("width")) { |
| 8666 width = _json["width"]; |
| 8667 } |
| 8668 } |
| 8669 |
| 8670 core.Map toJson() { |
| 8671 var _json = new core.Map(); |
| 8672 if (height != null) { |
| 8673 _json["height"] = height; |
| 8674 } |
| 8675 if (kind != null) { |
| 8676 _json["kind"] = kind; |
| 8677 } |
| 8678 if (mimeType != null) { |
| 8679 _json["mime_type"] = mimeType; |
| 8680 } |
| 8681 if (url != null) { |
| 8682 _json["url"] = url; |
| 8683 } |
| 8684 if (width != null) { |
| 8685 _json["width"] = width; |
| 8686 } |
| 8687 return _json; |
| 8688 } |
| 8689 } |
| 8690 |
| 8691 |
| 8692 /** This is a JSON template for a list of snapshot objects. */ |
| 8693 class SnapshotListResponse { |
| 8694 /** The snapshots. */ |
| 8695 core.List<Snapshot> items; |
| 8696 |
| 8697 /** |
| 8698 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8699 * string games#snapshotListResponse. |
| 8700 */ |
| 8701 core.String kind; |
| 8702 |
| 8703 /** |
| 8704 * Token corresponding to the next page of results. If there are no more |
| 8705 * results, the token is omitted. |
| 8706 */ |
| 8707 core.String nextPageToken; |
| 8708 |
| 8709 |
| 8710 SnapshotListResponse(); |
| 8711 |
| 8712 SnapshotListResponse.fromJson(core.Map _json) { |
| 8713 if (_json.containsKey("items")) { |
| 8714 items = _json["items"].map((value) => new Snapshot.fromJson(value)).toList
(); |
| 8715 } |
| 8716 if (_json.containsKey("kind")) { |
| 8717 kind = _json["kind"]; |
| 8718 } |
| 8719 if (_json.containsKey("nextPageToken")) { |
| 8720 nextPageToken = _json["nextPageToken"]; |
| 8721 } |
| 8722 } |
| 8723 |
| 8724 core.Map toJson() { |
| 8725 var _json = new core.Map(); |
| 8726 if (items != null) { |
| 8727 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 8728 } |
| 8729 if (kind != null) { |
| 8730 _json["kind"] = kind; |
| 8731 } |
| 8732 if (nextPageToken != null) { |
| 8733 _json["nextPageToken"] = nextPageToken; |
| 8734 } |
| 8735 return _json; |
| 8736 } |
| 8737 } |
| 8738 |
| 8739 |
| 8740 /** This is a JSON template for an turn-based auto-match criteria object. */ |
| 8741 class TurnBasedAutoMatchingCriteria { |
| 8742 /** |
| 8743 * A bitmask indicating when auto-matches are valid. When ANDed with other |
| 8744 * exclusive bitmasks, the result must be zero. Can be used to support |
| 8745 * exclusive roles within a game. |
| 8746 */ |
| 8747 core.String exclusiveBitmask; |
| 8748 |
| 8749 /** |
| 8750 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8751 * string games#turnBasedAutoMatchingCriteria. |
| 8752 */ |
| 8753 core.String kind; |
| 8754 |
| 8755 /** |
| 8756 * The maximum number of players that should be added to the match by |
| 8757 * auto-matching. |
| 8758 */ |
| 8759 core.int maxAutoMatchingPlayers; |
| 8760 |
| 8761 /** |
| 8762 * The minimum number of players that should be added to the match by |
| 8763 * auto-matching. |
| 8764 */ |
| 8765 core.int minAutoMatchingPlayers; |
| 8766 |
| 8767 |
| 8768 TurnBasedAutoMatchingCriteria(); |
| 8769 |
| 8770 TurnBasedAutoMatchingCriteria.fromJson(core.Map _json) { |
| 8771 if (_json.containsKey("exclusiveBitmask")) { |
| 8772 exclusiveBitmask = _json["exclusiveBitmask"]; |
| 8773 } |
| 8774 if (_json.containsKey("kind")) { |
| 8775 kind = _json["kind"]; |
| 8776 } |
| 8777 if (_json.containsKey("maxAutoMatchingPlayers")) { |
| 8778 maxAutoMatchingPlayers = _json["maxAutoMatchingPlayers"]; |
| 8779 } |
| 8780 if (_json.containsKey("minAutoMatchingPlayers")) { |
| 8781 minAutoMatchingPlayers = _json["minAutoMatchingPlayers"]; |
| 8782 } |
| 8783 } |
| 8784 |
| 8785 core.Map toJson() { |
| 8786 var _json = new core.Map(); |
| 8787 if (exclusiveBitmask != null) { |
| 8788 _json["exclusiveBitmask"] = exclusiveBitmask; |
| 8789 } |
| 8790 if (kind != null) { |
| 8791 _json["kind"] = kind; |
| 8792 } |
| 8793 if (maxAutoMatchingPlayers != null) { |
| 8794 _json["maxAutoMatchingPlayers"] = maxAutoMatchingPlayers; |
| 8795 } |
| 8796 if (minAutoMatchingPlayers != null) { |
| 8797 _json["minAutoMatchingPlayers"] = minAutoMatchingPlayers; |
| 8798 } |
| 8799 return _json; |
| 8800 } |
| 8801 } |
| 8802 |
| 8803 |
| 8804 /** This is a JSON template for a turn-based match resource object. */ |
| 8805 class TurnBasedMatch { |
| 8806 /** The ID of the application being played. */ |
| 8807 core.String applicationId; |
| 8808 |
| 8809 /** Criteria for auto-matching players into this match. */ |
| 8810 TurnBasedAutoMatchingCriteria autoMatchingCriteria; |
| 8811 |
| 8812 /** Details about the match creation. */ |
| 8813 TurnBasedMatchModification creationDetails; |
| 8814 |
| 8815 /** The data / game state for this match. */ |
| 8816 TurnBasedMatchData data; |
| 8817 |
| 8818 /** |
| 8819 * This short description is generated by our servers based on turn state and |
| 8820 * is localized and worded relative to the player requesting the match. It is |
| 8821 * intended to be displayed when the match is shown in a list. |
| 8822 */ |
| 8823 core.String description; |
| 8824 |
| 8825 /** |
| 8826 * The ID of the participant that invited the user to the match. Not set if |
| 8827 * the user was not invited to the match. |
| 8828 */ |
| 8829 core.String inviterId; |
| 8830 |
| 8831 /** |
| 8832 * Uniquely identifies the type of this resource. Value is always the fixed |
| 8833 * string games#turnBasedMatch. |
| 8834 */ |
| 8835 core.String kind; |
| 8836 |
| 8837 /** Details about the last update to the match. */ |
| 8838 TurnBasedMatchModification lastUpdateDetails; |
| 8839 |
| 8840 /** Globally unique ID for a turn-based match. */ |
| 8841 core.String matchId; |
| 8842 |
| 8843 /** |
| 8844 * The number of the match in a chain of rematches. Will be set to 1 for the |
| 8845 * first match and incremented by 1 for each rematch. |
| 8846 */ |
| 8847 core.int matchNumber; |
| 8848 |
| 8849 /** |
| 8850 * The version of this match: an increasing counter, used to avoid out-of-date |
| 8851 * updates to the match. |
| 8852 */ |
| 8853 core.int matchVersion; |
| 8854 |
| 8855 /** |
| 8856 * The participants involved in the match, along with their statuses. Includes |
| 8857 * participants who have left or declined invitations. |
| 8858 */ |
| 8859 core.List<TurnBasedMatchParticipant> participants; |
| 8860 |
| 8861 /** The ID of the participant that is taking a turn. */ |
| 8862 core.String pendingParticipantId; |
| 8863 |
| 8864 /** |
| 8865 * The data / game state for the previous match; set for the first turn of |
| 8866 * rematches only. |
| 8867 */ |
| 8868 TurnBasedMatchData previousMatchData; |
| 8869 |
| 8870 /** |
| 8871 * The ID of a rematch of this match. Only set for completed matches that have |
| 8872 * been rematched. |
| 8873 */ |
| 8874 core.String rematchId; |
| 8875 |
| 8876 /** The results reported for this match. */ |
| 8877 core.List<ParticipantResult> results; |
| 8878 |
| 8879 /** |
| 8880 * The status of the match. |
| 8881 * Possible values are: |
| 8882 * - "MATCH_AUTO_MATCHING" - One or more slots need to be filled by |
| 8883 * auto-matching; the match cannot be established until they are filled. |
| 8884 * - "MATCH_ACTIVE" - The match has started. |
| 8885 * - "MATCH_COMPLETE" - The match has finished. |
| 8886 * - "MATCH_CANCELED" - The match was canceled. |
| 8887 * - "MATCH_EXPIRED" - The match expired due to inactivity. |
| 8888 * - "MATCH_DELETED" - The match should no longer be shown on the client. |
| 8889 * Returned only for tombstones for matches when sync is called. |
| 8890 */ |
| 8891 core.String status; |
| 8892 |
| 8893 /** |
| 8894 * The status of the current user in the match. Derived from the match type, |
| 8895 * match status, the user's participant status, and the pending participant |
| 8896 * for the match. |
| 8897 * Possible values are: |
| 8898 * - "USER_INVITED" - The user has been invited to join the match and has not |
| 8899 * responded yet. |
| 8900 * - "USER_AWAITING_TURN" - The user is waiting for their turn. |
| 8901 * - "USER_TURN" - The user has an action to take in the match. |
| 8902 * - "USER_MATCH_COMPLETED" - The match has ended (it is completed, canceled, |
| 8903 * or expired.) |
| 8904 */ |
| 8905 core.String userMatchStatus; |
| 8906 |
| 8907 /** |
| 8908 * The variant / mode of the application being played; can be any integer |
| 8909 * value, or left blank. |
| 8910 */ |
| 8911 core.int variant; |
| 8912 |
| 8913 /** |
| 8914 * The ID of another participant in the match that can be used when describing |
| 8915 * the participants the user is playing with. |
| 8916 */ |
| 8917 core.String withParticipantId; |
| 8918 |
| 8919 |
| 8920 TurnBasedMatch(); |
| 8921 |
| 8922 TurnBasedMatch.fromJson(core.Map _json) { |
| 8923 if (_json.containsKey("applicationId")) { |
| 8924 applicationId = _json["applicationId"]; |
| 8925 } |
| 8926 if (_json.containsKey("autoMatchingCriteria")) { |
| 8927 autoMatchingCriteria = new TurnBasedAutoMatchingCriteria.fromJson(_json["a
utoMatchingCriteria"]); |
| 8928 } |
| 8929 if (_json.containsKey("creationDetails")) { |
| 8930 creationDetails = new TurnBasedMatchModification.fromJson(_json["creationD
etails"]); |
| 8931 } |
| 8932 if (_json.containsKey("data")) { |
| 8933 data = new TurnBasedMatchData.fromJson(_json["data"]); |
| 8934 } |
| 8935 if (_json.containsKey("description")) { |
| 8936 description = _json["description"]; |
| 8937 } |
| 8938 if (_json.containsKey("inviterId")) { |
| 8939 inviterId = _json["inviterId"]; |
| 8940 } |
| 8941 if (_json.containsKey("kind")) { |
| 8942 kind = _json["kind"]; |
| 8943 } |
| 8944 if (_json.containsKey("lastUpdateDetails")) { |
| 8945 lastUpdateDetails = new TurnBasedMatchModification.fromJson(_json["lastUpd
ateDetails"]); |
| 8946 } |
| 8947 if (_json.containsKey("matchId")) { |
| 8948 matchId = _json["matchId"]; |
| 8949 } |
| 8950 if (_json.containsKey("matchNumber")) { |
| 8951 matchNumber = _json["matchNumber"]; |
| 8952 } |
| 8953 if (_json.containsKey("matchVersion")) { |
| 8954 matchVersion = _json["matchVersion"]; |
| 8955 } |
| 8956 if (_json.containsKey("participants")) { |
| 8957 participants = _json["participants"].map((value) => new TurnBasedMatchPart
icipant.fromJson(value)).toList(); |
| 8958 } |
| 8959 if (_json.containsKey("pendingParticipantId")) { |
| 8960 pendingParticipantId = _json["pendingParticipantId"]; |
| 8961 } |
| 8962 if (_json.containsKey("previousMatchData")) { |
| 8963 previousMatchData = new TurnBasedMatchData.fromJson(_json["previousMatchDa
ta"]); |
| 8964 } |
| 8965 if (_json.containsKey("rematchId")) { |
| 8966 rematchId = _json["rematchId"]; |
| 8967 } |
| 8968 if (_json.containsKey("results")) { |
| 8969 results = _json["results"].map((value) => new ParticipantResult.fromJson(v
alue)).toList(); |
| 8970 } |
| 8971 if (_json.containsKey("status")) { |
| 8972 status = _json["status"]; |
| 8973 } |
| 8974 if (_json.containsKey("userMatchStatus")) { |
| 8975 userMatchStatus = _json["userMatchStatus"]; |
| 8976 } |
| 8977 if (_json.containsKey("variant")) { |
| 8978 variant = _json["variant"]; |
| 8979 } |
| 8980 if (_json.containsKey("withParticipantId")) { |
| 8981 withParticipantId = _json["withParticipantId"]; |
| 8982 } |
| 8983 } |
| 8984 |
| 8985 core.Map toJson() { |
| 8986 var _json = new core.Map(); |
| 8987 if (applicationId != null) { |
| 8988 _json["applicationId"] = applicationId; |
| 8989 } |
| 8990 if (autoMatchingCriteria != null) { |
| 8991 _json["autoMatchingCriteria"] = (autoMatchingCriteria).toJson(); |
| 8992 } |
| 8993 if (creationDetails != null) { |
| 8994 _json["creationDetails"] = (creationDetails).toJson(); |
| 8995 } |
| 8996 if (data != null) { |
| 8997 _json["data"] = (data).toJson(); |
| 8998 } |
| 8999 if (description != null) { |
| 9000 _json["description"] = description; |
| 9001 } |
| 9002 if (inviterId != null) { |
| 9003 _json["inviterId"] = inviterId; |
| 9004 } |
| 9005 if (kind != null) { |
| 9006 _json["kind"] = kind; |
| 9007 } |
| 9008 if (lastUpdateDetails != null) { |
| 9009 _json["lastUpdateDetails"] = (lastUpdateDetails).toJson(); |
| 9010 } |
| 9011 if (matchId != null) { |
| 9012 _json["matchId"] = matchId; |
| 9013 } |
| 9014 if (matchNumber != null) { |
| 9015 _json["matchNumber"] = matchNumber; |
| 9016 } |
| 9017 if (matchVersion != null) { |
| 9018 _json["matchVersion"] = matchVersion; |
| 9019 } |
| 9020 if (participants != null) { |
| 9021 _json["participants"] = participants.map((value) => (value).toJson()).toLi
st(); |
| 9022 } |
| 9023 if (pendingParticipantId != null) { |
| 9024 _json["pendingParticipantId"] = pendingParticipantId; |
| 9025 } |
| 9026 if (previousMatchData != null) { |
| 9027 _json["previousMatchData"] = (previousMatchData).toJson(); |
| 9028 } |
| 9029 if (rematchId != null) { |
| 9030 _json["rematchId"] = rematchId; |
| 9031 } |
| 9032 if (results != null) { |
| 9033 _json["results"] = results.map((value) => (value).toJson()).toList(); |
| 9034 } |
| 9035 if (status != null) { |
| 9036 _json["status"] = status; |
| 9037 } |
| 9038 if (userMatchStatus != null) { |
| 9039 _json["userMatchStatus"] = userMatchStatus; |
| 9040 } |
| 9041 if (variant != null) { |
| 9042 _json["variant"] = variant; |
| 9043 } |
| 9044 if (withParticipantId != null) { |
| 9045 _json["withParticipantId"] = withParticipantId; |
| 9046 } |
| 9047 return _json; |
| 9048 } |
| 9049 } |
| 9050 |
| 9051 |
| 9052 /** This is a JSON template for a turn-based match creation request. */ |
| 9053 class TurnBasedMatchCreateRequest { |
| 9054 /** Criteria for auto-matching players into this match. */ |
| 9055 TurnBasedAutoMatchingCriteria autoMatchingCriteria; |
| 9056 |
| 9057 /** The player ids to invite to the match. */ |
| 9058 core.List<core.String> invitedPlayerIds; |
| 9059 |
| 9060 /** |
| 9061 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9062 * string games#turnBasedMatchCreateRequest. |
| 9063 */ |
| 9064 core.String kind; |
| 9065 |
| 9066 /** |
| 9067 * A randomly generated numeric ID. This number is used at the server to |
| 9068 * ensure that the request is handled correctly across retries. |
| 9069 */ |
| 9070 core.String requestId; |
| 9071 |
| 9072 /** |
| 9073 * The variant / mode of the application to be played. This can be any integer |
| 9074 * value, or left blank. You should use a small number of variants to keep the |
| 9075 * auto-matching pool as large as possible. |
| 9076 */ |
| 9077 core.int variant; |
| 9078 |
| 9079 |
| 9080 TurnBasedMatchCreateRequest(); |
| 9081 |
| 9082 TurnBasedMatchCreateRequest.fromJson(core.Map _json) { |
| 9083 if (_json.containsKey("autoMatchingCriteria")) { |
| 9084 autoMatchingCriteria = new TurnBasedAutoMatchingCriteria.fromJson(_json["a
utoMatchingCriteria"]); |
| 9085 } |
| 9086 if (_json.containsKey("invitedPlayerIds")) { |
| 9087 invitedPlayerIds = _json["invitedPlayerIds"]; |
| 9088 } |
| 9089 if (_json.containsKey("kind")) { |
| 9090 kind = _json["kind"]; |
| 9091 } |
| 9092 if (_json.containsKey("requestId")) { |
| 9093 requestId = _json["requestId"]; |
| 9094 } |
| 9095 if (_json.containsKey("variant")) { |
| 9096 variant = _json["variant"]; |
| 9097 } |
| 9098 } |
| 9099 |
| 9100 core.Map toJson() { |
| 9101 var _json = new core.Map(); |
| 9102 if (autoMatchingCriteria != null) { |
| 9103 _json["autoMatchingCriteria"] = (autoMatchingCriteria).toJson(); |
| 9104 } |
| 9105 if (invitedPlayerIds != null) { |
| 9106 _json["invitedPlayerIds"] = invitedPlayerIds; |
| 9107 } |
| 9108 if (kind != null) { |
| 9109 _json["kind"] = kind; |
| 9110 } |
| 9111 if (requestId != null) { |
| 9112 _json["requestId"] = requestId; |
| 9113 } |
| 9114 if (variant != null) { |
| 9115 _json["variant"] = variant; |
| 9116 } |
| 9117 return _json; |
| 9118 } |
| 9119 } |
| 9120 |
| 9121 |
| 9122 /** This is a JSON template for a turn-based match data object. */ |
| 9123 class TurnBasedMatchData { |
| 9124 /** |
| 9125 * The byte representation of the data (limited to 128 kB), as a |
| 9126 * Base64-encoded string with the URL_SAFE encoding option. |
| 9127 */ |
| 9128 core.String data; |
| 9129 |
| 9130 core.List<core.int> get dataAsBytes { |
| 9131 return crypto.CryptoUtils.base64StringToBytes(data); |
| 9132 } |
| 9133 |
| 9134 void set dataAsBytes(core.List<core.int> _bytes) { |
| 9135 data = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); |
| 9136 } |
| 9137 |
| 9138 /** |
| 9139 * True if this match has data available but it wasn't returned in a list |
| 9140 * response; fetching the match individually will retrieve this data. |
| 9141 */ |
| 9142 core.bool dataAvailable; |
| 9143 |
| 9144 /** |
| 9145 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9146 * string games#turnBasedMatchData. |
| 9147 */ |
| 9148 core.String kind; |
| 9149 |
| 9150 |
| 9151 TurnBasedMatchData(); |
| 9152 |
| 9153 TurnBasedMatchData.fromJson(core.Map _json) { |
| 9154 if (_json.containsKey("data")) { |
| 9155 data = _json["data"]; |
| 9156 } |
| 9157 if (_json.containsKey("dataAvailable")) { |
| 9158 dataAvailable = _json["dataAvailable"]; |
| 9159 } |
| 9160 if (_json.containsKey("kind")) { |
| 9161 kind = _json["kind"]; |
| 9162 } |
| 9163 } |
| 9164 |
| 9165 core.Map toJson() { |
| 9166 var _json = new core.Map(); |
| 9167 if (data != null) { |
| 9168 _json["data"] = data; |
| 9169 } |
| 9170 if (dataAvailable != null) { |
| 9171 _json["dataAvailable"] = dataAvailable; |
| 9172 } |
| 9173 if (kind != null) { |
| 9174 _json["kind"] = kind; |
| 9175 } |
| 9176 return _json; |
| 9177 } |
| 9178 } |
| 9179 |
| 9180 |
| 9181 /** This is a JSON template for sending a turn-based match data object. */ |
| 9182 class TurnBasedMatchDataRequest { |
| 9183 /** |
| 9184 * The byte representation of the data (limited to 128 kB), as a |
| 9185 * Base64-encoded string with the URL_SAFE encoding option. |
| 9186 */ |
| 9187 core.String data; |
| 9188 |
| 9189 core.List<core.int> get dataAsBytes { |
| 9190 return crypto.CryptoUtils.base64StringToBytes(data); |
| 9191 } |
| 9192 |
| 9193 void set dataAsBytes(core.List<core.int> _bytes) { |
| 9194 data = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true); |
| 9195 } |
| 9196 |
| 9197 /** |
| 9198 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9199 * string games#turnBasedMatchDataRequest. |
| 9200 */ |
| 9201 core.String kind; |
| 9202 |
| 9203 |
| 9204 TurnBasedMatchDataRequest(); |
| 9205 |
| 9206 TurnBasedMatchDataRequest.fromJson(core.Map _json) { |
| 9207 if (_json.containsKey("data")) { |
| 9208 data = _json["data"]; |
| 9209 } |
| 9210 if (_json.containsKey("kind")) { |
| 9211 kind = _json["kind"]; |
| 9212 } |
| 9213 } |
| 9214 |
| 9215 core.Map toJson() { |
| 9216 var _json = new core.Map(); |
| 9217 if (data != null) { |
| 9218 _json["data"] = data; |
| 9219 } |
| 9220 if (kind != null) { |
| 9221 _json["kind"] = kind; |
| 9222 } |
| 9223 return _json; |
| 9224 } |
| 9225 } |
| 9226 |
| 9227 |
| 9228 /** This is a JSON template for a list of turn-based matches. */ |
| 9229 class TurnBasedMatchList { |
| 9230 /** The matches. */ |
| 9231 core.List<TurnBasedMatch> items; |
| 9232 |
| 9233 /** |
| 9234 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9235 * string games#turnBasedMatchList. |
| 9236 */ |
| 9237 core.String kind; |
| 9238 |
| 9239 /** The pagination token for the next page of results. */ |
| 9240 core.String nextPageToken; |
| 9241 |
| 9242 |
| 9243 TurnBasedMatchList(); |
| 9244 |
| 9245 TurnBasedMatchList.fromJson(core.Map _json) { |
| 9246 if (_json.containsKey("items")) { |
| 9247 items = _json["items"].map((value) => new TurnBasedMatch.fromJson(value)).
toList(); |
| 9248 } |
| 9249 if (_json.containsKey("kind")) { |
| 9250 kind = _json["kind"]; |
| 9251 } |
| 9252 if (_json.containsKey("nextPageToken")) { |
| 9253 nextPageToken = _json["nextPageToken"]; |
| 9254 } |
| 9255 } |
| 9256 |
| 9257 core.Map toJson() { |
| 9258 var _json = new core.Map(); |
| 9259 if (items != null) { |
| 9260 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 9261 } |
| 9262 if (kind != null) { |
| 9263 _json["kind"] = kind; |
| 9264 } |
| 9265 if (nextPageToken != null) { |
| 9266 _json["nextPageToken"] = nextPageToken; |
| 9267 } |
| 9268 return _json; |
| 9269 } |
| 9270 } |
| 9271 |
| 9272 |
| 9273 /** This is a JSON template for turn-based match modification metadata. */ |
| 9274 class TurnBasedMatchModification { |
| 9275 /** |
| 9276 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9277 * string games#turnBasedMatchModification. |
| 9278 */ |
| 9279 core.String kind; |
| 9280 |
| 9281 /** |
| 9282 * The timestamp at which they modified the match, in milliseconds since the |
| 9283 * epoch in UTC. |
| 9284 */ |
| 9285 core.String modifiedTimestampMillis; |
| 9286 |
| 9287 /** The ID of the participant that modified the match. */ |
| 9288 core.String participantId; |
| 9289 |
| 9290 |
| 9291 TurnBasedMatchModification(); |
| 9292 |
| 9293 TurnBasedMatchModification.fromJson(core.Map _json) { |
| 9294 if (_json.containsKey("kind")) { |
| 9295 kind = _json["kind"]; |
| 9296 } |
| 9297 if (_json.containsKey("modifiedTimestampMillis")) { |
| 9298 modifiedTimestampMillis = _json["modifiedTimestampMillis"]; |
| 9299 } |
| 9300 if (_json.containsKey("participantId")) { |
| 9301 participantId = _json["participantId"]; |
| 9302 } |
| 9303 } |
| 9304 |
| 9305 core.Map toJson() { |
| 9306 var _json = new core.Map(); |
| 9307 if (kind != null) { |
| 9308 _json["kind"] = kind; |
| 9309 } |
| 9310 if (modifiedTimestampMillis != null) { |
| 9311 _json["modifiedTimestampMillis"] = modifiedTimestampMillis; |
| 9312 } |
| 9313 if (participantId != null) { |
| 9314 _json["participantId"] = participantId; |
| 9315 } |
| 9316 return _json; |
| 9317 } |
| 9318 } |
| 9319 |
| 9320 |
| 9321 /** This is a JSON template for a participant in a turn-based match. */ |
| 9322 class TurnBasedMatchParticipant { |
| 9323 /** True if this participant was auto-matched with the requesting player. */ |
| 9324 core.bool autoMatched; |
| 9325 |
| 9326 /** |
| 9327 * Information about a player that has been anonymously auto-matched against |
| 9328 * the requesting player. (Either player or autoMatchedPlayer will be set.) |
| 9329 */ |
| 9330 AnonymousPlayer autoMatchedPlayer; |
| 9331 |
| 9332 /** |
| 9333 * An identifier for the participant in the scope of the match. Cannot be used |
| 9334 * to identify a player across matches or in other contexts. |
| 9335 */ |
| 9336 core.String id; |
| 9337 |
| 9338 /** |
| 9339 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9340 * string games#turnBasedMatchParticipant. |
| 9341 */ |
| 9342 core.String kind; |
| 9343 |
| 9344 /** |
| 9345 * Information about the player. Not populated if this player was anonymously |
| 9346 * auto-matched against the requesting player. (Either player or |
| 9347 * autoMatchedPlayer will be set.) |
| 9348 */ |
| 9349 Player player; |
| 9350 |
| 9351 /** |
| 9352 * The status of the participant with respect to the match. |
| 9353 * Possible values are: |
| 9354 * - "PARTICIPANT_NOT_INVITED_YET" - The participant is slated to be invited |
| 9355 * to the match, but the invitation has not been sent; the invite will be sent |
| 9356 * when it becomes their turn. |
| 9357 * - "PARTICIPANT_INVITED" - The participant has been invited to join the |
| 9358 * match, but has not yet responded. |
| 9359 * - "PARTICIPANT_JOINED" - The participant has joined the match (either after |
| 9360 * creating it or accepting an invitation.) |
| 9361 * - "PARTICIPANT_DECLINED" - The participant declined an invitation to join |
| 9362 * the match. |
| 9363 * - "PARTICIPANT_LEFT" - The participant joined the match and then left it. |
| 9364 * - "PARTICIPANT_FINISHED" - The participant finished playing in the match. |
| 9365 * - "PARTICIPANT_UNRESPONSIVE" - The participant did not take their turn in |
| 9366 * the allotted time. |
| 9367 */ |
| 9368 core.String status; |
| 9369 |
| 9370 |
| 9371 TurnBasedMatchParticipant(); |
| 9372 |
| 9373 TurnBasedMatchParticipant.fromJson(core.Map _json) { |
| 9374 if (_json.containsKey("autoMatched")) { |
| 9375 autoMatched = _json["autoMatched"]; |
| 9376 } |
| 9377 if (_json.containsKey("autoMatchedPlayer")) { |
| 9378 autoMatchedPlayer = new AnonymousPlayer.fromJson(_json["autoMatchedPlayer"
]); |
| 9379 } |
| 9380 if (_json.containsKey("id")) { |
| 9381 id = _json["id"]; |
| 9382 } |
| 9383 if (_json.containsKey("kind")) { |
| 9384 kind = _json["kind"]; |
| 9385 } |
| 9386 if (_json.containsKey("player")) { |
| 9387 player = new Player.fromJson(_json["player"]); |
| 9388 } |
| 9389 if (_json.containsKey("status")) { |
| 9390 status = _json["status"]; |
| 9391 } |
| 9392 } |
| 9393 |
| 9394 core.Map toJson() { |
| 9395 var _json = new core.Map(); |
| 9396 if (autoMatched != null) { |
| 9397 _json["autoMatched"] = autoMatched; |
| 9398 } |
| 9399 if (autoMatchedPlayer != null) { |
| 9400 _json["autoMatchedPlayer"] = (autoMatchedPlayer).toJson(); |
| 9401 } |
| 9402 if (id != null) { |
| 9403 _json["id"] = id; |
| 9404 } |
| 9405 if (kind != null) { |
| 9406 _json["kind"] = kind; |
| 9407 } |
| 9408 if (player != null) { |
| 9409 _json["player"] = (player).toJson(); |
| 9410 } |
| 9411 if (status != null) { |
| 9412 _json["status"] = status; |
| 9413 } |
| 9414 return _json; |
| 9415 } |
| 9416 } |
| 9417 |
| 9418 |
| 9419 /** This is a JSON template for a rematch response. */ |
| 9420 class TurnBasedMatchRematch { |
| 9421 /** |
| 9422 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9423 * string games#turnBasedMatchRematch. |
| 9424 */ |
| 9425 core.String kind; |
| 9426 |
| 9427 /** |
| 9428 * The old match that the rematch was created from; will be updated such that |
| 9429 * the rematchId field will point at the new match. |
| 9430 */ |
| 9431 TurnBasedMatch previousMatch; |
| 9432 |
| 9433 /** |
| 9434 * The newly created match; a rematch of the old match with the same |
| 9435 * participants. |
| 9436 */ |
| 9437 TurnBasedMatch rematch; |
| 9438 |
| 9439 |
| 9440 TurnBasedMatchRematch(); |
| 9441 |
| 9442 TurnBasedMatchRematch.fromJson(core.Map _json) { |
| 9443 if (_json.containsKey("kind")) { |
| 9444 kind = _json["kind"]; |
| 9445 } |
| 9446 if (_json.containsKey("previousMatch")) { |
| 9447 previousMatch = new TurnBasedMatch.fromJson(_json["previousMatch"]); |
| 9448 } |
| 9449 if (_json.containsKey("rematch")) { |
| 9450 rematch = new TurnBasedMatch.fromJson(_json["rematch"]); |
| 9451 } |
| 9452 } |
| 9453 |
| 9454 core.Map toJson() { |
| 9455 var _json = new core.Map(); |
| 9456 if (kind != null) { |
| 9457 _json["kind"] = kind; |
| 9458 } |
| 9459 if (previousMatch != null) { |
| 9460 _json["previousMatch"] = (previousMatch).toJson(); |
| 9461 } |
| 9462 if (rematch != null) { |
| 9463 _json["rematch"] = (rematch).toJson(); |
| 9464 } |
| 9465 return _json; |
| 9466 } |
| 9467 } |
| 9468 |
| 9469 |
| 9470 /** This is a JSON template for a turn-based match results object. */ |
| 9471 class TurnBasedMatchResults { |
| 9472 /** The final match data. */ |
| 9473 TurnBasedMatchDataRequest data; |
| 9474 |
| 9475 /** |
| 9476 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9477 * string games#turnBasedMatchResults. |
| 9478 */ |
| 9479 core.String kind; |
| 9480 |
| 9481 /** The version of the match being updated. */ |
| 9482 core.int matchVersion; |
| 9483 |
| 9484 /** The match results for the participants in the match. */ |
| 9485 core.List<ParticipantResult> results; |
| 9486 |
| 9487 |
| 9488 TurnBasedMatchResults(); |
| 9489 |
| 9490 TurnBasedMatchResults.fromJson(core.Map _json) { |
| 9491 if (_json.containsKey("data")) { |
| 9492 data = new TurnBasedMatchDataRequest.fromJson(_json["data"]); |
| 9493 } |
| 9494 if (_json.containsKey("kind")) { |
| 9495 kind = _json["kind"]; |
| 9496 } |
| 9497 if (_json.containsKey("matchVersion")) { |
| 9498 matchVersion = _json["matchVersion"]; |
| 9499 } |
| 9500 if (_json.containsKey("results")) { |
| 9501 results = _json["results"].map((value) => new ParticipantResult.fromJson(v
alue)).toList(); |
| 9502 } |
| 9503 } |
| 9504 |
| 9505 core.Map toJson() { |
| 9506 var _json = new core.Map(); |
| 9507 if (data != null) { |
| 9508 _json["data"] = (data).toJson(); |
| 9509 } |
| 9510 if (kind != null) { |
| 9511 _json["kind"] = kind; |
| 9512 } |
| 9513 if (matchVersion != null) { |
| 9514 _json["matchVersion"] = matchVersion; |
| 9515 } |
| 9516 if (results != null) { |
| 9517 _json["results"] = results.map((value) => (value).toJson()).toList(); |
| 9518 } |
| 9519 return _json; |
| 9520 } |
| 9521 } |
| 9522 |
| 9523 |
| 9524 /** |
| 9525 * This is a JSON template for a list of turn-based matches returned from a |
| 9526 * sync. |
| 9527 */ |
| 9528 class TurnBasedMatchSync { |
| 9529 /** The matches. */ |
| 9530 core.List<TurnBasedMatch> items; |
| 9531 |
| 9532 /** |
| 9533 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9534 * string games#turnBasedMatchSync. |
| 9535 */ |
| 9536 core.String kind; |
| 9537 |
| 9538 /** |
| 9539 * True if there were more matches available to fetch at the time the response |
| 9540 * was generated (which were not returned due to page size limits.) |
| 9541 */ |
| 9542 core.bool moreAvailable; |
| 9543 |
| 9544 /** The pagination token for the next page of results. */ |
| 9545 core.String nextPageToken; |
| 9546 |
| 9547 |
| 9548 TurnBasedMatchSync(); |
| 9549 |
| 9550 TurnBasedMatchSync.fromJson(core.Map _json) { |
| 9551 if (_json.containsKey("items")) { |
| 9552 items = _json["items"].map((value) => new TurnBasedMatch.fromJson(value)).
toList(); |
| 9553 } |
| 9554 if (_json.containsKey("kind")) { |
| 9555 kind = _json["kind"]; |
| 9556 } |
| 9557 if (_json.containsKey("moreAvailable")) { |
| 9558 moreAvailable = _json["moreAvailable"]; |
| 9559 } |
| 9560 if (_json.containsKey("nextPageToken")) { |
| 9561 nextPageToken = _json["nextPageToken"]; |
| 9562 } |
| 9563 } |
| 9564 |
| 9565 core.Map toJson() { |
| 9566 var _json = new core.Map(); |
| 9567 if (items != null) { |
| 9568 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 9569 } |
| 9570 if (kind != null) { |
| 9571 _json["kind"] = kind; |
| 9572 } |
| 9573 if (moreAvailable != null) { |
| 9574 _json["moreAvailable"] = moreAvailable; |
| 9575 } |
| 9576 if (nextPageToken != null) { |
| 9577 _json["nextPageToken"] = nextPageToken; |
| 9578 } |
| 9579 return _json; |
| 9580 } |
| 9581 } |
| 9582 |
| 9583 |
| 9584 /** This is a JSON template for the object representing a turn. */ |
| 9585 class TurnBasedMatchTurn { |
| 9586 /** The shared game state data after the turn is over. */ |
| 9587 TurnBasedMatchDataRequest data; |
| 9588 |
| 9589 /** |
| 9590 * Uniquely identifies the type of this resource. Value is always the fixed |
| 9591 * string games#turnBasedMatchTurn. |
| 9592 */ |
| 9593 core.String kind; |
| 9594 |
| 9595 /** |
| 9596 * The version of this match: an increasing counter, used to avoid out-of-date |
| 9597 * updates to the match. |
| 9598 */ |
| 9599 core.int matchVersion; |
| 9600 |
| 9601 /** |
| 9602 * The ID of the participant who should take their turn next. May be set to |
| 9603 * the current player's participant ID to update match state without changing |
| 9604 * the turn. If not set, the match will wait for other player(s) to join via |
| 9605 * automatching; this is only valid if automatch criteria is set on the match |
| 9606 * with remaining slots for automatched players. |
| 9607 */ |
| 9608 core.String pendingParticipantId; |
| 9609 |
| 9610 /** The match results for the participants in the match. */ |
| 9611 core.List<ParticipantResult> results; |
| 9612 |
| 9613 |
| 9614 TurnBasedMatchTurn(); |
| 9615 |
| 9616 TurnBasedMatchTurn.fromJson(core.Map _json) { |
| 9617 if (_json.containsKey("data")) { |
| 9618 data = new TurnBasedMatchDataRequest.fromJson(_json["data"]); |
| 9619 } |
| 9620 if (_json.containsKey("kind")) { |
| 9621 kind = _json["kind"]; |
| 9622 } |
| 9623 if (_json.containsKey("matchVersion")) { |
| 9624 matchVersion = _json["matchVersion"]; |
| 9625 } |
| 9626 if (_json.containsKey("pendingParticipantId")) { |
| 9627 pendingParticipantId = _json["pendingParticipantId"]; |
| 9628 } |
| 9629 if (_json.containsKey("results")) { |
| 9630 results = _json["results"].map((value) => new ParticipantResult.fromJson(v
alue)).toList(); |
| 9631 } |
| 9632 } |
| 9633 |
| 9634 core.Map toJson() { |
| 9635 var _json = new core.Map(); |
| 9636 if (data != null) { |
| 9637 _json["data"] = (data).toJson(); |
| 9638 } |
| 9639 if (kind != null) { |
| 9640 _json["kind"] = kind; |
| 9641 } |
| 9642 if (matchVersion != null) { |
| 9643 _json["matchVersion"] = matchVersion; |
| 9644 } |
| 9645 if (pendingParticipantId != null) { |
| 9646 _json["pendingParticipantId"] = pendingParticipantId; |
| 9647 } |
| 9648 if (results != null) { |
| 9649 _json["results"] = results.map((value) => (value).toJson()).toList(); |
| 9650 } |
| 9651 return _json; |
| 9652 } |
| 9653 } |
| 9654 |
| 9655 |
OLD | NEW |