1// Copyright 2019 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package games provides access to the Google Play Game Services API. 8// 9// For product documentation, see: https://developers.google.com/games/services/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/games/v1" 16// ... 17// ctx := context.Background() 18// gamesService, err := games.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// gamesService, err := games.NewService(ctx, option.WithScopes(games.GamesScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// gamesService, err := games.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// gamesService, err := games.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package games // import "google.golang.org/api/games/v1" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 gensupport "google.golang.org/api/gensupport" 57 googleapi "google.golang.org/api/googleapi" 58 option "google.golang.org/api/option" 59 htransport "google.golang.org/api/transport/http" 60) 61 62// Always reference these packages, just in case the auto-generated code 63// below doesn't. 64var _ = bytes.NewBuffer 65var _ = strconv.Itoa 66var _ = fmt.Sprintf 67var _ = json.NewDecoder 68var _ = io.Copy 69var _ = url.Parse 70var _ = gensupport.MarshalJSON 71var _ = googleapi.Version 72var _ = errors.New 73var _ = strings.Replace 74var _ = context.Canceled 75 76const apiId = "games:v1" 77const apiName = "games" 78const apiVersion = "v1" 79const basePath = "https://www.googleapis.com/games/v1/" 80 81// OAuth2 scopes used by this API. 82const ( 83 // View and manage its own configuration data in your Google Drive 84 DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata" 85 86 // Create, edit, and delete your Google Play Games activity 87 GamesScope = "https://www.googleapis.com/auth/games" 88) 89 90// NewService creates a new Service. 91func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 92 scopesOption := option.WithScopes( 93 "https://www.googleapis.com/auth/drive.appdata", 94 "https://www.googleapis.com/auth/games", 95 ) 96 // NOTE: prepend, so we don't override user-specified scopes. 97 opts = append([]option.ClientOption{scopesOption}, opts...) 98 client, endpoint, err := htransport.NewClient(ctx, opts...) 99 if err != nil { 100 return nil, err 101 } 102 s, err := New(client) 103 if err != nil { 104 return nil, err 105 } 106 if endpoint != "" { 107 s.BasePath = endpoint 108 } 109 return s, nil 110} 111 112// New creates a new Service. It uses the provided http.Client for requests. 113// 114// Deprecated: please use NewService instead. 115// To provide a custom HTTP client, use option.WithHTTPClient. 116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 117func New(client *http.Client) (*Service, error) { 118 if client == nil { 119 return nil, errors.New("client is nil") 120 } 121 s := &Service{client: client, BasePath: basePath} 122 s.AchievementDefinitions = NewAchievementDefinitionsService(s) 123 s.Achievements = NewAchievementsService(s) 124 s.Applications = NewApplicationsService(s) 125 s.Events = NewEventsService(s) 126 s.Leaderboards = NewLeaderboardsService(s) 127 s.Metagame = NewMetagameService(s) 128 s.Players = NewPlayersService(s) 129 s.Pushtokens = NewPushtokensService(s) 130 s.QuestMilestones = NewQuestMilestonesService(s) 131 s.Quests = NewQuestsService(s) 132 s.Revisions = NewRevisionsService(s) 133 s.Rooms = NewRoomsService(s) 134 s.Scores = NewScoresService(s) 135 s.Snapshots = NewSnapshotsService(s) 136 s.TurnBasedMatches = NewTurnBasedMatchesService(s) 137 return s, nil 138} 139 140type Service struct { 141 client *http.Client 142 BasePath string // API endpoint base URL 143 UserAgent string // optional additional User-Agent fragment 144 145 AchievementDefinitions *AchievementDefinitionsService 146 147 Achievements *AchievementsService 148 149 Applications *ApplicationsService 150 151 Events *EventsService 152 153 Leaderboards *LeaderboardsService 154 155 Metagame *MetagameService 156 157 Players *PlayersService 158 159 Pushtokens *PushtokensService 160 161 QuestMilestones *QuestMilestonesService 162 163 Quests *QuestsService 164 165 Revisions *RevisionsService 166 167 Rooms *RoomsService 168 169 Scores *ScoresService 170 171 Snapshots *SnapshotsService 172 173 TurnBasedMatches *TurnBasedMatchesService 174} 175 176func (s *Service) userAgent() string { 177 if s.UserAgent == "" { 178 return googleapi.UserAgent 179 } 180 return googleapi.UserAgent + " " + s.UserAgent 181} 182 183func NewAchievementDefinitionsService(s *Service) *AchievementDefinitionsService { 184 rs := &AchievementDefinitionsService{s: s} 185 return rs 186} 187 188type AchievementDefinitionsService struct { 189 s *Service 190} 191 192func NewAchievementsService(s *Service) *AchievementsService { 193 rs := &AchievementsService{s: s} 194 return rs 195} 196 197type AchievementsService struct { 198 s *Service 199} 200 201func NewApplicationsService(s *Service) *ApplicationsService { 202 rs := &ApplicationsService{s: s} 203 return rs 204} 205 206type ApplicationsService struct { 207 s *Service 208} 209 210func NewEventsService(s *Service) *EventsService { 211 rs := &EventsService{s: s} 212 return rs 213} 214 215type EventsService struct { 216 s *Service 217} 218 219func NewLeaderboardsService(s *Service) *LeaderboardsService { 220 rs := &LeaderboardsService{s: s} 221 return rs 222} 223 224type LeaderboardsService struct { 225 s *Service 226} 227 228func NewMetagameService(s *Service) *MetagameService { 229 rs := &MetagameService{s: s} 230 return rs 231} 232 233type MetagameService struct { 234 s *Service 235} 236 237func NewPlayersService(s *Service) *PlayersService { 238 rs := &PlayersService{s: s} 239 return rs 240} 241 242type PlayersService struct { 243 s *Service 244} 245 246func NewPushtokensService(s *Service) *PushtokensService { 247 rs := &PushtokensService{s: s} 248 return rs 249} 250 251type PushtokensService struct { 252 s *Service 253} 254 255func NewQuestMilestonesService(s *Service) *QuestMilestonesService { 256 rs := &QuestMilestonesService{s: s} 257 return rs 258} 259 260type QuestMilestonesService struct { 261 s *Service 262} 263 264func NewQuestsService(s *Service) *QuestsService { 265 rs := &QuestsService{s: s} 266 return rs 267} 268 269type QuestsService struct { 270 s *Service 271} 272 273func NewRevisionsService(s *Service) *RevisionsService { 274 rs := &RevisionsService{s: s} 275 return rs 276} 277 278type RevisionsService struct { 279 s *Service 280} 281 282func NewRoomsService(s *Service) *RoomsService { 283 rs := &RoomsService{s: s} 284 return rs 285} 286 287type RoomsService struct { 288 s *Service 289} 290 291func NewScoresService(s *Service) *ScoresService { 292 rs := &ScoresService{s: s} 293 return rs 294} 295 296type ScoresService struct { 297 s *Service 298} 299 300func NewSnapshotsService(s *Service) *SnapshotsService { 301 rs := &SnapshotsService{s: s} 302 return rs 303} 304 305type SnapshotsService struct { 306 s *Service 307} 308 309func NewTurnBasedMatchesService(s *Service) *TurnBasedMatchesService { 310 rs := &TurnBasedMatchesService{s: s} 311 return rs 312} 313 314type TurnBasedMatchesService struct { 315 s *Service 316} 317 318// AchievementDefinition: This is a JSON template for an achievement 319// definition object. 320type AchievementDefinition struct { 321 // AchievementType: The type of the achievement. 322 // Possible values are: 323 // - "STANDARD" - Achievement is either locked or unlocked. 324 // - "INCREMENTAL" - Achievement is incremental. 325 AchievementType string `json:"achievementType,omitempty"` 326 327 // Description: The description of the achievement. 328 Description string `json:"description,omitempty"` 329 330 // ExperiencePoints: Experience points which will be earned when 331 // unlocking this achievement. 332 ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` 333 334 // FormattedTotalSteps: The total steps for an incremental achievement 335 // as a string. 336 FormattedTotalSteps string `json:"formattedTotalSteps,omitempty"` 337 338 // Id: The ID of the achievement. 339 Id string `json:"id,omitempty"` 340 341 // InitialState: The initial state of the achievement. 342 // Possible values are: 343 // - "HIDDEN" - Achievement is hidden. 344 // - "REVEALED" - Achievement is revealed. 345 // - "UNLOCKED" - Achievement is unlocked. 346 InitialState string `json:"initialState,omitempty"` 347 348 // IsRevealedIconUrlDefault: Indicates whether the revealed icon image 349 // being returned is a default image, or is provided by the game. 350 IsRevealedIconUrlDefault bool `json:"isRevealedIconUrlDefault,omitempty"` 351 352 // IsUnlockedIconUrlDefault: Indicates whether the unlocked icon image 353 // being returned is a default image, or is game-provided. 354 IsUnlockedIconUrlDefault bool `json:"isUnlockedIconUrlDefault,omitempty"` 355 356 // Kind: Uniquely identifies the type of this resource. Value is always 357 // the fixed string games#achievementDefinition. 358 Kind string `json:"kind,omitempty"` 359 360 // Name: The name of the achievement. 361 Name string `json:"name,omitempty"` 362 363 // RevealedIconUrl: The image URL for the revealed achievement icon. 364 RevealedIconUrl string `json:"revealedIconUrl,omitempty"` 365 366 // TotalSteps: The total steps for an incremental achievement. 367 TotalSteps int64 `json:"totalSteps,omitempty"` 368 369 // UnlockedIconUrl: The image URL for the unlocked achievement icon. 370 UnlockedIconUrl string `json:"unlockedIconUrl,omitempty"` 371 372 // ForceSendFields is a list of field names (e.g. "AchievementType") to 373 // unconditionally include in API requests. By default, fields with 374 // empty values are omitted from API requests. However, any non-pointer, 375 // non-interface field appearing in ForceSendFields will be sent to the 376 // server regardless of whether the field is empty or not. This may be 377 // used to include empty fields in Patch requests. 378 ForceSendFields []string `json:"-"` 379 380 // NullFields is a list of field names (e.g. "AchievementType") to 381 // include in API requests with the JSON null value. By default, fields 382 // with empty values are omitted from API requests. However, any field 383 // with an empty value appearing in NullFields will be sent to the 384 // server as null. It is an error if a field in this list has a 385 // non-empty value. This may be used to include null fields in Patch 386 // requests. 387 NullFields []string `json:"-"` 388} 389 390func (s *AchievementDefinition) MarshalJSON() ([]byte, error) { 391 type NoMethod AchievementDefinition 392 raw := NoMethod(*s) 393 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 394} 395 396// AchievementDefinitionsListResponse: This is a JSON template for a 397// list of achievement definition objects. 398type AchievementDefinitionsListResponse struct { 399 // Items: The achievement definitions. 400 Items []*AchievementDefinition `json:"items,omitempty"` 401 402 // Kind: Uniquely identifies the type of this resource. Value is always 403 // the fixed string games#achievementDefinitionsListResponse. 404 Kind string `json:"kind,omitempty"` 405 406 // NextPageToken: Token corresponding to the next page of results. 407 NextPageToken string `json:"nextPageToken,omitempty"` 408 409 // ServerResponse contains the HTTP response code and headers from the 410 // server. 411 googleapi.ServerResponse `json:"-"` 412 413 // ForceSendFields is a list of field names (e.g. "Items") to 414 // unconditionally include in API requests. By default, fields with 415 // empty values are omitted from API requests. However, any non-pointer, 416 // non-interface field appearing in ForceSendFields will be sent to the 417 // server regardless of whether the field is empty or not. This may be 418 // used to include empty fields in Patch requests. 419 ForceSendFields []string `json:"-"` 420 421 // NullFields is a list of field names (e.g. "Items") to include in API 422 // requests with the JSON null value. By default, fields with empty 423 // values are omitted from API requests. However, any field with an 424 // empty value appearing in NullFields will be sent to the server as 425 // null. It is an error if a field in this list has a non-empty value. 426 // This may be used to include null fields in Patch requests. 427 NullFields []string `json:"-"` 428} 429 430func (s *AchievementDefinitionsListResponse) MarshalJSON() ([]byte, error) { 431 type NoMethod AchievementDefinitionsListResponse 432 raw := NoMethod(*s) 433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 434} 435 436// AchievementIncrementResponse: This is a JSON template for an 437// achievement increment response 438type AchievementIncrementResponse struct { 439 // CurrentSteps: The current steps recorded for this incremental 440 // achievement. 441 CurrentSteps int64 `json:"currentSteps,omitempty"` 442 443 // Kind: Uniquely identifies the type of this resource. Value is always 444 // the fixed string games#achievementIncrementResponse. 445 Kind string `json:"kind,omitempty"` 446 447 // NewlyUnlocked: Whether the current steps for the achievement has 448 // reached the number of steps required to unlock. 449 NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` 450 451 // ServerResponse contains the HTTP response code and headers from the 452 // server. 453 googleapi.ServerResponse `json:"-"` 454 455 // ForceSendFields is a list of field names (e.g. "CurrentSteps") to 456 // unconditionally include in API requests. By default, fields with 457 // empty values are omitted from API requests. However, any non-pointer, 458 // non-interface field appearing in ForceSendFields will be sent to the 459 // server regardless of whether the field is empty or not. This may be 460 // used to include empty fields in Patch requests. 461 ForceSendFields []string `json:"-"` 462 463 // NullFields is a list of field names (e.g. "CurrentSteps") to include 464 // in API requests with the JSON null value. By default, fields with 465 // empty values are omitted from API requests. However, any field with 466 // an empty value appearing in NullFields will be sent to the server as 467 // null. It is an error if a field in this list has a non-empty value. 468 // This may be used to include null fields in Patch requests. 469 NullFields []string `json:"-"` 470} 471 472func (s *AchievementIncrementResponse) MarshalJSON() ([]byte, error) { 473 type NoMethod AchievementIncrementResponse 474 raw := NoMethod(*s) 475 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 476} 477 478// AchievementRevealResponse: This is a JSON template for an achievement 479// reveal response 480type AchievementRevealResponse struct { 481 // CurrentState: The current state of the achievement for which a reveal 482 // was attempted. This might be UNLOCKED if the achievement was already 483 // unlocked. 484 // Possible values are: 485 // - "REVEALED" - Achievement is revealed. 486 // - "UNLOCKED" - Achievement is unlocked. 487 CurrentState string `json:"currentState,omitempty"` 488 489 // Kind: Uniquely identifies the type of this resource. Value is always 490 // the fixed string games#achievementRevealResponse. 491 Kind string `json:"kind,omitempty"` 492 493 // ServerResponse contains the HTTP response code and headers from the 494 // server. 495 googleapi.ServerResponse `json:"-"` 496 497 // ForceSendFields is a list of field names (e.g. "CurrentState") to 498 // unconditionally include in API requests. By default, fields with 499 // empty values are omitted from API requests. However, any non-pointer, 500 // non-interface field appearing in ForceSendFields will be sent to the 501 // server regardless of whether the field is empty or not. This may be 502 // used to include empty fields in Patch requests. 503 ForceSendFields []string `json:"-"` 504 505 // NullFields is a list of field names (e.g. "CurrentState") to include 506 // in API requests with the JSON null value. By default, fields with 507 // empty values are omitted from API requests. However, any field with 508 // an empty value appearing in NullFields will be sent to the server as 509 // null. It is an error if a field in this list has a non-empty value. 510 // This may be used to include null fields in Patch requests. 511 NullFields []string `json:"-"` 512} 513 514func (s *AchievementRevealResponse) MarshalJSON() ([]byte, error) { 515 type NoMethod AchievementRevealResponse 516 raw := NoMethod(*s) 517 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 518} 519 520// AchievementSetStepsAtLeastResponse: This is a JSON template for an 521// achievement set steps at least response. 522type AchievementSetStepsAtLeastResponse struct { 523 // CurrentSteps: The current steps recorded for this incremental 524 // achievement. 525 CurrentSteps int64 `json:"currentSteps,omitempty"` 526 527 // Kind: Uniquely identifies the type of this resource. Value is always 528 // the fixed string games#achievementSetStepsAtLeastResponse. 529 Kind string `json:"kind,omitempty"` 530 531 // NewlyUnlocked: Whether the the current steps for the achievement has 532 // reached the number of steps required to unlock. 533 NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` 534 535 // ServerResponse contains the HTTP response code and headers from the 536 // server. 537 googleapi.ServerResponse `json:"-"` 538 539 // ForceSendFields is a list of field names (e.g. "CurrentSteps") to 540 // unconditionally include in API requests. By default, fields with 541 // empty values are omitted from API requests. However, any non-pointer, 542 // non-interface field appearing in ForceSendFields will be sent to the 543 // server regardless of whether the field is empty or not. This may be 544 // used to include empty fields in Patch requests. 545 ForceSendFields []string `json:"-"` 546 547 // NullFields is a list of field names (e.g. "CurrentSteps") to include 548 // in API requests with the JSON null value. By default, fields with 549 // empty values are omitted from API requests. However, any field with 550 // an empty value appearing in NullFields will be sent to the server as 551 // null. It is an error if a field in this list has a non-empty value. 552 // This may be used to include null fields in Patch requests. 553 NullFields []string `json:"-"` 554} 555 556func (s *AchievementSetStepsAtLeastResponse) MarshalJSON() ([]byte, error) { 557 type NoMethod AchievementSetStepsAtLeastResponse 558 raw := NoMethod(*s) 559 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 560} 561 562// AchievementUnlockResponse: This is a JSON template for an achievement 563// unlock response 564type AchievementUnlockResponse struct { 565 // Kind: Uniquely identifies the type of this resource. Value is always 566 // the fixed string games#achievementUnlockResponse. 567 Kind string `json:"kind,omitempty"` 568 569 // NewlyUnlocked: Whether this achievement was newly unlocked (that is, 570 // whether the unlock request for the achievement was the first for the 571 // player). 572 NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` 573 574 // ServerResponse contains the HTTP response code and headers from the 575 // server. 576 googleapi.ServerResponse `json:"-"` 577 578 // ForceSendFields is a list of field names (e.g. "Kind") to 579 // unconditionally include in API requests. By default, fields with 580 // empty values are omitted from API requests. However, any non-pointer, 581 // non-interface field appearing in ForceSendFields will be sent to the 582 // server regardless of whether the field is empty or not. This may be 583 // used to include empty fields in Patch requests. 584 ForceSendFields []string `json:"-"` 585 586 // NullFields is a list of field names (e.g. "Kind") to include in API 587 // requests with the JSON null value. By default, fields with empty 588 // values are omitted from API requests. However, any field with an 589 // empty value appearing in NullFields will be sent to the server as 590 // null. It is an error if a field in this list has a non-empty value. 591 // This may be used to include null fields in Patch requests. 592 NullFields []string `json:"-"` 593} 594 595func (s *AchievementUnlockResponse) MarshalJSON() ([]byte, error) { 596 type NoMethod AchievementUnlockResponse 597 raw := NoMethod(*s) 598 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 599} 600 601// AchievementUpdateMultipleRequest: This is a JSON template for a list 602// of achievement update requests. 603type AchievementUpdateMultipleRequest struct { 604 // Kind: Uniquely identifies the type of this resource. Value is always 605 // the fixed string games#achievementUpdateMultipleRequest. 606 Kind string `json:"kind,omitempty"` 607 608 // Updates: The individual achievement update requests. 609 Updates []*AchievementUpdateRequest `json:"updates,omitempty"` 610 611 // ForceSendFields is a list of field names (e.g. "Kind") to 612 // unconditionally include in API requests. By default, fields with 613 // empty values are omitted from API requests. However, any non-pointer, 614 // non-interface field appearing in ForceSendFields will be sent to the 615 // server regardless of whether the field is empty or not. This may be 616 // used to include empty fields in Patch requests. 617 ForceSendFields []string `json:"-"` 618 619 // NullFields is a list of field names (e.g. "Kind") to include in API 620 // requests with the JSON null value. By default, fields with empty 621 // values are omitted from API requests. However, any field with an 622 // empty value appearing in NullFields will be sent to the server as 623 // null. It is an error if a field in this list has a non-empty value. 624 // This may be used to include null fields in Patch requests. 625 NullFields []string `json:"-"` 626} 627 628func (s *AchievementUpdateMultipleRequest) MarshalJSON() ([]byte, error) { 629 type NoMethod AchievementUpdateMultipleRequest 630 raw := NoMethod(*s) 631 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 632} 633 634// AchievementUpdateMultipleResponse: This is a JSON template for an 635// achievement unlock response. 636type AchievementUpdateMultipleResponse struct { 637 // Kind: Uniquely identifies the type of this resource. Value is always 638 // the fixed string games#achievementUpdateListResponse. 639 Kind string `json:"kind,omitempty"` 640 641 // UpdatedAchievements: The updated state of the achievements. 642 UpdatedAchievements []*AchievementUpdateResponse `json:"updatedAchievements,omitempty"` 643 644 // ServerResponse contains the HTTP response code and headers from the 645 // server. 646 googleapi.ServerResponse `json:"-"` 647 648 // ForceSendFields is a list of field names (e.g. "Kind") to 649 // unconditionally include in API requests. By default, fields with 650 // empty values are omitted from API requests. However, any non-pointer, 651 // non-interface field appearing in ForceSendFields will be sent to the 652 // server regardless of whether the field is empty or not. This may be 653 // used to include empty fields in Patch requests. 654 ForceSendFields []string `json:"-"` 655 656 // NullFields is a list of field names (e.g. "Kind") to include in API 657 // requests with the JSON null value. By default, fields with empty 658 // values are omitted from API requests. However, any field with an 659 // empty value appearing in NullFields will be sent to the server as 660 // null. It is an error if a field in this list has a non-empty value. 661 // This may be used to include null fields in Patch requests. 662 NullFields []string `json:"-"` 663} 664 665func (s *AchievementUpdateMultipleResponse) MarshalJSON() ([]byte, error) { 666 type NoMethod AchievementUpdateMultipleResponse 667 raw := NoMethod(*s) 668 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 669} 670 671// AchievementUpdateRequest: This is a JSON template for a request to 672// update an achievement. 673type AchievementUpdateRequest struct { 674 // AchievementId: The achievement this update is being applied to. 675 AchievementId string `json:"achievementId,omitempty"` 676 677 // IncrementPayload: The payload if an update of type INCREMENT was 678 // requested for the achievement. 679 IncrementPayload *GamesAchievementIncrement `json:"incrementPayload,omitempty"` 680 681 // Kind: Uniquely identifies the type of this resource. Value is always 682 // the fixed string games#achievementUpdateRequest. 683 Kind string `json:"kind,omitempty"` 684 685 // SetStepsAtLeastPayload: The payload if an update of type 686 // SET_STEPS_AT_LEAST was requested for the achievement. 687 SetStepsAtLeastPayload *GamesAchievementSetStepsAtLeast `json:"setStepsAtLeastPayload,omitempty"` 688 689 // UpdateType: The type of update being applied. 690 // Possible values are: 691 // - "REVEAL" - Achievement is revealed. 692 // - "UNLOCK" - Achievement is unlocked. 693 // - "INCREMENT" - Achievement is incremented. 694 // - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the 695 // passed value. 696 UpdateType string `json:"updateType,omitempty"` 697 698 // ForceSendFields is a list of field names (e.g. "AchievementId") to 699 // unconditionally include in API requests. By default, fields with 700 // empty values are omitted from API requests. However, any non-pointer, 701 // non-interface field appearing in ForceSendFields will be sent to the 702 // server regardless of whether the field is empty or not. This may be 703 // used to include empty fields in Patch requests. 704 ForceSendFields []string `json:"-"` 705 706 // NullFields is a list of field names (e.g. "AchievementId") to include 707 // in API requests with the JSON null value. By default, fields with 708 // empty values are omitted from API requests. However, any field with 709 // an empty value appearing in NullFields will be sent to the server as 710 // null. It is an error if a field in this list has a non-empty value. 711 // This may be used to include null fields in Patch requests. 712 NullFields []string `json:"-"` 713} 714 715func (s *AchievementUpdateRequest) MarshalJSON() ([]byte, error) { 716 type NoMethod AchievementUpdateRequest 717 raw := NoMethod(*s) 718 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 719} 720 721// AchievementUpdateResponse: This is a JSON template for an achievement 722// update response. 723type AchievementUpdateResponse struct { 724 // AchievementId: The achievement this update is was applied to. 725 AchievementId string `json:"achievementId,omitempty"` 726 727 // CurrentState: The current state of the achievement. 728 // Possible values are: 729 // - "HIDDEN" - Achievement is hidden. 730 // - "REVEALED" - Achievement is revealed. 731 // - "UNLOCKED" - Achievement is unlocked. 732 CurrentState string `json:"currentState,omitempty"` 733 734 // CurrentSteps: The current steps recorded for this achievement if it 735 // is incremental. 736 CurrentSteps int64 `json:"currentSteps,omitempty"` 737 738 // Kind: Uniquely identifies the type of this resource. Value is always 739 // the fixed string games#achievementUpdateResponse. 740 Kind string `json:"kind,omitempty"` 741 742 // NewlyUnlocked: Whether this achievement was newly unlocked (that is, 743 // whether the unlock request for the achievement was the first for the 744 // player). 745 NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` 746 747 // UpdateOccurred: Whether the requested updates actually affected the 748 // achievement. 749 UpdateOccurred bool `json:"updateOccurred,omitempty"` 750 751 // ForceSendFields is a list of field names (e.g. "AchievementId") to 752 // unconditionally include in API requests. By default, fields with 753 // empty values are omitted from API requests. However, any non-pointer, 754 // non-interface field appearing in ForceSendFields will be sent to the 755 // server regardless of whether the field is empty or not. This may be 756 // used to include empty fields in Patch requests. 757 ForceSendFields []string `json:"-"` 758 759 // NullFields is a list of field names (e.g. "AchievementId") to include 760 // in API requests with the JSON null value. By default, fields with 761 // empty values are omitted from API requests. However, any field with 762 // an empty value appearing in NullFields will be sent to the server as 763 // null. It is an error if a field in this list has a non-empty value. 764 // This may be used to include null fields in Patch requests. 765 NullFields []string `json:"-"` 766} 767 768func (s *AchievementUpdateResponse) MarshalJSON() ([]byte, error) { 769 type NoMethod AchievementUpdateResponse 770 raw := NoMethod(*s) 771 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 772} 773 774// AggregateStats: This is a JSON template for aggregate stats. 775type AggregateStats struct { 776 // Count: The number of messages sent between a pair of peers. 777 Count int64 `json:"count,omitempty,string"` 778 779 // Kind: Uniquely identifies the type of this resource. Value is always 780 // the fixed string games#aggregateStats. 781 Kind string `json:"kind,omitempty"` 782 783 // Max: The maximum amount. 784 Max int64 `json:"max,omitempty,string"` 785 786 // Min: The minimum amount. 787 Min int64 `json:"min,omitempty,string"` 788 789 // Sum: The total number of bytes sent for messages between a pair of 790 // peers. 791 Sum int64 `json:"sum,omitempty,string"` 792 793 // ForceSendFields is a list of field names (e.g. "Count") to 794 // unconditionally include in API requests. By default, fields with 795 // empty values are omitted from API requests. However, any non-pointer, 796 // non-interface field appearing in ForceSendFields will be sent to the 797 // server regardless of whether the field is empty or not. This may be 798 // used to include empty fields in Patch requests. 799 ForceSendFields []string `json:"-"` 800 801 // NullFields is a list of field names (e.g. "Count") to include in API 802 // requests with the JSON null value. By default, fields with empty 803 // values are omitted from API requests. However, any field with an 804 // empty value appearing in NullFields will be sent to the server as 805 // null. It is an error if a field in this list has a non-empty value. 806 // This may be used to include null fields in Patch requests. 807 NullFields []string `json:"-"` 808} 809 810func (s *AggregateStats) MarshalJSON() ([]byte, error) { 811 type NoMethod AggregateStats 812 raw := NoMethod(*s) 813 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 814} 815 816// AnonymousPlayer: This is a JSON template for an anonymous player 817type AnonymousPlayer struct { 818 // AvatarImageUrl: The base URL for the image to display for the 819 // anonymous player. 820 AvatarImageUrl string `json:"avatarImageUrl,omitempty"` 821 822 // DisplayName: The name to display for the anonymous player. 823 DisplayName string `json:"displayName,omitempty"` 824 825 // Kind: Uniquely identifies the type of this resource. Value is always 826 // the fixed string games#anonymousPlayer. 827 Kind string `json:"kind,omitempty"` 828 829 // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to 830 // unconditionally include in API requests. By default, fields with 831 // empty values are omitted from API requests. However, any non-pointer, 832 // non-interface field appearing in ForceSendFields will be sent to the 833 // server regardless of whether the field is empty or not. This may be 834 // used to include empty fields in Patch requests. 835 ForceSendFields []string `json:"-"` 836 837 // NullFields is a list of field names (e.g. "AvatarImageUrl") to 838 // include in API requests with the JSON null value. By default, fields 839 // with empty values are omitted from API requests. However, any field 840 // with an empty value appearing in NullFields will be sent to the 841 // server as null. It is an error if a field in this list has a 842 // non-empty value. This may be used to include null fields in Patch 843 // requests. 844 NullFields []string `json:"-"` 845} 846 847func (s *AnonymousPlayer) MarshalJSON() ([]byte, error) { 848 type NoMethod AnonymousPlayer 849 raw := NoMethod(*s) 850 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 851} 852 853// Application: This is a JSON template for the Application resource. 854type Application struct { 855 // AchievementCount: The number of achievements visible to the currently 856 // authenticated player. 857 AchievementCount int64 `json:"achievement_count,omitempty"` 858 859 // Assets: The assets of the application. 860 Assets []*ImageAsset `json:"assets,omitempty"` 861 862 // Author: The author of the application. 863 Author string `json:"author,omitempty"` 864 865 // Category: The category of the application. 866 Category *ApplicationCategory `json:"category,omitempty"` 867 868 // Description: The description of the application. 869 Description string `json:"description,omitempty"` 870 871 // EnabledFeatures: A list of features that have been enabled for the 872 // application. 873 // Possible values are: 874 // - "SNAPSHOTS" - Snapshots has been enabled 875 EnabledFeatures []string `json:"enabledFeatures,omitempty"` 876 877 // Id: The ID of the application. 878 Id string `json:"id,omitempty"` 879 880 // Instances: The instances of the application. 881 Instances []*Instance `json:"instances,omitempty"` 882 883 // Kind: Uniquely identifies the type of this resource. Value is always 884 // the fixed string games#application. 885 Kind string `json:"kind,omitempty"` 886 887 // LastUpdatedTimestamp: The last updated timestamp of the application. 888 LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"` 889 890 // LeaderboardCount: The number of leaderboards visible to the currently 891 // authenticated player. 892 LeaderboardCount int64 `json:"leaderboard_count,omitempty"` 893 894 // Name: The name of the application. 895 Name string `json:"name,omitempty"` 896 897 // ThemeColor: A hint to the client UI for what color to use as an 898 // app-themed color. The color is given as an RGB triplet (e.g. 899 // "E0E0E0"). 900 ThemeColor string `json:"themeColor,omitempty"` 901 902 // ServerResponse contains the HTTP response code and headers from the 903 // server. 904 googleapi.ServerResponse `json:"-"` 905 906 // ForceSendFields is a list of field names (e.g. "AchievementCount") to 907 // unconditionally include in API requests. By default, fields with 908 // empty values are omitted from API requests. However, any non-pointer, 909 // non-interface field appearing in ForceSendFields will be sent to the 910 // server regardless of whether the field is empty or not. This may be 911 // used to include empty fields in Patch requests. 912 ForceSendFields []string `json:"-"` 913 914 // NullFields is a list of field names (e.g. "AchievementCount") to 915 // include in API requests with the JSON null value. By default, fields 916 // with empty values are omitted from API requests. However, any field 917 // with an empty value appearing in NullFields will be sent to the 918 // server as null. It is an error if a field in this list has a 919 // non-empty value. This may be used to include null fields in Patch 920 // requests. 921 NullFields []string `json:"-"` 922} 923 924func (s *Application) MarshalJSON() ([]byte, error) { 925 type NoMethod Application 926 raw := NoMethod(*s) 927 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 928} 929 930// ApplicationCategory: This is a JSON template for an application 931// category object. 932type ApplicationCategory struct { 933 // Kind: Uniquely identifies the type of this resource. Value is always 934 // the fixed string games#applicationCategory. 935 Kind string `json:"kind,omitempty"` 936 937 // Primary: The primary category. 938 Primary string `json:"primary,omitempty"` 939 940 // Secondary: The secondary category. 941 Secondary string `json:"secondary,omitempty"` 942 943 // ForceSendFields is a list of field names (e.g. "Kind") to 944 // unconditionally include in API requests. By default, fields with 945 // empty values are omitted from API requests. However, any non-pointer, 946 // non-interface field appearing in ForceSendFields will be sent to the 947 // server regardless of whether the field is empty or not. This may be 948 // used to include empty fields in Patch requests. 949 ForceSendFields []string `json:"-"` 950 951 // NullFields is a list of field names (e.g. "Kind") to include in API 952 // requests with the JSON null value. By default, fields with empty 953 // values are omitted from API requests. However, any field with an 954 // empty value appearing in NullFields will be sent to the server as 955 // null. It is an error if a field in this list has a non-empty value. 956 // This may be used to include null fields in Patch requests. 957 NullFields []string `json:"-"` 958} 959 960func (s *ApplicationCategory) MarshalJSON() ([]byte, error) { 961 type NoMethod ApplicationCategory 962 raw := NoMethod(*s) 963 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 964} 965 966// ApplicationVerifyResponse: This is a JSON template for a third party 967// application verification response resource. 968type ApplicationVerifyResponse struct { 969 // AlternatePlayerId: An alternate ID that was once used for the player 970 // that was issued the auth token used in this request. (This field is 971 // not normally populated.) 972 AlternatePlayerId string `json:"alternate_player_id,omitempty"` 973 974 // Kind: Uniquely identifies the type of this resource. Value is always 975 // the fixed string games#applicationVerifyResponse. 976 Kind string `json:"kind,omitempty"` 977 978 // PlayerId: The ID of the player that was issued the auth token used in 979 // this request. 980 PlayerId string `json:"player_id,omitempty"` 981 982 // ServerResponse contains the HTTP response code and headers from the 983 // server. 984 googleapi.ServerResponse `json:"-"` 985 986 // ForceSendFields is a list of field names (e.g. "AlternatePlayerId") 987 // to unconditionally include in API requests. By default, fields with 988 // empty values are omitted from API requests. However, any non-pointer, 989 // non-interface field appearing in ForceSendFields will be sent to the 990 // server regardless of whether the field is empty or not. This may be 991 // used to include empty fields in Patch requests. 992 ForceSendFields []string `json:"-"` 993 994 // NullFields is a list of field names (e.g. "AlternatePlayerId") to 995 // include in API requests with the JSON null value. By default, fields 996 // with empty values are omitted from API requests. However, any field 997 // with an empty value appearing in NullFields will be sent to the 998 // server as null. It is an error if a field in this list has a 999 // non-empty value. This may be used to include null fields in Patch 1000 // requests. 1001 NullFields []string `json:"-"` 1002} 1003 1004func (s *ApplicationVerifyResponse) MarshalJSON() ([]byte, error) { 1005 type NoMethod ApplicationVerifyResponse 1006 raw := NoMethod(*s) 1007 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1008} 1009 1010// Category: This is a JSON template for data related to individual game 1011// categories. 1012type Category struct { 1013 // Category: The category name. 1014 Category string `json:"category,omitempty"` 1015 1016 // ExperiencePoints: Experience points earned in this category. 1017 ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` 1018 1019 // Kind: Uniquely identifies the type of this resource. Value is always 1020 // the fixed string games#category. 1021 Kind string `json:"kind,omitempty"` 1022 1023 // ForceSendFields is a list of field names (e.g. "Category") to 1024 // unconditionally include in API requests. By default, fields with 1025 // empty values are omitted from API requests. However, any non-pointer, 1026 // non-interface field appearing in ForceSendFields will be sent to the 1027 // server regardless of whether the field is empty or not. This may be 1028 // used to include empty fields in Patch requests. 1029 ForceSendFields []string `json:"-"` 1030 1031 // NullFields is a list of field names (e.g. "Category") to include in 1032 // API requests with the JSON null value. By default, fields with empty 1033 // values are omitted from API requests. However, any field with an 1034 // empty value appearing in NullFields will be sent to the server as 1035 // null. It is an error if a field in this list has a non-empty value. 1036 // This may be used to include null fields in Patch requests. 1037 NullFields []string `json:"-"` 1038} 1039 1040func (s *Category) MarshalJSON() ([]byte, error) { 1041 type NoMethod Category 1042 raw := NoMethod(*s) 1043 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1044} 1045 1046// CategoryListResponse: This is a JSON template for a list of category 1047// data objects. 1048type CategoryListResponse struct { 1049 // Items: The list of categories with usage data. 1050 Items []*Category `json:"items,omitempty"` 1051 1052 // Kind: Uniquely identifies the type of this resource. Value is always 1053 // the fixed string games#categoryListResponse. 1054 Kind string `json:"kind,omitempty"` 1055 1056 // NextPageToken: Token corresponding to the next page of results. 1057 NextPageToken string `json:"nextPageToken,omitempty"` 1058 1059 // ServerResponse contains the HTTP response code and headers from the 1060 // server. 1061 googleapi.ServerResponse `json:"-"` 1062 1063 // ForceSendFields is a list of field names (e.g. "Items") to 1064 // unconditionally include in API requests. By default, fields with 1065 // empty values are omitted from API requests. However, any non-pointer, 1066 // non-interface field appearing in ForceSendFields will be sent to the 1067 // server regardless of whether the field is empty or not. This may be 1068 // used to include empty fields in Patch requests. 1069 ForceSendFields []string `json:"-"` 1070 1071 // NullFields is a list of field names (e.g. "Items") to include in API 1072 // requests with the JSON null value. By default, fields with empty 1073 // values are omitted from API requests. However, any field with an 1074 // empty value appearing in NullFields will be sent to the server as 1075 // null. It is an error if a field in this list has a non-empty value. 1076 // This may be used to include null fields in Patch requests. 1077 NullFields []string `json:"-"` 1078} 1079 1080func (s *CategoryListResponse) MarshalJSON() ([]byte, error) { 1081 type NoMethod CategoryListResponse 1082 raw := NoMethod(*s) 1083 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1084} 1085 1086// EventBatchRecordFailure: This is a JSON template for a batch update 1087// failure resource. 1088type EventBatchRecordFailure struct { 1089 // FailureCause: The cause for the update failure. 1090 // Possible values are: 1091 // - "TOO_LARGE": A batch request was issued with more events than are 1092 // allowed in a single batch. 1093 // - "TIME_PERIOD_EXPIRED": A batch was sent with data too far in the 1094 // past to record. 1095 // - "TIME_PERIOD_SHORT": A batch was sent with a time range that was 1096 // too short. 1097 // - "TIME_PERIOD_LONG": A batch was sent with a time range that was too 1098 // long. 1099 // - "ALREADY_UPDATED": An attempt was made to record a batch of data 1100 // which was already seen. 1101 // - "RECORD_RATE_HIGH": An attempt was made to record data faster than 1102 // the server will apply updates. 1103 FailureCause string `json:"failureCause,omitempty"` 1104 1105 // Kind: Uniquely identifies the type of this resource. Value is always 1106 // the fixed string games#eventBatchRecordFailure. 1107 Kind string `json:"kind,omitempty"` 1108 1109 // Range: The time range which was rejected; empty for a request-wide 1110 // failure. 1111 Range *EventPeriodRange `json:"range,omitempty"` 1112 1113 // ForceSendFields is a list of field names (e.g. "FailureCause") to 1114 // unconditionally include in API requests. By default, fields with 1115 // empty values are omitted from API requests. However, any non-pointer, 1116 // non-interface field appearing in ForceSendFields will be sent to the 1117 // server regardless of whether the field is empty or not. This may be 1118 // used to include empty fields in Patch requests. 1119 ForceSendFields []string `json:"-"` 1120 1121 // NullFields is a list of field names (e.g. "FailureCause") to include 1122 // in API requests with the JSON null value. By default, fields with 1123 // empty values are omitted from API requests. However, any field with 1124 // an empty value appearing in NullFields will be sent to the server as 1125 // null. It is an error if a field in this list has a non-empty value. 1126 // This may be used to include null fields in Patch requests. 1127 NullFields []string `json:"-"` 1128} 1129 1130func (s *EventBatchRecordFailure) MarshalJSON() ([]byte, error) { 1131 type NoMethod EventBatchRecordFailure 1132 raw := NoMethod(*s) 1133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1134} 1135 1136// EventChild: This is a JSON template for an event child relationship 1137// resource. 1138type EventChild struct { 1139 // ChildId: The ID of the child event. 1140 ChildId string `json:"childId,omitempty"` 1141 1142 // Kind: Uniquely identifies the type of this resource. Value is always 1143 // the fixed string games#eventChild. 1144 Kind string `json:"kind,omitempty"` 1145 1146 // ForceSendFields is a list of field names (e.g. "ChildId") to 1147 // unconditionally include in API requests. By default, fields with 1148 // empty values are omitted from API requests. However, any non-pointer, 1149 // non-interface field appearing in ForceSendFields will be sent to the 1150 // server regardless of whether the field is empty or not. This may be 1151 // used to include empty fields in Patch requests. 1152 ForceSendFields []string `json:"-"` 1153 1154 // NullFields is a list of field names (e.g. "ChildId") to include in 1155 // API requests with the JSON null value. By default, fields with empty 1156 // values are omitted from API requests. However, any field with an 1157 // empty value appearing in NullFields will be sent to the server as 1158 // null. It is an error if a field in this list has a non-empty value. 1159 // This may be used to include null fields in Patch requests. 1160 NullFields []string `json:"-"` 1161} 1162 1163func (s *EventChild) MarshalJSON() ([]byte, error) { 1164 type NoMethod EventChild 1165 raw := NoMethod(*s) 1166 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1167} 1168 1169// EventDefinition: This is a JSON template for an event definition 1170// resource. 1171type EventDefinition struct { 1172 // ChildEvents: A list of events that are a child of this event. 1173 ChildEvents []*EventChild `json:"childEvents,omitempty"` 1174 1175 // Description: Description of what this event represents. 1176 Description string `json:"description,omitempty"` 1177 1178 // DisplayName: The name to display for the event. 1179 DisplayName string `json:"displayName,omitempty"` 1180 1181 // Id: The ID of the event. 1182 Id string `json:"id,omitempty"` 1183 1184 // ImageUrl: The base URL for the image that represents the event. 1185 ImageUrl string `json:"imageUrl,omitempty"` 1186 1187 // IsDefaultImageUrl: Indicates whether the icon image being returned is 1188 // a default image, or is game-provided. 1189 IsDefaultImageUrl bool `json:"isDefaultImageUrl,omitempty"` 1190 1191 // Kind: Uniquely identifies the type of this resource. Value is always 1192 // the fixed string games#eventDefinition. 1193 Kind string `json:"kind,omitempty"` 1194 1195 // Visibility: The visibility of event being tracked in this 1196 // definition. 1197 // Possible values are: 1198 // - "REVEALED": This event should be visible to all users. 1199 // - "HIDDEN": This event should only be shown to users that have 1200 // recorded this event at least once. 1201 Visibility string `json:"visibility,omitempty"` 1202 1203 // ForceSendFields is a list of field names (e.g. "ChildEvents") to 1204 // unconditionally include in API requests. By default, fields with 1205 // empty values are omitted from API requests. However, any non-pointer, 1206 // non-interface field appearing in ForceSendFields will be sent to the 1207 // server regardless of whether the field is empty or not. This may be 1208 // used to include empty fields in Patch requests. 1209 ForceSendFields []string `json:"-"` 1210 1211 // NullFields is a list of field names (e.g. "ChildEvents") to include 1212 // in API requests with the JSON null value. By default, fields with 1213 // empty values are omitted from API requests. However, any field with 1214 // an empty value appearing in NullFields will be sent to the server as 1215 // null. It is an error if a field in this list has a non-empty value. 1216 // This may be used to include null fields in Patch requests. 1217 NullFields []string `json:"-"` 1218} 1219 1220func (s *EventDefinition) MarshalJSON() ([]byte, error) { 1221 type NoMethod EventDefinition 1222 raw := NoMethod(*s) 1223 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1224} 1225 1226// EventDefinitionListResponse: This is a JSON template for a 1227// ListDefinitions response. 1228type EventDefinitionListResponse struct { 1229 // Items: The event definitions. 1230 Items []*EventDefinition `json:"items,omitempty"` 1231 1232 // Kind: Uniquely identifies the type of this resource. Value is always 1233 // the fixed string games#eventDefinitionListResponse. 1234 Kind string `json:"kind,omitempty"` 1235 1236 // NextPageToken: The pagination token for the next page of results. 1237 NextPageToken string `json:"nextPageToken,omitempty"` 1238 1239 // ServerResponse contains the HTTP response code and headers from the 1240 // server. 1241 googleapi.ServerResponse `json:"-"` 1242 1243 // ForceSendFields is a list of field names (e.g. "Items") to 1244 // unconditionally include in API requests. By default, fields with 1245 // empty values are omitted from API requests. However, any non-pointer, 1246 // non-interface field appearing in ForceSendFields will be sent to the 1247 // server regardless of whether the field is empty or not. This may be 1248 // used to include empty fields in Patch requests. 1249 ForceSendFields []string `json:"-"` 1250 1251 // NullFields is a list of field names (e.g. "Items") to include in API 1252 // requests with the JSON null value. By default, fields with empty 1253 // values are omitted from API requests. However, any field with an 1254 // empty value appearing in NullFields will be sent to the server as 1255 // null. It is an error if a field in this list has a non-empty value. 1256 // This may be used to include null fields in Patch requests. 1257 NullFields []string `json:"-"` 1258} 1259 1260func (s *EventDefinitionListResponse) MarshalJSON() ([]byte, error) { 1261 type NoMethod EventDefinitionListResponse 1262 raw := NoMethod(*s) 1263 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1264} 1265 1266// EventPeriodRange: This is a JSON template for an event period time 1267// range. 1268type EventPeriodRange struct { 1269 // Kind: Uniquely identifies the type of this resource. Value is always 1270 // the fixed string games#eventPeriodRange. 1271 Kind string `json:"kind,omitempty"` 1272 1273 // PeriodEndMillis: The time when this update period ends, in millis, 1274 // since 1970 UTC (Unix Epoch). 1275 PeriodEndMillis int64 `json:"periodEndMillis,omitempty,string"` 1276 1277 // PeriodStartMillis: The time when this update period begins, in 1278 // millis, since 1970 UTC (Unix Epoch). 1279 PeriodStartMillis int64 `json:"periodStartMillis,omitempty,string"` 1280 1281 // ForceSendFields is a list of field names (e.g. "Kind") to 1282 // unconditionally include in API requests. By default, fields with 1283 // empty values are omitted from API requests. However, any non-pointer, 1284 // non-interface field appearing in ForceSendFields will be sent to the 1285 // server regardless of whether the field is empty or not. This may be 1286 // used to include empty fields in Patch requests. 1287 ForceSendFields []string `json:"-"` 1288 1289 // NullFields is a list of field names (e.g. "Kind") to include in API 1290 // requests with the JSON null value. By default, fields with empty 1291 // values are omitted from API requests. However, any field with an 1292 // empty value appearing in NullFields will be sent to the server as 1293 // null. It is an error if a field in this list has a non-empty value. 1294 // This may be used to include null fields in Patch requests. 1295 NullFields []string `json:"-"` 1296} 1297 1298func (s *EventPeriodRange) MarshalJSON() ([]byte, error) { 1299 type NoMethod EventPeriodRange 1300 raw := NoMethod(*s) 1301 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1302} 1303 1304// EventPeriodUpdate: This is a JSON template for an event period update 1305// resource. 1306type EventPeriodUpdate struct { 1307 // Kind: Uniquely identifies the type of this resource. Value is always 1308 // the fixed string games#eventPeriodUpdate. 1309 Kind string `json:"kind,omitempty"` 1310 1311 // TimePeriod: The time period being covered by this update. 1312 TimePeriod *EventPeriodRange `json:"timePeriod,omitempty"` 1313 1314 // Updates: The updates being made for this time period. 1315 Updates []*EventUpdateRequest `json:"updates,omitempty"` 1316 1317 // ForceSendFields is a list of field names (e.g. "Kind") to 1318 // unconditionally include in API requests. By default, fields with 1319 // empty values are omitted from API requests. However, any non-pointer, 1320 // non-interface field appearing in ForceSendFields will be sent to the 1321 // server regardless of whether the field is empty or not. This may be 1322 // used to include empty fields in Patch requests. 1323 ForceSendFields []string `json:"-"` 1324 1325 // NullFields is a list of field names (e.g. "Kind") to include in API 1326 // requests with the JSON null value. By default, fields with empty 1327 // values are omitted from API requests. However, any field with an 1328 // empty value appearing in NullFields will be sent to the server as 1329 // null. It is an error if a field in this list has a non-empty value. 1330 // This may be used to include null fields in Patch requests. 1331 NullFields []string `json:"-"` 1332} 1333 1334func (s *EventPeriodUpdate) MarshalJSON() ([]byte, error) { 1335 type NoMethod EventPeriodUpdate 1336 raw := NoMethod(*s) 1337 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1338} 1339 1340// EventRecordFailure: This is a JSON template for an event update 1341// failure resource. 1342type EventRecordFailure struct { 1343 // EventId: The ID of the event that was not updated. 1344 EventId string `json:"eventId,omitempty"` 1345 1346 // FailureCause: The cause for the update failure. 1347 // Possible values are: 1348 // - "NOT_FOUND" - An attempt was made to set an event that was not 1349 // defined. 1350 // - "INVALID_UPDATE_VALUE" - An attempt was made to increment an event 1351 // by a non-positive value. 1352 FailureCause string `json:"failureCause,omitempty"` 1353 1354 // Kind: Uniquely identifies the type of this resource. Value is always 1355 // the fixed string games#eventRecordFailure. 1356 Kind string `json:"kind,omitempty"` 1357 1358 // ForceSendFields is a list of field names (e.g. "EventId") to 1359 // unconditionally include in API requests. By default, fields with 1360 // empty values are omitted from API requests. However, any non-pointer, 1361 // non-interface field appearing in ForceSendFields will be sent to the 1362 // server regardless of whether the field is empty or not. This may be 1363 // used to include empty fields in Patch requests. 1364 ForceSendFields []string `json:"-"` 1365 1366 // NullFields is a list of field names (e.g. "EventId") to include in 1367 // API requests with the JSON null value. By default, fields with empty 1368 // values are omitted from API requests. However, any field with an 1369 // empty value appearing in NullFields will be sent to the server as 1370 // null. It is an error if a field in this list has a non-empty value. 1371 // This may be used to include null fields in Patch requests. 1372 NullFields []string `json:"-"` 1373} 1374 1375func (s *EventRecordFailure) MarshalJSON() ([]byte, error) { 1376 type NoMethod EventRecordFailure 1377 raw := NoMethod(*s) 1378 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1379} 1380 1381// EventRecordRequest: This is a JSON template for an event period 1382// update resource. 1383type EventRecordRequest struct { 1384 // CurrentTimeMillis: The current time when this update was sent, in 1385 // milliseconds, since 1970 UTC (Unix Epoch). 1386 CurrentTimeMillis int64 `json:"currentTimeMillis,omitempty,string"` 1387 1388 // Kind: Uniquely identifies the type of this resource. Value is always 1389 // the fixed string games#eventRecordRequest. 1390 Kind string `json:"kind,omitempty"` 1391 1392 // RequestId: The request ID used to identify this attempt to record 1393 // events. 1394 RequestId int64 `json:"requestId,omitempty,string"` 1395 1396 // TimePeriods: A list of the time period updates being made in this 1397 // request. 1398 TimePeriods []*EventPeriodUpdate `json:"timePeriods,omitempty"` 1399 1400 // ForceSendFields is a list of field names (e.g. "CurrentTimeMillis") 1401 // to unconditionally include in API requests. By default, fields with 1402 // empty values are omitted from API requests. However, any non-pointer, 1403 // non-interface field appearing in ForceSendFields will be sent to the 1404 // server regardless of whether the field is empty or not. This may be 1405 // used to include empty fields in Patch requests. 1406 ForceSendFields []string `json:"-"` 1407 1408 // NullFields is a list of field names (e.g. "CurrentTimeMillis") to 1409 // include in API requests with the JSON null value. By default, fields 1410 // with empty values are omitted from API requests. However, any field 1411 // with an empty value appearing in NullFields will be sent to the 1412 // server as null. It is an error if a field in this list has a 1413 // non-empty value. This may be used to include null fields in Patch 1414 // requests. 1415 NullFields []string `json:"-"` 1416} 1417 1418func (s *EventRecordRequest) MarshalJSON() ([]byte, error) { 1419 type NoMethod EventRecordRequest 1420 raw := NoMethod(*s) 1421 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1422} 1423 1424// EventUpdateRequest: This is a JSON template for an event period 1425// update resource. 1426type EventUpdateRequest struct { 1427 // DefinitionId: The ID of the event being modified in this update. 1428 DefinitionId string `json:"definitionId,omitempty"` 1429 1430 // Kind: Uniquely identifies the type of this resource. Value is always 1431 // the fixed string games#eventUpdateRequest. 1432 Kind string `json:"kind,omitempty"` 1433 1434 // UpdateCount: The number of times this event occurred in this time 1435 // period. 1436 UpdateCount int64 `json:"updateCount,omitempty,string"` 1437 1438 // ForceSendFields is a list of field names (e.g. "DefinitionId") to 1439 // unconditionally include in API requests. By default, fields with 1440 // empty values are omitted from API requests. However, any non-pointer, 1441 // non-interface field appearing in ForceSendFields will be sent to the 1442 // server regardless of whether the field is empty or not. This may be 1443 // used to include empty fields in Patch requests. 1444 ForceSendFields []string `json:"-"` 1445 1446 // NullFields is a list of field names (e.g. "DefinitionId") to include 1447 // in API requests with the JSON null value. By default, fields with 1448 // empty values are omitted from API requests. However, any field with 1449 // an empty value appearing in NullFields will be sent to the server as 1450 // null. It is an error if a field in this list has a non-empty value. 1451 // This may be used to include null fields in Patch requests. 1452 NullFields []string `json:"-"` 1453} 1454 1455func (s *EventUpdateRequest) MarshalJSON() ([]byte, error) { 1456 type NoMethod EventUpdateRequest 1457 raw := NoMethod(*s) 1458 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1459} 1460 1461// EventUpdateResponse: This is a JSON template for an event period 1462// update resource. 1463type EventUpdateResponse struct { 1464 // BatchFailures: Any batch-wide failures which occurred applying 1465 // updates. 1466 BatchFailures []*EventBatchRecordFailure `json:"batchFailures,omitempty"` 1467 1468 // EventFailures: Any failures updating a particular event. 1469 EventFailures []*EventRecordFailure `json:"eventFailures,omitempty"` 1470 1471 // Kind: Uniquely identifies the type of this resource. Value is always 1472 // the fixed string games#eventUpdateResponse. 1473 Kind string `json:"kind,omitempty"` 1474 1475 // PlayerEvents: The current status of any updated events 1476 PlayerEvents []*PlayerEvent `json:"playerEvents,omitempty"` 1477 1478 // ServerResponse contains the HTTP response code and headers from the 1479 // server. 1480 googleapi.ServerResponse `json:"-"` 1481 1482 // ForceSendFields is a list of field names (e.g. "BatchFailures") to 1483 // unconditionally include in API requests. By default, fields with 1484 // empty values are omitted from API requests. However, any non-pointer, 1485 // non-interface field appearing in ForceSendFields will be sent to the 1486 // server regardless of whether the field is empty or not. This may be 1487 // used to include empty fields in Patch requests. 1488 ForceSendFields []string `json:"-"` 1489 1490 // NullFields is a list of field names (e.g. "BatchFailures") to include 1491 // in API requests with the JSON null value. By default, fields with 1492 // empty values are omitted from API requests. However, any field with 1493 // an empty value appearing in NullFields will be sent to the server as 1494 // null. It is an error if a field in this list has a non-empty value. 1495 // This may be used to include null fields in Patch requests. 1496 NullFields []string `json:"-"` 1497} 1498 1499func (s *EventUpdateResponse) MarshalJSON() ([]byte, error) { 1500 type NoMethod EventUpdateResponse 1501 raw := NoMethod(*s) 1502 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1503} 1504 1505// GamesAchievementIncrement: This is a JSON template for the payload to 1506// request to increment an achievement. 1507type GamesAchievementIncrement struct { 1508 // Kind: Uniquely identifies the type of this resource. Value is always 1509 // the fixed string games#GamesAchievementIncrement. 1510 Kind string `json:"kind,omitempty"` 1511 1512 // RequestId: The requestId associated with an increment to an 1513 // achievement. 1514 RequestId int64 `json:"requestId,omitempty,string"` 1515 1516 // Steps: The number of steps to be incremented. 1517 Steps int64 `json:"steps,omitempty"` 1518 1519 // ForceSendFields is a list of field names (e.g. "Kind") to 1520 // unconditionally include in API requests. By default, fields with 1521 // empty values are omitted from API requests. However, any non-pointer, 1522 // non-interface field appearing in ForceSendFields will be sent to the 1523 // server regardless of whether the field is empty or not. This may be 1524 // used to include empty fields in Patch requests. 1525 ForceSendFields []string `json:"-"` 1526 1527 // NullFields is a list of field names (e.g. "Kind") to include in API 1528 // requests with the JSON null value. By default, fields with empty 1529 // values are omitted from API requests. However, any field with an 1530 // empty value appearing in NullFields will be sent to the server as 1531 // null. It is an error if a field in this list has a non-empty value. 1532 // This may be used to include null fields in Patch requests. 1533 NullFields []string `json:"-"` 1534} 1535 1536func (s *GamesAchievementIncrement) MarshalJSON() ([]byte, error) { 1537 type NoMethod GamesAchievementIncrement 1538 raw := NoMethod(*s) 1539 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1540} 1541 1542// GamesAchievementSetStepsAtLeast: This is a JSON template for the 1543// payload to request to increment an achievement. 1544type GamesAchievementSetStepsAtLeast struct { 1545 // Kind: Uniquely identifies the type of this resource. Value is always 1546 // the fixed string games#GamesAchievementSetStepsAtLeast. 1547 Kind string `json:"kind,omitempty"` 1548 1549 // Steps: The minimum number of steps for the achievement to be set to. 1550 Steps int64 `json:"steps,omitempty"` 1551 1552 // ForceSendFields is a list of field names (e.g. "Kind") to 1553 // unconditionally include in API requests. By default, fields with 1554 // empty values are omitted from API requests. However, any non-pointer, 1555 // non-interface field appearing in ForceSendFields will be sent to the 1556 // server regardless of whether the field is empty or not. This may be 1557 // used to include empty fields in Patch requests. 1558 ForceSendFields []string `json:"-"` 1559 1560 // NullFields is a list of field names (e.g. "Kind") to include in API 1561 // requests with the JSON null value. By default, fields with empty 1562 // values are omitted from API requests. However, any field with an 1563 // empty value appearing in NullFields will be sent to the server as 1564 // null. It is an error if a field in this list has a non-empty value. 1565 // This may be used to include null fields in Patch requests. 1566 NullFields []string `json:"-"` 1567} 1568 1569func (s *GamesAchievementSetStepsAtLeast) MarshalJSON() ([]byte, error) { 1570 type NoMethod GamesAchievementSetStepsAtLeast 1571 raw := NoMethod(*s) 1572 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1573} 1574 1575// ImageAsset: This is a JSON template for an image asset object. 1576type ImageAsset struct { 1577 // Height: The height of the asset. 1578 Height int64 `json:"height,omitempty"` 1579 1580 // Kind: Uniquely identifies the type of this resource. Value is always 1581 // the fixed string games#imageAsset. 1582 Kind string `json:"kind,omitempty"` 1583 1584 // Name: The name of the asset. 1585 Name string `json:"name,omitempty"` 1586 1587 // Url: The URL of the asset. 1588 Url string `json:"url,omitempty"` 1589 1590 // Width: The width of the asset. 1591 Width int64 `json:"width,omitempty"` 1592 1593 // ForceSendFields is a list of field names (e.g. "Height") to 1594 // unconditionally include in API requests. By default, fields with 1595 // empty values are omitted from API requests. However, any non-pointer, 1596 // non-interface field appearing in ForceSendFields will be sent to the 1597 // server regardless of whether the field is empty or not. This may be 1598 // used to include empty fields in Patch requests. 1599 ForceSendFields []string `json:"-"` 1600 1601 // NullFields is a list of field names (e.g. "Height") to include in API 1602 // requests with the JSON null value. By default, fields with empty 1603 // values are omitted from API requests. However, any field with an 1604 // empty value appearing in NullFields will be sent to the server as 1605 // null. It is an error if a field in this list has a non-empty value. 1606 // This may be used to include null fields in Patch requests. 1607 NullFields []string `json:"-"` 1608} 1609 1610func (s *ImageAsset) MarshalJSON() ([]byte, error) { 1611 type NoMethod ImageAsset 1612 raw := NoMethod(*s) 1613 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1614} 1615 1616// Instance: This is a JSON template for the Instance resource. 1617type Instance struct { 1618 // AcquisitionUri: URI which shows where a user can acquire this 1619 // instance. 1620 AcquisitionUri string `json:"acquisitionUri,omitempty"` 1621 1622 // AndroidInstance: Platform dependent details for Android. 1623 AndroidInstance *InstanceAndroidDetails `json:"androidInstance,omitempty"` 1624 1625 // IosInstance: Platform dependent details for iOS. 1626 IosInstance *InstanceIosDetails `json:"iosInstance,omitempty"` 1627 1628 // Kind: Uniquely identifies the type of this resource. Value is always 1629 // the fixed string games#instance. 1630 Kind string `json:"kind,omitempty"` 1631 1632 // Name: Localized display name. 1633 Name string `json:"name,omitempty"` 1634 1635 // PlatformType: The platform type. 1636 // Possible values are: 1637 // - "ANDROID" - Instance is for Android. 1638 // - "IOS" - Instance is for iOS 1639 // - "WEB_APP" - Instance is for Web App. 1640 PlatformType string `json:"platformType,omitempty"` 1641 1642 // RealtimePlay: Flag to show if this game instance supports realtime 1643 // play. 1644 RealtimePlay bool `json:"realtimePlay,omitempty"` 1645 1646 // TurnBasedPlay: Flag to show if this game instance supports turn based 1647 // play. 1648 TurnBasedPlay bool `json:"turnBasedPlay,omitempty"` 1649 1650 // WebInstance: Platform dependent details for Web. 1651 WebInstance *InstanceWebDetails `json:"webInstance,omitempty"` 1652 1653 // ForceSendFields is a list of field names (e.g. "AcquisitionUri") to 1654 // unconditionally include in API requests. By default, fields with 1655 // empty values are omitted from API requests. However, any non-pointer, 1656 // non-interface field appearing in ForceSendFields will be sent to the 1657 // server regardless of whether the field is empty or not. This may be 1658 // used to include empty fields in Patch requests. 1659 ForceSendFields []string `json:"-"` 1660 1661 // NullFields is a list of field names (e.g. "AcquisitionUri") to 1662 // include in API requests with the JSON null value. By default, fields 1663 // with empty values are omitted from API requests. However, any field 1664 // with an empty value appearing in NullFields will be sent to the 1665 // server as null. It is an error if a field in this list has a 1666 // non-empty value. This may be used to include null fields in Patch 1667 // requests. 1668 NullFields []string `json:"-"` 1669} 1670 1671func (s *Instance) MarshalJSON() ([]byte, error) { 1672 type NoMethod Instance 1673 raw := NoMethod(*s) 1674 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1675} 1676 1677// InstanceAndroidDetails: This is a JSON template for the Android 1678// instance details resource. 1679type InstanceAndroidDetails struct { 1680 // EnablePiracyCheck: Flag indicating whether the anti-piracy check is 1681 // enabled. 1682 EnablePiracyCheck bool `json:"enablePiracyCheck,omitempty"` 1683 1684 // Kind: Uniquely identifies the type of this resource. Value is always 1685 // the fixed string games#instanceAndroidDetails. 1686 Kind string `json:"kind,omitempty"` 1687 1688 // PackageName: Android package name which maps to Google Play URL. 1689 PackageName string `json:"packageName,omitempty"` 1690 1691 // Preferred: Indicates that this instance is the default for new 1692 // installations. 1693 Preferred bool `json:"preferred,omitempty"` 1694 1695 // ForceSendFields is a list of field names (e.g. "EnablePiracyCheck") 1696 // to unconditionally include in API requests. By default, fields with 1697 // empty values are omitted from API requests. However, any non-pointer, 1698 // non-interface field appearing in ForceSendFields will be sent to the 1699 // server regardless of whether the field is empty or not. This may be 1700 // used to include empty fields in Patch requests. 1701 ForceSendFields []string `json:"-"` 1702 1703 // NullFields is a list of field names (e.g. "EnablePiracyCheck") to 1704 // include in API requests with the JSON null value. By default, fields 1705 // with empty values are omitted from API requests. However, any field 1706 // with an empty value appearing in NullFields will be sent to the 1707 // server as null. It is an error if a field in this list has a 1708 // non-empty value. This may be used to include null fields in Patch 1709 // requests. 1710 NullFields []string `json:"-"` 1711} 1712 1713func (s *InstanceAndroidDetails) MarshalJSON() ([]byte, error) { 1714 type NoMethod InstanceAndroidDetails 1715 raw := NoMethod(*s) 1716 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1717} 1718 1719// InstanceIosDetails: This is a JSON template for the iOS details 1720// resource. 1721type InstanceIosDetails struct { 1722 // BundleIdentifier: Bundle identifier. 1723 BundleIdentifier string `json:"bundleIdentifier,omitempty"` 1724 1725 // ItunesAppId: iTunes App ID. 1726 ItunesAppId string `json:"itunesAppId,omitempty"` 1727 1728 // Kind: Uniquely identifies the type of this resource. Value is always 1729 // the fixed string games#instanceIosDetails. 1730 Kind string `json:"kind,omitempty"` 1731 1732 // PreferredForIpad: Indicates that this instance is the default for new 1733 // installations on iPad devices. 1734 PreferredForIpad bool `json:"preferredForIpad,omitempty"` 1735 1736 // PreferredForIphone: Indicates that this instance is the default for 1737 // new installations on iPhone devices. 1738 PreferredForIphone bool `json:"preferredForIphone,omitempty"` 1739 1740 // SupportIpad: Flag to indicate if this instance supports iPad. 1741 SupportIpad bool `json:"supportIpad,omitempty"` 1742 1743 // SupportIphone: Flag to indicate if this instance supports iPhone. 1744 SupportIphone bool `json:"supportIphone,omitempty"` 1745 1746 // ForceSendFields is a list of field names (e.g. "BundleIdentifier") to 1747 // unconditionally include in API requests. By default, fields with 1748 // empty values are omitted from API requests. However, any non-pointer, 1749 // non-interface field appearing in ForceSendFields will be sent to the 1750 // server regardless of whether the field is empty or not. This may be 1751 // used to include empty fields in Patch requests. 1752 ForceSendFields []string `json:"-"` 1753 1754 // NullFields is a list of field names (e.g. "BundleIdentifier") to 1755 // include in API requests with the JSON null value. By default, fields 1756 // with empty values are omitted from API requests. However, any field 1757 // with an empty value appearing in NullFields will be sent to the 1758 // server as null. It is an error if a field in this list has a 1759 // non-empty value. This may be used to include null fields in Patch 1760 // requests. 1761 NullFields []string `json:"-"` 1762} 1763 1764func (s *InstanceIosDetails) MarshalJSON() ([]byte, error) { 1765 type NoMethod InstanceIosDetails 1766 raw := NoMethod(*s) 1767 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1768} 1769 1770// InstanceWebDetails: This is a JSON template for the Web details 1771// resource. 1772type InstanceWebDetails struct { 1773 // Kind: Uniquely identifies the type of this resource. Value is always 1774 // the fixed string games#instanceWebDetails. 1775 Kind string `json:"kind,omitempty"` 1776 1777 // LaunchUrl: Launch URL for the game. 1778 LaunchUrl string `json:"launchUrl,omitempty"` 1779 1780 // Preferred: Indicates that this instance is the default for new 1781 // installations. 1782 Preferred bool `json:"preferred,omitempty"` 1783 1784 // ForceSendFields is a list of field names (e.g. "Kind") to 1785 // unconditionally include in API requests. By default, fields with 1786 // empty values are omitted from API requests. However, any non-pointer, 1787 // non-interface field appearing in ForceSendFields will be sent to the 1788 // server regardless of whether the field is empty or not. This may be 1789 // used to include empty fields in Patch requests. 1790 ForceSendFields []string `json:"-"` 1791 1792 // NullFields is a list of field names (e.g. "Kind") to include in API 1793 // requests with the JSON null value. By default, fields with empty 1794 // values are omitted from API requests. However, any field with an 1795 // empty value appearing in NullFields will be sent to the server as 1796 // null. It is an error if a field in this list has a non-empty value. 1797 // This may be used to include null fields in Patch requests. 1798 NullFields []string `json:"-"` 1799} 1800 1801func (s *InstanceWebDetails) MarshalJSON() ([]byte, error) { 1802 type NoMethod InstanceWebDetails 1803 raw := NoMethod(*s) 1804 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1805} 1806 1807// Leaderboard: This is a JSON template for the Leaderboard resource. 1808type Leaderboard struct { 1809 // IconUrl: The icon for the leaderboard. 1810 IconUrl string `json:"iconUrl,omitempty"` 1811 1812 // Id: The leaderboard ID. 1813 Id string `json:"id,omitempty"` 1814 1815 // IsIconUrlDefault: Indicates whether the icon image being returned is 1816 // a default image, or is game-provided. 1817 IsIconUrlDefault bool `json:"isIconUrlDefault,omitempty"` 1818 1819 // Kind: Uniquely identifies the type of this resource. Value is always 1820 // the fixed string games#leaderboard. 1821 Kind string `json:"kind,omitempty"` 1822 1823 // Name: The name of the leaderboard. 1824 Name string `json:"name,omitempty"` 1825 1826 // Order: How scores are ordered. 1827 // Possible values are: 1828 // - "LARGER_IS_BETTER" - Larger values are better; scores are sorted in 1829 // descending order. 1830 // - "SMALLER_IS_BETTER" - Smaller values are better; scores are sorted 1831 // in ascending order. 1832 Order string `json:"order,omitempty"` 1833 1834 // ServerResponse contains the HTTP response code and headers from the 1835 // server. 1836 googleapi.ServerResponse `json:"-"` 1837 1838 // ForceSendFields is a list of field names (e.g. "IconUrl") to 1839 // unconditionally include in API requests. By default, fields with 1840 // empty values are omitted from API requests. However, any non-pointer, 1841 // non-interface field appearing in ForceSendFields will be sent to the 1842 // server regardless of whether the field is empty or not. This may be 1843 // used to include empty fields in Patch requests. 1844 ForceSendFields []string `json:"-"` 1845 1846 // NullFields is a list of field names (e.g. "IconUrl") to include in 1847 // API requests with the JSON null value. By default, fields with empty 1848 // values are omitted from API requests. However, any field with an 1849 // empty value appearing in NullFields will be sent to the server as 1850 // null. It is an error if a field in this list has a non-empty value. 1851 // This may be used to include null fields in Patch requests. 1852 NullFields []string `json:"-"` 1853} 1854 1855func (s *Leaderboard) MarshalJSON() ([]byte, error) { 1856 type NoMethod Leaderboard 1857 raw := NoMethod(*s) 1858 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1859} 1860 1861// LeaderboardEntry: This is a JSON template for the Leaderboard Entry 1862// resource. 1863type LeaderboardEntry struct { 1864 // FormattedScore: The localized string for the numerical value of this 1865 // score. 1866 FormattedScore string `json:"formattedScore,omitempty"` 1867 1868 // FormattedScoreRank: The localized string for the rank of this score 1869 // for this leaderboard. 1870 FormattedScoreRank string `json:"formattedScoreRank,omitempty"` 1871 1872 // Kind: Uniquely identifies the type of this resource. Value is always 1873 // the fixed string games#leaderboardEntry. 1874 Kind string `json:"kind,omitempty"` 1875 1876 // Player: The player who holds this score. 1877 Player *Player `json:"player,omitempty"` 1878 1879 // ScoreRank: The rank of this score for this leaderboard. 1880 ScoreRank int64 `json:"scoreRank,omitempty,string"` 1881 1882 // ScoreTag: Additional information about the score. Values must contain 1883 // no more than 64 URI-safe characters as defined by section 2.3 of RFC 1884 // 3986. 1885 ScoreTag string `json:"scoreTag,omitempty"` 1886 1887 // ScoreValue: The numerical value of this score. 1888 ScoreValue int64 `json:"scoreValue,omitempty,string"` 1889 1890 // TimeSpan: The time span of this high score. 1891 // Possible values are: 1892 // - "ALL_TIME" - The score is an all-time high score. 1893 // - "WEEKLY" - The score is a weekly high score. 1894 // - "DAILY" - The score is a daily high score. 1895 TimeSpan string `json:"timeSpan,omitempty"` 1896 1897 // WriteTimestampMillis: The timestamp at which this score was recorded, 1898 // in milliseconds since the epoch in UTC. 1899 WriteTimestampMillis int64 `json:"writeTimestampMillis,omitempty,string"` 1900 1901 // ForceSendFields is a list of field names (e.g. "FormattedScore") to 1902 // unconditionally include in API requests. By default, fields with 1903 // empty values are omitted from API requests. However, any non-pointer, 1904 // non-interface field appearing in ForceSendFields will be sent to the 1905 // server regardless of whether the field is empty or not. This may be 1906 // used to include empty fields in Patch requests. 1907 ForceSendFields []string `json:"-"` 1908 1909 // NullFields is a list of field names (e.g. "FormattedScore") to 1910 // include in API requests with the JSON null value. By default, fields 1911 // with empty values are omitted from API requests. However, any field 1912 // with an empty value appearing in NullFields will be sent to the 1913 // server as null. It is an error if a field in this list has a 1914 // non-empty value. This may be used to include null fields in Patch 1915 // requests. 1916 NullFields []string `json:"-"` 1917} 1918 1919func (s *LeaderboardEntry) MarshalJSON() ([]byte, error) { 1920 type NoMethod LeaderboardEntry 1921 raw := NoMethod(*s) 1922 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1923} 1924 1925// LeaderboardListResponse: This is a JSON template for a list of 1926// leaderboard objects. 1927type LeaderboardListResponse struct { 1928 // Items: The leaderboards. 1929 Items []*Leaderboard `json:"items,omitempty"` 1930 1931 // Kind: Uniquely identifies the type of this resource. Value is always 1932 // the fixed string games#leaderboardListResponse. 1933 Kind string `json:"kind,omitempty"` 1934 1935 // NextPageToken: Token corresponding to the next page of results. 1936 NextPageToken string `json:"nextPageToken,omitempty"` 1937 1938 // ServerResponse contains the HTTP response code and headers from the 1939 // server. 1940 googleapi.ServerResponse `json:"-"` 1941 1942 // ForceSendFields is a list of field names (e.g. "Items") to 1943 // unconditionally include in API requests. By default, fields with 1944 // empty values are omitted from API requests. However, any non-pointer, 1945 // non-interface field appearing in ForceSendFields will be sent to the 1946 // server regardless of whether the field is empty or not. This may be 1947 // used to include empty fields in Patch requests. 1948 ForceSendFields []string `json:"-"` 1949 1950 // NullFields is a list of field names (e.g. "Items") to include in API 1951 // requests with the JSON null value. By default, fields with empty 1952 // values are omitted from API requests. However, any field with an 1953 // empty value appearing in NullFields will be sent to the server as 1954 // null. It is an error if a field in this list has a non-empty value. 1955 // This may be used to include null fields in Patch requests. 1956 NullFields []string `json:"-"` 1957} 1958 1959func (s *LeaderboardListResponse) MarshalJSON() ([]byte, error) { 1960 type NoMethod LeaderboardListResponse 1961 raw := NoMethod(*s) 1962 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1963} 1964 1965// LeaderboardScoreRank: This is a JSON template for a score rank in a 1966// leaderboard. 1967type LeaderboardScoreRank struct { 1968 // FormattedNumScores: The number of scores in the leaderboard as a 1969 // string. 1970 FormattedNumScores string `json:"formattedNumScores,omitempty"` 1971 1972 // FormattedRank: The rank in the leaderboard as a string. 1973 FormattedRank string `json:"formattedRank,omitempty"` 1974 1975 // Kind: Uniquely identifies the type of this resource. Value is always 1976 // the fixed string games#leaderboardScoreRank. 1977 Kind string `json:"kind,omitempty"` 1978 1979 // NumScores: The number of scores in the leaderboard. 1980 NumScores int64 `json:"numScores,omitempty,string"` 1981 1982 // Rank: The rank in the leaderboard. 1983 Rank int64 `json:"rank,omitempty,string"` 1984 1985 // ForceSendFields is a list of field names (e.g. "FormattedNumScores") 1986 // to unconditionally include in API requests. By default, fields with 1987 // empty values are omitted from API requests. However, any non-pointer, 1988 // non-interface field appearing in ForceSendFields will be sent to the 1989 // server regardless of whether the field is empty or not. This may be 1990 // used to include empty fields in Patch requests. 1991 ForceSendFields []string `json:"-"` 1992 1993 // NullFields is a list of field names (e.g. "FormattedNumScores") to 1994 // include in API requests with the JSON null value. By default, fields 1995 // with empty values are omitted from API requests. However, any field 1996 // with an empty value appearing in NullFields will be sent to the 1997 // server as null. It is an error if a field in this list has a 1998 // non-empty value. This may be used to include null fields in Patch 1999 // requests. 2000 NullFields []string `json:"-"` 2001} 2002 2003func (s *LeaderboardScoreRank) MarshalJSON() ([]byte, error) { 2004 type NoMethod LeaderboardScoreRank 2005 raw := NoMethod(*s) 2006 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2007} 2008 2009// LeaderboardScores: This is a JSON template for a ListScores response. 2010type LeaderboardScores struct { 2011 // Items: The scores in the leaderboard. 2012 Items []*LeaderboardEntry `json:"items,omitempty"` 2013 2014 // Kind: Uniquely identifies the type of this resource. Value is always 2015 // the fixed string games#leaderboardScores. 2016 Kind string `json:"kind,omitempty"` 2017 2018 // NextPageToken: The pagination token for the next page of results. 2019 NextPageToken string `json:"nextPageToken,omitempty"` 2020 2021 // NumScores: The total number of scores in the leaderboard. 2022 NumScores int64 `json:"numScores,omitempty,string"` 2023 2024 // PlayerScore: The score of the requesting player on the leaderboard. 2025 // The player's score may appear both here and in the list of scores 2026 // above. If you are viewing a public leaderboard and the player is not 2027 // sharing their gameplay information publicly, the scoreRank and 2028 // formattedScoreRank values will not be present. 2029 PlayerScore *LeaderboardEntry `json:"playerScore,omitempty"` 2030 2031 // PrevPageToken: The pagination token for the previous page of results. 2032 PrevPageToken string `json:"prevPageToken,omitempty"` 2033 2034 // ServerResponse contains the HTTP response code and headers from the 2035 // server. 2036 googleapi.ServerResponse `json:"-"` 2037 2038 // ForceSendFields is a list of field names (e.g. "Items") to 2039 // unconditionally include in API requests. By default, fields with 2040 // empty values are omitted from API requests. However, any non-pointer, 2041 // non-interface field appearing in ForceSendFields will be sent to the 2042 // server regardless of whether the field is empty or not. This may be 2043 // used to include empty fields in Patch requests. 2044 ForceSendFields []string `json:"-"` 2045 2046 // NullFields is a list of field names (e.g. "Items") to include in API 2047 // requests with the JSON null value. By default, fields with empty 2048 // values are omitted from API requests. However, any field with an 2049 // empty value appearing in NullFields will be sent to the server as 2050 // null. It is an error if a field in this list has a non-empty value. 2051 // This may be used to include null fields in Patch requests. 2052 NullFields []string `json:"-"` 2053} 2054 2055func (s *LeaderboardScores) MarshalJSON() ([]byte, error) { 2056 type NoMethod LeaderboardScores 2057 raw := NoMethod(*s) 2058 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2059} 2060 2061// MetagameConfig: This is a JSON template for the metagame config 2062// resource 2063type MetagameConfig struct { 2064 // CurrentVersion: Current version of the metagame configuration data. 2065 // When this data is updated, the version number will be increased by 2066 // one. 2067 CurrentVersion int64 `json:"currentVersion,omitempty"` 2068 2069 // Kind: Uniquely identifies the type of this resource. Value is always 2070 // the fixed string games#metagameConfig. 2071 Kind string `json:"kind,omitempty"` 2072 2073 // PlayerLevels: The list of player levels. 2074 PlayerLevels []*PlayerLevel `json:"playerLevels,omitempty"` 2075 2076 // ServerResponse contains the HTTP response code and headers from the 2077 // server. 2078 googleapi.ServerResponse `json:"-"` 2079 2080 // ForceSendFields is a list of field names (e.g. "CurrentVersion") to 2081 // unconditionally include in API requests. By default, fields with 2082 // empty values are omitted from API requests. However, any non-pointer, 2083 // non-interface field appearing in ForceSendFields will be sent to the 2084 // server regardless of whether the field is empty or not. This may be 2085 // used to include empty fields in Patch requests. 2086 ForceSendFields []string `json:"-"` 2087 2088 // NullFields is a list of field names (e.g. "CurrentVersion") to 2089 // include in API requests with the JSON null value. By default, fields 2090 // with empty values are omitted from API requests. However, any field 2091 // with an empty value appearing in NullFields will be sent to the 2092 // server as null. It is an error if a field in this list has a 2093 // non-empty value. This may be used to include null fields in Patch 2094 // requests. 2095 NullFields []string `json:"-"` 2096} 2097 2098func (s *MetagameConfig) MarshalJSON() ([]byte, error) { 2099 type NoMethod MetagameConfig 2100 raw := NoMethod(*s) 2101 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2102} 2103 2104// NetworkDiagnostics: This is a JSON template for network diagnostics 2105// reported for a client. 2106type NetworkDiagnostics struct { 2107 // AndroidNetworkSubtype: The Android network subtype. 2108 AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"` 2109 2110 // AndroidNetworkType: The Android network type. 2111 AndroidNetworkType int64 `json:"androidNetworkType,omitempty"` 2112 2113 // IosNetworkType: iOS network type as defined in Reachability.h. 2114 IosNetworkType int64 `json:"iosNetworkType,omitempty"` 2115 2116 // Kind: Uniquely identifies the type of this resource. Value is always 2117 // the fixed string games#networkDiagnostics. 2118 Kind string `json:"kind,omitempty"` 2119 2120 // NetworkOperatorCode: The MCC+MNC code for the client's network 2121 // connection. On Android: 2122 // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: 2123 // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html 2124 NetworkOperatorCode string `json:"networkOperatorCode,omitempty"` 2125 2126 // NetworkOperatorName: The name of the carrier of the client's network 2127 // connection. On Android: 2128 // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: 2129 // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName 2130 NetworkOperatorName string `json:"networkOperatorName,omitempty"` 2131 2132 // RegistrationLatencyMillis: The amount of time in milliseconds it took 2133 // for the client to establish a connection with the XMPP server. 2134 RegistrationLatencyMillis int64 `json:"registrationLatencyMillis,omitempty"` 2135 2136 // ForceSendFields is a list of field names (e.g. 2137 // "AndroidNetworkSubtype") to unconditionally include in API requests. 2138 // By default, fields with empty values are omitted from API requests. 2139 // However, any non-pointer, non-interface field appearing in 2140 // ForceSendFields will be sent to the server regardless of whether the 2141 // field is empty or not. This may be used to include empty fields in 2142 // Patch requests. 2143 ForceSendFields []string `json:"-"` 2144 2145 // NullFields is a list of field names (e.g. "AndroidNetworkSubtype") to 2146 // include in API requests with the JSON null value. By default, fields 2147 // with empty values are omitted from API requests. However, any field 2148 // with an empty value appearing in NullFields will be sent to the 2149 // server as null. It is an error if a field in this list has a 2150 // non-empty value. This may be used to include null fields in Patch 2151 // requests. 2152 NullFields []string `json:"-"` 2153} 2154 2155func (s *NetworkDiagnostics) MarshalJSON() ([]byte, error) { 2156 type NoMethod NetworkDiagnostics 2157 raw := NoMethod(*s) 2158 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2159} 2160 2161// ParticipantResult: This is a JSON template for a result for a match 2162// participant. 2163type ParticipantResult struct { 2164 // Kind: Uniquely identifies the type of this resource. Value is always 2165 // the fixed string games#participantResult. 2166 Kind string `json:"kind,omitempty"` 2167 2168 // ParticipantId: The ID of the participant. 2169 ParticipantId string `json:"participantId,omitempty"` 2170 2171 // Placing: The placement or ranking of the participant in the match 2172 // results; a number from one to the number of participants in the 2173 // match. Multiple participants may have the same placing value in case 2174 // of a type. 2175 Placing int64 `json:"placing,omitempty"` 2176 2177 // Result: The result of the participant for this match. 2178 // Possible values are: 2179 // - "MATCH_RESULT_WIN" - The participant won the match. 2180 // - "MATCH_RESULT_LOSS" - The participant lost the match. 2181 // - "MATCH_RESULT_TIE" - The participant tied the match. 2182 // - "MATCH_RESULT_NONE" - There was no winner for the match (nobody 2183 // wins or loses this kind of game.) 2184 // - "MATCH_RESULT_DISCONNECT" - The participant disconnected / left 2185 // during the match. 2186 // - "MATCH_RESULT_DISAGREED" - Different clients reported different 2187 // results for this participant. 2188 Result string `json:"result,omitempty"` 2189 2190 // ForceSendFields is a list of field names (e.g. "Kind") to 2191 // unconditionally include in API requests. By default, fields with 2192 // empty values are omitted from API requests. However, any non-pointer, 2193 // non-interface field appearing in ForceSendFields will be sent to the 2194 // server regardless of whether the field is empty or not. This may be 2195 // used to include empty fields in Patch requests. 2196 ForceSendFields []string `json:"-"` 2197 2198 // NullFields is a list of field names (e.g. "Kind") to include in API 2199 // requests with the JSON null value. By default, fields with empty 2200 // values are omitted from API requests. However, any field with an 2201 // empty value appearing in NullFields will be sent to the server as 2202 // null. It is an error if a field in this list has a non-empty value. 2203 // This may be used to include null fields in Patch requests. 2204 NullFields []string `json:"-"` 2205} 2206 2207func (s *ParticipantResult) MarshalJSON() ([]byte, error) { 2208 type NoMethod ParticipantResult 2209 raw := NoMethod(*s) 2210 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2211} 2212 2213// PeerChannelDiagnostics: This is a JSON template for peer channel 2214// diagnostics. 2215type PeerChannelDiagnostics struct { 2216 // BytesReceived: Number of bytes received. 2217 BytesReceived *AggregateStats `json:"bytesReceived,omitempty"` 2218 2219 // BytesSent: Number of bytes sent. 2220 BytesSent *AggregateStats `json:"bytesSent,omitempty"` 2221 2222 // Kind: Uniquely identifies the type of this resource. Value is always 2223 // the fixed string games#peerChannelDiagnostics. 2224 Kind string `json:"kind,omitempty"` 2225 2226 // NumMessagesLost: Number of messages lost. 2227 NumMessagesLost int64 `json:"numMessagesLost,omitempty"` 2228 2229 // NumMessagesReceived: Number of messages received. 2230 NumMessagesReceived int64 `json:"numMessagesReceived,omitempty"` 2231 2232 // NumMessagesSent: Number of messages sent. 2233 NumMessagesSent int64 `json:"numMessagesSent,omitempty"` 2234 2235 // NumSendFailures: Number of send failures. 2236 NumSendFailures int64 `json:"numSendFailures,omitempty"` 2237 2238 // RoundtripLatencyMillis: Roundtrip latency stats in milliseconds. 2239 RoundtripLatencyMillis *AggregateStats `json:"roundtripLatencyMillis,omitempty"` 2240 2241 // ForceSendFields is a list of field names (e.g. "BytesReceived") to 2242 // unconditionally include in API requests. By default, fields with 2243 // empty values are omitted from API requests. However, any non-pointer, 2244 // non-interface field appearing in ForceSendFields will be sent to the 2245 // server regardless of whether the field is empty or not. This may be 2246 // used to include empty fields in Patch requests. 2247 ForceSendFields []string `json:"-"` 2248 2249 // NullFields is a list of field names (e.g. "BytesReceived") to include 2250 // in API requests with the JSON null value. By default, fields with 2251 // empty values are omitted from API requests. However, any field with 2252 // an empty value appearing in NullFields will be sent to the server as 2253 // null. It is an error if a field in this list has a non-empty value. 2254 // This may be used to include null fields in Patch requests. 2255 NullFields []string `json:"-"` 2256} 2257 2258func (s *PeerChannelDiagnostics) MarshalJSON() ([]byte, error) { 2259 type NoMethod PeerChannelDiagnostics 2260 raw := NoMethod(*s) 2261 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2262} 2263 2264// PeerSessionDiagnostics: This is a JSON template for peer session 2265// diagnostics. 2266type PeerSessionDiagnostics struct { 2267 // ConnectedTimestampMillis: Connected time in milliseconds. 2268 ConnectedTimestampMillis int64 `json:"connectedTimestampMillis,omitempty,string"` 2269 2270 // Kind: Uniquely identifies the type of this resource. Value is always 2271 // the fixed string games#peerSessionDiagnostics. 2272 Kind string `json:"kind,omitempty"` 2273 2274 // ParticipantId: The participant ID of the peer. 2275 ParticipantId string `json:"participantId,omitempty"` 2276 2277 // ReliableChannel: Reliable channel diagnostics. 2278 ReliableChannel *PeerChannelDiagnostics `json:"reliableChannel,omitempty"` 2279 2280 // UnreliableChannel: Unreliable channel diagnostics. 2281 UnreliableChannel *PeerChannelDiagnostics `json:"unreliableChannel,omitempty"` 2282 2283 // ForceSendFields is a list of field names (e.g. 2284 // "ConnectedTimestampMillis") to unconditionally include in API 2285 // requests. By default, fields with empty values are omitted from API 2286 // requests. However, any non-pointer, non-interface field appearing in 2287 // ForceSendFields will be sent to the server regardless of whether the 2288 // field is empty or not. This may be used to include empty fields in 2289 // Patch requests. 2290 ForceSendFields []string `json:"-"` 2291 2292 // NullFields is a list of field names (e.g. "ConnectedTimestampMillis") 2293 // to include in API requests with the JSON null value. By default, 2294 // fields with empty values are omitted from API requests. However, any 2295 // field with an empty value appearing in NullFields will be sent to the 2296 // server as null. It is an error if a field in this list has a 2297 // non-empty value. This may be used to include null fields in Patch 2298 // requests. 2299 NullFields []string `json:"-"` 2300} 2301 2302func (s *PeerSessionDiagnostics) MarshalJSON() ([]byte, error) { 2303 type NoMethod PeerSessionDiagnostics 2304 raw := NoMethod(*s) 2305 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2306} 2307 2308// Played: This is a JSON template for metadata about a player playing a 2309// game with the currently authenticated user. 2310type Played struct { 2311 // AutoMatched: True if the player was auto-matched with the currently 2312 // authenticated user. 2313 AutoMatched bool `json:"autoMatched,omitempty"` 2314 2315 // Kind: Uniquely identifies the type of this resource. Value is always 2316 // the fixed string games#played. 2317 Kind string `json:"kind,omitempty"` 2318 2319 // TimeMillis: The last time the player played the game in milliseconds 2320 // since the epoch in UTC. 2321 TimeMillis int64 `json:"timeMillis,omitempty,string"` 2322 2323 // ForceSendFields is a list of field names (e.g. "AutoMatched") to 2324 // unconditionally include in API requests. By default, fields with 2325 // empty values are omitted from API requests. However, any non-pointer, 2326 // non-interface field appearing in ForceSendFields will be sent to the 2327 // server regardless of whether the field is empty or not. This may be 2328 // used to include empty fields in Patch requests. 2329 ForceSendFields []string `json:"-"` 2330 2331 // NullFields is a list of field names (e.g. "AutoMatched") to include 2332 // in API requests with the JSON null value. By default, fields with 2333 // empty values are omitted from API requests. However, any field with 2334 // an empty value appearing in NullFields will be sent to the server as 2335 // null. It is an error if a field in this list has a non-empty value. 2336 // This may be used to include null fields in Patch requests. 2337 NullFields []string `json:"-"` 2338} 2339 2340func (s *Played) MarshalJSON() ([]byte, error) { 2341 type NoMethod Played 2342 raw := NoMethod(*s) 2343 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2344} 2345 2346// Player: This is a JSON template for a Player resource. 2347type Player struct { 2348 // AvatarImageUrl: The base URL for the image that represents the 2349 // player. 2350 AvatarImageUrl string `json:"avatarImageUrl,omitempty"` 2351 2352 // BannerUrlLandscape: The url to the landscape mode player banner 2353 // image. 2354 BannerUrlLandscape string `json:"bannerUrlLandscape,omitempty"` 2355 2356 // BannerUrlPortrait: The url to the portrait mode player banner image. 2357 BannerUrlPortrait string `json:"bannerUrlPortrait,omitempty"` 2358 2359 // DisplayName: The name to display for the player. 2360 DisplayName string `json:"displayName,omitempty"` 2361 2362 // ExperienceInfo: An object to represent Play Game experience 2363 // information for the player. 2364 ExperienceInfo *PlayerExperienceInfo `json:"experienceInfo,omitempty"` 2365 2366 // Kind: Uniquely identifies the type of this resource. Value is always 2367 // the fixed string games#player. 2368 Kind string `json:"kind,omitempty"` 2369 2370 // LastPlayedWith: Details about the last time this player played a 2371 // multiplayer game with the currently authenticated player. Populated 2372 // for PLAYED_WITH player collection members. 2373 LastPlayedWith *Played `json:"lastPlayedWith,omitempty"` 2374 2375 // Name: An object representation of the individual components of the 2376 // player's name. For some players, these fields may not be present. 2377 Name *PlayerName `json:"name,omitempty"` 2378 2379 // OriginalPlayerId: The player ID that was used for this player the 2380 // first time they signed into the game in question. This is only 2381 // populated for calls to player.get for the requesting player, only if 2382 // the player ID has subsequently changed, and only to clients that 2383 // support remapping player IDs. 2384 OriginalPlayerId string `json:"originalPlayerId,omitempty"` 2385 2386 // PlayerId: The ID of the player. 2387 PlayerId string `json:"playerId,omitempty"` 2388 2389 // ProfileSettings: The player's profile settings. Controls whether or 2390 // not the player's profile is visible to other players. 2391 ProfileSettings *ProfileSettings `json:"profileSettings,omitempty"` 2392 2393 // Title: The player's title rewarded for their game activities. 2394 Title string `json:"title,omitempty"` 2395 2396 // ServerResponse contains the HTTP response code and headers from the 2397 // server. 2398 googleapi.ServerResponse `json:"-"` 2399 2400 // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to 2401 // unconditionally include in API requests. By default, fields with 2402 // empty values are omitted from API requests. However, any non-pointer, 2403 // non-interface field appearing in ForceSendFields will be sent to the 2404 // server regardless of whether the field is empty or not. This may be 2405 // used to include empty fields in Patch requests. 2406 ForceSendFields []string `json:"-"` 2407 2408 // NullFields is a list of field names (e.g. "AvatarImageUrl") to 2409 // include in API requests with the JSON null value. By default, fields 2410 // with empty values are omitted from API requests. However, any field 2411 // with an empty value appearing in NullFields will be sent to the 2412 // server as null. It is an error if a field in this list has a 2413 // non-empty value. This may be used to include null fields in Patch 2414 // requests. 2415 NullFields []string `json:"-"` 2416} 2417 2418func (s *Player) MarshalJSON() ([]byte, error) { 2419 type NoMethod Player 2420 raw := NoMethod(*s) 2421 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2422} 2423 2424// PlayerName: An object representation of the individual components of 2425// the player's name. For some players, these fields may not be present. 2426type PlayerName struct { 2427 // FamilyName: The family name of this player. In some places, this is 2428 // known as the last name. 2429 FamilyName string `json:"familyName,omitempty"` 2430 2431 // GivenName: The given name of this player. In some places, this is 2432 // known as the first name. 2433 GivenName string `json:"givenName,omitempty"` 2434 2435 // ForceSendFields is a list of field names (e.g. "FamilyName") to 2436 // unconditionally include in API requests. By default, fields with 2437 // empty values are omitted from API requests. However, any non-pointer, 2438 // non-interface field appearing in ForceSendFields will be sent to the 2439 // server regardless of whether the field is empty or not. This may be 2440 // used to include empty fields in Patch requests. 2441 ForceSendFields []string `json:"-"` 2442 2443 // NullFields is a list of field names (e.g. "FamilyName") to include in 2444 // API requests with the JSON null value. By default, fields with empty 2445 // values are omitted from API requests. However, any field with an 2446 // empty value appearing in NullFields will be sent to the server as 2447 // null. It is an error if a field in this list has a non-empty value. 2448 // This may be used to include null fields in Patch requests. 2449 NullFields []string `json:"-"` 2450} 2451 2452func (s *PlayerName) MarshalJSON() ([]byte, error) { 2453 type NoMethod PlayerName 2454 raw := NoMethod(*s) 2455 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2456} 2457 2458// PlayerAchievement: This is a JSON template for an achievement object. 2459type PlayerAchievement struct { 2460 // AchievementState: The state of the achievement. 2461 // Possible values are: 2462 // - "HIDDEN" - Achievement is hidden. 2463 // - "REVEALED" - Achievement is revealed. 2464 // - "UNLOCKED" - Achievement is unlocked. 2465 AchievementState string `json:"achievementState,omitempty"` 2466 2467 // CurrentSteps: The current steps for an incremental achievement. 2468 CurrentSteps int64 `json:"currentSteps,omitempty"` 2469 2470 // ExperiencePoints: Experience points earned for the achievement. This 2471 // field is absent for achievements that have not yet been unlocked and 2472 // 0 for achievements that have been unlocked by testers but that are 2473 // unpublished. 2474 ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` 2475 2476 // FormattedCurrentStepsString: The current steps for an incremental 2477 // achievement as a string. 2478 FormattedCurrentStepsString string `json:"formattedCurrentStepsString,omitempty"` 2479 2480 // Id: The ID of the achievement. 2481 Id string `json:"id,omitempty"` 2482 2483 // Kind: Uniquely identifies the type of this resource. Value is always 2484 // the fixed string games#playerAchievement. 2485 Kind string `json:"kind,omitempty"` 2486 2487 // LastUpdatedTimestamp: The timestamp of the last modification to this 2488 // achievement's state. 2489 LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"` 2490 2491 // ForceSendFields is a list of field names (e.g. "AchievementState") to 2492 // unconditionally include in API requests. By default, fields with 2493 // empty values are omitted from API requests. However, any non-pointer, 2494 // non-interface field appearing in ForceSendFields will be sent to the 2495 // server regardless of whether the field is empty or not. This may be 2496 // used to include empty fields in Patch requests. 2497 ForceSendFields []string `json:"-"` 2498 2499 // NullFields is a list of field names (e.g. "AchievementState") to 2500 // include in API requests with the JSON null value. By default, fields 2501 // with empty values are omitted from API requests. However, any field 2502 // with an empty value appearing in NullFields will be sent to the 2503 // server as null. It is an error if a field in this list has a 2504 // non-empty value. This may be used to include null fields in Patch 2505 // requests. 2506 NullFields []string `json:"-"` 2507} 2508 2509func (s *PlayerAchievement) MarshalJSON() ([]byte, error) { 2510 type NoMethod PlayerAchievement 2511 raw := NoMethod(*s) 2512 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2513} 2514 2515// PlayerAchievementListResponse: This is a JSON template for a list of 2516// achievement objects. 2517type PlayerAchievementListResponse struct { 2518 // Items: The achievements. 2519 Items []*PlayerAchievement `json:"items,omitempty"` 2520 2521 // Kind: Uniquely identifies the type of this resource. Value is always 2522 // the fixed string games#playerAchievementListResponse. 2523 Kind string `json:"kind,omitempty"` 2524 2525 // NextPageToken: Token corresponding to the next page of results. 2526 NextPageToken string `json:"nextPageToken,omitempty"` 2527 2528 // ServerResponse contains the HTTP response code and headers from the 2529 // server. 2530 googleapi.ServerResponse `json:"-"` 2531 2532 // ForceSendFields is a list of field names (e.g. "Items") to 2533 // unconditionally include in API requests. By default, fields with 2534 // empty values are omitted from API requests. However, any non-pointer, 2535 // non-interface field appearing in ForceSendFields will be sent to the 2536 // server regardless of whether the field is empty or not. This may be 2537 // used to include empty fields in Patch requests. 2538 ForceSendFields []string `json:"-"` 2539 2540 // NullFields is a list of field names (e.g. "Items") to include in API 2541 // requests with the JSON null value. By default, fields with empty 2542 // values are omitted from API requests. However, any field with an 2543 // empty value appearing in NullFields will be sent to the server as 2544 // null. It is an error if a field in this list has a non-empty value. 2545 // This may be used to include null fields in Patch requests. 2546 NullFields []string `json:"-"` 2547} 2548 2549func (s *PlayerAchievementListResponse) MarshalJSON() ([]byte, error) { 2550 type NoMethod PlayerAchievementListResponse 2551 raw := NoMethod(*s) 2552 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2553} 2554 2555// PlayerEvent: This is a JSON template for an event status resource. 2556type PlayerEvent struct { 2557 // DefinitionId: The ID of the event definition. 2558 DefinitionId string `json:"definitionId,omitempty"` 2559 2560 // FormattedNumEvents: The current number of times this event has 2561 // occurred, as a string. The formatting of this string depends on the 2562 // configuration of your event in the Play Games Developer Console. 2563 FormattedNumEvents string `json:"formattedNumEvents,omitempty"` 2564 2565 // Kind: Uniquely identifies the type of this resource. Value is always 2566 // the fixed string games#playerEvent. 2567 Kind string `json:"kind,omitempty"` 2568 2569 // NumEvents: The current number of times this event has occurred. 2570 NumEvents int64 `json:"numEvents,omitempty,string"` 2571 2572 // PlayerId: The ID of the player. 2573 PlayerId string `json:"playerId,omitempty"` 2574 2575 // ForceSendFields is a list of field names (e.g. "DefinitionId") to 2576 // unconditionally include in API requests. By default, fields with 2577 // empty values are omitted from API requests. However, any non-pointer, 2578 // non-interface field appearing in ForceSendFields will be sent to the 2579 // server regardless of whether the field is empty or not. This may be 2580 // used to include empty fields in Patch requests. 2581 ForceSendFields []string `json:"-"` 2582 2583 // NullFields is a list of field names (e.g. "DefinitionId") to include 2584 // in API requests with the JSON null value. By default, fields with 2585 // empty values are omitted from API requests. However, any field with 2586 // an empty value appearing in NullFields will be sent to the server as 2587 // null. It is an error if a field in this list has a non-empty value. 2588 // This may be used to include null fields in Patch requests. 2589 NullFields []string `json:"-"` 2590} 2591 2592func (s *PlayerEvent) MarshalJSON() ([]byte, error) { 2593 type NoMethod PlayerEvent 2594 raw := NoMethod(*s) 2595 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2596} 2597 2598// PlayerEventListResponse: This is a JSON template for a ListByPlayer 2599// response. 2600type PlayerEventListResponse struct { 2601 // Items: The player events. 2602 Items []*PlayerEvent `json:"items,omitempty"` 2603 2604 // Kind: Uniquely identifies the type of this resource. Value is always 2605 // the fixed string games#playerEventListResponse. 2606 Kind string `json:"kind,omitempty"` 2607 2608 // NextPageToken: The pagination token for the next page of results. 2609 NextPageToken string `json:"nextPageToken,omitempty"` 2610 2611 // ServerResponse contains the HTTP response code and headers from the 2612 // server. 2613 googleapi.ServerResponse `json:"-"` 2614 2615 // ForceSendFields is a list of field names (e.g. "Items") to 2616 // unconditionally include in API requests. By default, fields with 2617 // empty values are omitted from API requests. However, any non-pointer, 2618 // non-interface field appearing in ForceSendFields will be sent to the 2619 // server regardless of whether the field is empty or not. This may be 2620 // used to include empty fields in Patch requests. 2621 ForceSendFields []string `json:"-"` 2622 2623 // NullFields is a list of field names (e.g. "Items") to include in API 2624 // requests with the JSON null value. By default, fields with empty 2625 // values are omitted from API requests. However, any field with an 2626 // empty value appearing in NullFields will be sent to the server as 2627 // null. It is an error if a field in this list has a non-empty value. 2628 // This may be used to include null fields in Patch requests. 2629 NullFields []string `json:"-"` 2630} 2631 2632func (s *PlayerEventListResponse) MarshalJSON() ([]byte, error) { 2633 type NoMethod PlayerEventListResponse 2634 raw := NoMethod(*s) 2635 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2636} 2637 2638// PlayerExperienceInfo: This is a JSON template for 1P/3P metadata 2639// about the player's experience. 2640type PlayerExperienceInfo struct { 2641 // CurrentExperiencePoints: The current number of experience points for 2642 // the player. 2643 CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"` 2644 2645 // CurrentLevel: The current level of the player. 2646 CurrentLevel *PlayerLevel `json:"currentLevel,omitempty"` 2647 2648 // Kind: Uniquely identifies the type of this resource. Value is always 2649 // the fixed string games#playerExperienceInfo. 2650 Kind string `json:"kind,omitempty"` 2651 2652 // LastLevelUpTimestampMillis: The timestamp when the player was leveled 2653 // up, in millis since Unix epoch UTC. 2654 LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"` 2655 2656 // NextLevel: The next level of the player. If the current level is the 2657 // maximum level, this should be same as the current level. 2658 NextLevel *PlayerLevel `json:"nextLevel,omitempty"` 2659 2660 // ForceSendFields is a list of field names (e.g. 2661 // "CurrentExperiencePoints") to unconditionally include in API 2662 // requests. By default, fields with empty values are omitted from API 2663 // requests. However, any non-pointer, non-interface field appearing in 2664 // ForceSendFields will be sent to the server regardless of whether the 2665 // field is empty or not. This may be used to include empty fields in 2666 // Patch requests. 2667 ForceSendFields []string `json:"-"` 2668 2669 // NullFields is a list of field names (e.g. "CurrentExperiencePoints") 2670 // to include in API requests with the JSON null value. By default, 2671 // fields with empty values are omitted from API requests. However, any 2672 // field with an empty value appearing in NullFields will be sent to the 2673 // server as null. It is an error if a field in this list has a 2674 // non-empty value. This may be used to include null fields in Patch 2675 // requests. 2676 NullFields []string `json:"-"` 2677} 2678 2679func (s *PlayerExperienceInfo) MarshalJSON() ([]byte, error) { 2680 type NoMethod PlayerExperienceInfo 2681 raw := NoMethod(*s) 2682 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2683} 2684 2685// PlayerLeaderboardScore: This is a JSON template for a player 2686// leaderboard score object. 2687type PlayerLeaderboardScore struct { 2688 // Kind: Uniquely identifies the type of this resource. Value is always 2689 // the fixed string games#playerLeaderboardScore. 2690 Kind string `json:"kind,omitempty"` 2691 2692 // LeaderboardId: The ID of the leaderboard this score is in. 2693 LeaderboardId string `json:"leaderboard_id,omitempty"` 2694 2695 // PublicRank: The public rank of the score in this leaderboard. This 2696 // object will not be present if the user is not sharing their scores 2697 // publicly. 2698 PublicRank *LeaderboardScoreRank `json:"publicRank,omitempty"` 2699 2700 // ScoreString: The formatted value of this score. 2701 ScoreString string `json:"scoreString,omitempty"` 2702 2703 // ScoreTag: Additional information about the score. Values must contain 2704 // no more than 64 URI-safe characters as defined by section 2.3 of RFC 2705 // 3986. 2706 ScoreTag string `json:"scoreTag,omitempty"` 2707 2708 // ScoreValue: The numerical value of this score. 2709 ScoreValue int64 `json:"scoreValue,omitempty,string"` 2710 2711 // SocialRank: The social rank of the score in this leaderboard. 2712 SocialRank *LeaderboardScoreRank `json:"socialRank,omitempty"` 2713 2714 // TimeSpan: The time span of this score. 2715 // Possible values are: 2716 // - "ALL_TIME" - The score is an all-time score. 2717 // - "WEEKLY" - The score is a weekly score. 2718 // - "DAILY" - The score is a daily score. 2719 TimeSpan string `json:"timeSpan,omitempty"` 2720 2721 // WriteTimestamp: The timestamp at which this score was recorded, in 2722 // milliseconds since the epoch in UTC. 2723 WriteTimestamp int64 `json:"writeTimestamp,omitempty,string"` 2724 2725 // ForceSendFields is a list of field names (e.g. "Kind") to 2726 // unconditionally include in API requests. By default, fields with 2727 // empty values are omitted from API requests. However, any non-pointer, 2728 // non-interface field appearing in ForceSendFields will be sent to the 2729 // server regardless of whether the field is empty or not. This may be 2730 // used to include empty fields in Patch requests. 2731 ForceSendFields []string `json:"-"` 2732 2733 // NullFields is a list of field names (e.g. "Kind") to include in API 2734 // requests with the JSON null value. By default, fields with empty 2735 // values are omitted from API requests. However, any field with an 2736 // empty value appearing in NullFields will be sent to the server as 2737 // null. It is an error if a field in this list has a non-empty value. 2738 // This may be used to include null fields in Patch requests. 2739 NullFields []string `json:"-"` 2740} 2741 2742func (s *PlayerLeaderboardScore) MarshalJSON() ([]byte, error) { 2743 type NoMethod PlayerLeaderboardScore 2744 raw := NoMethod(*s) 2745 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2746} 2747 2748// PlayerLeaderboardScoreListResponse: This is a JSON template for a 2749// list of player leaderboard scores. 2750type PlayerLeaderboardScoreListResponse struct { 2751 // Items: The leaderboard scores. 2752 Items []*PlayerLeaderboardScore `json:"items,omitempty"` 2753 2754 // Kind: Uniquely identifies the type of this resource. Value is always 2755 // the fixed string games#playerLeaderboardScoreListResponse. 2756 Kind string `json:"kind,omitempty"` 2757 2758 // NextPageToken: The pagination token for the next page of results. 2759 NextPageToken string `json:"nextPageToken,omitempty"` 2760 2761 // Player: The Player resources for the owner of this score. 2762 Player *Player `json:"player,omitempty"` 2763 2764 // ServerResponse contains the HTTP response code and headers from the 2765 // server. 2766 googleapi.ServerResponse `json:"-"` 2767 2768 // ForceSendFields is a list of field names (e.g. "Items") to 2769 // unconditionally include in API requests. By default, fields with 2770 // empty values are omitted from API requests. However, any non-pointer, 2771 // non-interface field appearing in ForceSendFields will be sent to the 2772 // server regardless of whether the field is empty or not. This may be 2773 // used to include empty fields in Patch requests. 2774 ForceSendFields []string `json:"-"` 2775 2776 // NullFields is a list of field names (e.g. "Items") to include in API 2777 // requests with the JSON null value. By default, fields with empty 2778 // values are omitted from API requests. However, any field with an 2779 // empty value appearing in NullFields will be sent to the server as 2780 // null. It is an error if a field in this list has a non-empty value. 2781 // This may be used to include null fields in Patch requests. 2782 NullFields []string `json:"-"` 2783} 2784 2785func (s *PlayerLeaderboardScoreListResponse) MarshalJSON() ([]byte, error) { 2786 type NoMethod PlayerLeaderboardScoreListResponse 2787 raw := NoMethod(*s) 2788 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2789} 2790 2791// PlayerLevel: This is a JSON template for 1P/3P metadata about a 2792// user's level. 2793type PlayerLevel struct { 2794 // Kind: Uniquely identifies the type of this resource. Value is always 2795 // the fixed string games#playerLevel. 2796 Kind string `json:"kind,omitempty"` 2797 2798 // Level: The level for the user. 2799 Level int64 `json:"level,omitempty"` 2800 2801 // MaxExperiencePoints: The maximum experience points for this level. 2802 MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"` 2803 2804 // MinExperiencePoints: The minimum experience points for this level. 2805 MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"` 2806 2807 // ForceSendFields is a list of field names (e.g. "Kind") to 2808 // unconditionally include in API requests. By default, fields with 2809 // empty values are omitted from API requests. However, any non-pointer, 2810 // non-interface field appearing in ForceSendFields will be sent to the 2811 // server regardless of whether the field is empty or not. This may be 2812 // used to include empty fields in Patch requests. 2813 ForceSendFields []string `json:"-"` 2814 2815 // NullFields is a list of field names (e.g. "Kind") to include in API 2816 // requests with the JSON null value. By default, fields with empty 2817 // values are omitted from API requests. However, any field with an 2818 // empty value appearing in NullFields will be sent to the server as 2819 // null. It is an error if a field in this list has a non-empty value. 2820 // This may be used to include null fields in Patch requests. 2821 NullFields []string `json:"-"` 2822} 2823 2824func (s *PlayerLevel) MarshalJSON() ([]byte, error) { 2825 type NoMethod PlayerLevel 2826 raw := NoMethod(*s) 2827 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2828} 2829 2830// PlayerListResponse: This is a JSON template for a third party player 2831// list response. 2832type PlayerListResponse struct { 2833 // Items: The players. 2834 Items []*Player `json:"items,omitempty"` 2835 2836 // Kind: Uniquely identifies the type of this resource. Value is always 2837 // the fixed string games#playerListResponse. 2838 Kind string `json:"kind,omitempty"` 2839 2840 // NextPageToken: Token corresponding to the next page of results. 2841 NextPageToken string `json:"nextPageToken,omitempty"` 2842 2843 // ServerResponse contains the HTTP response code and headers from the 2844 // server. 2845 googleapi.ServerResponse `json:"-"` 2846 2847 // ForceSendFields is a list of field names (e.g. "Items") to 2848 // unconditionally include in API requests. By default, fields with 2849 // empty values are omitted from API requests. However, any non-pointer, 2850 // non-interface field appearing in ForceSendFields will be sent to the 2851 // server regardless of whether the field is empty or not. This may be 2852 // used to include empty fields in Patch requests. 2853 ForceSendFields []string `json:"-"` 2854 2855 // NullFields is a list of field names (e.g. "Items") to include in API 2856 // requests with the JSON null value. By default, fields with empty 2857 // values are omitted from API requests. However, any field with an 2858 // empty value appearing in NullFields will be sent to the server as 2859 // null. It is an error if a field in this list has a non-empty value. 2860 // This may be used to include null fields in Patch requests. 2861 NullFields []string `json:"-"` 2862} 2863 2864func (s *PlayerListResponse) MarshalJSON() ([]byte, error) { 2865 type NoMethod PlayerListResponse 2866 raw := NoMethod(*s) 2867 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2868} 2869 2870// PlayerScore: This is a JSON template for a player score. 2871type PlayerScore struct { 2872 // FormattedScore: The formatted score for this player score. 2873 FormattedScore string `json:"formattedScore,omitempty"` 2874 2875 // Kind: Uniquely identifies the type of this resource. Value is always 2876 // the fixed string games#playerScore. 2877 Kind string `json:"kind,omitempty"` 2878 2879 // Score: The numerical value for this player score. 2880 Score int64 `json:"score,omitempty,string"` 2881 2882 // ScoreTag: Additional information about this score. Values will 2883 // contain no more than 64 URI-safe characters as defined by section 2.3 2884 // of RFC 3986. 2885 ScoreTag string `json:"scoreTag,omitempty"` 2886 2887 // TimeSpan: The time span for this player score. 2888 // Possible values are: 2889 // - "ALL_TIME" - The score is an all-time score. 2890 // - "WEEKLY" - The score is a weekly score. 2891 // - "DAILY" - The score is a daily score. 2892 TimeSpan string `json:"timeSpan,omitempty"` 2893 2894 // ForceSendFields is a list of field names (e.g. "FormattedScore") to 2895 // unconditionally include in API requests. By default, fields with 2896 // empty values are omitted from API requests. However, any non-pointer, 2897 // non-interface field appearing in ForceSendFields will be sent to the 2898 // server regardless of whether the field is empty or not. This may be 2899 // used to include empty fields in Patch requests. 2900 ForceSendFields []string `json:"-"` 2901 2902 // NullFields is a list of field names (e.g. "FormattedScore") to 2903 // include in API requests with the JSON null value. By default, fields 2904 // with empty values are omitted from API requests. However, any field 2905 // with an empty value appearing in NullFields will be sent to the 2906 // server as null. It is an error if a field in this list has a 2907 // non-empty value. This may be used to include null fields in Patch 2908 // requests. 2909 NullFields []string `json:"-"` 2910} 2911 2912func (s *PlayerScore) MarshalJSON() ([]byte, error) { 2913 type NoMethod PlayerScore 2914 raw := NoMethod(*s) 2915 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2916} 2917 2918// PlayerScoreListResponse: This is a JSON template for a list of score 2919// submission statuses. 2920type PlayerScoreListResponse struct { 2921 // Kind: Uniquely identifies the type of this resource. Value is always 2922 // the fixed string games#playerScoreListResponse. 2923 Kind string `json:"kind,omitempty"` 2924 2925 // SubmittedScores: The score submissions statuses. 2926 SubmittedScores []*PlayerScoreResponse `json:"submittedScores,omitempty"` 2927 2928 // ServerResponse contains the HTTP response code and headers from the 2929 // server. 2930 googleapi.ServerResponse `json:"-"` 2931 2932 // ForceSendFields is a list of field names (e.g. "Kind") to 2933 // unconditionally include in API requests. By default, fields with 2934 // empty values are omitted from API requests. However, any non-pointer, 2935 // non-interface field appearing in ForceSendFields will be sent to the 2936 // server regardless of whether the field is empty or not. This may be 2937 // used to include empty fields in Patch requests. 2938 ForceSendFields []string `json:"-"` 2939 2940 // NullFields is a list of field names (e.g. "Kind") to include in API 2941 // requests with the JSON null value. By default, fields with empty 2942 // values are omitted from API requests. However, any field with an 2943 // empty value appearing in NullFields will be sent to the server as 2944 // null. It is an error if a field in this list has a non-empty value. 2945 // This may be used to include null fields in Patch requests. 2946 NullFields []string `json:"-"` 2947} 2948 2949func (s *PlayerScoreListResponse) MarshalJSON() ([]byte, error) { 2950 type NoMethod PlayerScoreListResponse 2951 raw := NoMethod(*s) 2952 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2953} 2954 2955// PlayerScoreResponse: This is a JSON template for a list of 2956// leaderboard entry resources. 2957type PlayerScoreResponse struct { 2958 // BeatenScoreTimeSpans: The time spans where the submitted score is 2959 // better than the existing score for that time span. 2960 // Possible values are: 2961 // - "ALL_TIME" - The score is an all-time score. 2962 // - "WEEKLY" - The score is a weekly score. 2963 // - "DAILY" - The score is a daily score. 2964 BeatenScoreTimeSpans []string `json:"beatenScoreTimeSpans,omitempty"` 2965 2966 // FormattedScore: The formatted value of the submitted score. 2967 FormattedScore string `json:"formattedScore,omitempty"` 2968 2969 // Kind: Uniquely identifies the type of this resource. Value is always 2970 // the fixed string games#playerScoreResponse. 2971 Kind string `json:"kind,omitempty"` 2972 2973 // LeaderboardId: The leaderboard ID that this score was submitted to. 2974 LeaderboardId string `json:"leaderboardId,omitempty"` 2975 2976 // ScoreTag: Additional information about this score. Values will 2977 // contain no more than 64 URI-safe characters as defined by section 2.3 2978 // of RFC 3986. 2979 ScoreTag string `json:"scoreTag,omitempty"` 2980 2981 // UnbeatenScores: The scores in time spans that have not been beaten. 2982 // As an example, the submitted score may be better than the player's 2983 // DAILY score, but not better than the player's scores for the WEEKLY 2984 // or ALL_TIME time spans. 2985 UnbeatenScores []*PlayerScore `json:"unbeatenScores,omitempty"` 2986 2987 // ServerResponse contains the HTTP response code and headers from the 2988 // server. 2989 googleapi.ServerResponse `json:"-"` 2990 2991 // ForceSendFields is a list of field names (e.g. 2992 // "BeatenScoreTimeSpans") to unconditionally include in API requests. 2993 // By default, fields with empty values are omitted from API requests. 2994 // However, any non-pointer, non-interface field appearing in 2995 // ForceSendFields will be sent to the server regardless of whether the 2996 // field is empty or not. This may be used to include empty fields in 2997 // Patch requests. 2998 ForceSendFields []string `json:"-"` 2999 3000 // NullFields is a list of field names (e.g. "BeatenScoreTimeSpans") to 3001 // include in API requests with the JSON null value. By default, fields 3002 // with empty values are omitted from API requests. However, any field 3003 // with an empty value appearing in NullFields will be sent to the 3004 // server as null. It is an error if a field in this list has a 3005 // non-empty value. This may be used to include null fields in Patch 3006 // requests. 3007 NullFields []string `json:"-"` 3008} 3009 3010func (s *PlayerScoreResponse) MarshalJSON() ([]byte, error) { 3011 type NoMethod PlayerScoreResponse 3012 raw := NoMethod(*s) 3013 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3014} 3015 3016// PlayerScoreSubmissionList: This is a JSON template for a list of 3017// score submission requests 3018type PlayerScoreSubmissionList struct { 3019 // Kind: Uniquely identifies the type of this resource. Value is always 3020 // the fixed string games#playerScoreSubmissionList. 3021 Kind string `json:"kind,omitempty"` 3022 3023 // Scores: The score submissions. 3024 Scores []*ScoreSubmission `json:"scores,omitempty"` 3025 3026 // ForceSendFields is a list of field names (e.g. "Kind") to 3027 // unconditionally include in API requests. By default, fields with 3028 // empty values are omitted from API requests. However, any non-pointer, 3029 // non-interface field appearing in ForceSendFields will be sent to the 3030 // server regardless of whether the field is empty or not. This may be 3031 // used to include empty fields in Patch requests. 3032 ForceSendFields []string `json:"-"` 3033 3034 // NullFields is a list of field names (e.g. "Kind") to include in API 3035 // requests with the JSON null value. By default, fields with empty 3036 // values are omitted from API requests. However, any field with an 3037 // empty value appearing in NullFields will be sent to the server as 3038 // null. It is an error if a field in this list has a non-empty value. 3039 // This may be used to include null fields in Patch requests. 3040 NullFields []string `json:"-"` 3041} 3042 3043func (s *PlayerScoreSubmissionList) MarshalJSON() ([]byte, error) { 3044 type NoMethod PlayerScoreSubmissionList 3045 raw := NoMethod(*s) 3046 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3047} 3048 3049// ProfileSettings: This is a JSON template for profile settings 3050type ProfileSettings struct { 3051 // Kind: Uniquely identifies the type of this resource. Value is always 3052 // the fixed string games#profileSettings. 3053 Kind string `json:"kind,omitempty"` 3054 3055 // ProfileVisible: The player's current profile visibility. This field 3056 // is visible to both 1P and 3P APIs. 3057 ProfileVisible bool `json:"profileVisible,omitempty"` 3058 3059 // ForceSendFields is a list of field names (e.g. "Kind") to 3060 // unconditionally include in API requests. By default, fields with 3061 // empty values are omitted from API requests. However, any non-pointer, 3062 // non-interface field appearing in ForceSendFields will be sent to the 3063 // server regardless of whether the field is empty or not. This may be 3064 // used to include empty fields in Patch requests. 3065 ForceSendFields []string `json:"-"` 3066 3067 // NullFields is a list of field names (e.g. "Kind") to include in API 3068 // requests with the JSON null value. By default, fields with empty 3069 // values are omitted from API requests. However, any field with an 3070 // empty value appearing in NullFields will be sent to the server as 3071 // null. It is an error if a field in this list has a non-empty value. 3072 // This may be used to include null fields in Patch requests. 3073 NullFields []string `json:"-"` 3074} 3075 3076func (s *ProfileSettings) MarshalJSON() ([]byte, error) { 3077 type NoMethod ProfileSettings 3078 raw := NoMethod(*s) 3079 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3080} 3081 3082// PushToken: This is a JSON template for a push token resource. 3083type PushToken struct { 3084 // ClientRevision: The revision of the client SDK used by your 3085 // application, in the same format that's used by revisions.check. Used 3086 // to send backward compatible messages. Format: 3087 // [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE 3088 // are: 3089 // - IOS - Push token is for iOS 3090 ClientRevision string `json:"clientRevision,omitempty"` 3091 3092 // Id: Unique identifier for this push token. 3093 Id *PushTokenId `json:"id,omitempty"` 3094 3095 // Kind: Uniquely identifies the type of this resource. Value is always 3096 // the fixed string games#pushToken. 3097 Kind string `json:"kind,omitempty"` 3098 3099 // Language: The preferred language for notifications that are sent 3100 // using this token. 3101 Language string `json:"language,omitempty"` 3102 3103 // ForceSendFields is a list of field names (e.g. "ClientRevision") to 3104 // unconditionally include in API requests. By default, fields with 3105 // empty values are omitted from API requests. However, any non-pointer, 3106 // non-interface field appearing in ForceSendFields will be sent to the 3107 // server regardless of whether the field is empty or not. This may be 3108 // used to include empty fields in Patch requests. 3109 ForceSendFields []string `json:"-"` 3110 3111 // NullFields is a list of field names (e.g. "ClientRevision") to 3112 // include in API requests with the JSON null value. By default, fields 3113 // with empty values are omitted from API requests. However, any field 3114 // with an empty value appearing in NullFields will be sent to the 3115 // server as null. It is an error if a field in this list has a 3116 // non-empty value. This may be used to include null fields in Patch 3117 // requests. 3118 NullFields []string `json:"-"` 3119} 3120 3121func (s *PushToken) MarshalJSON() ([]byte, error) { 3122 type NoMethod PushToken 3123 raw := NoMethod(*s) 3124 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3125} 3126 3127// PushTokenId: This is a JSON template for a push token ID resource. 3128type PushTokenId struct { 3129 // Ios: A push token ID for iOS devices. 3130 Ios *PushTokenIdIos `json:"ios,omitempty"` 3131 3132 // Kind: Uniquely identifies the type of this resource. Value is always 3133 // the fixed string games#pushTokenId. 3134 Kind string `json:"kind,omitempty"` 3135 3136 // ForceSendFields is a list of field names (e.g. "Ios") to 3137 // unconditionally include in API requests. By default, fields with 3138 // empty values are omitted from API requests. However, any non-pointer, 3139 // non-interface field appearing in ForceSendFields will be sent to the 3140 // server regardless of whether the field is empty or not. This may be 3141 // used to include empty fields in Patch requests. 3142 ForceSendFields []string `json:"-"` 3143 3144 // NullFields is a list of field names (e.g. "Ios") to include in API 3145 // requests with the JSON null value. By default, fields with empty 3146 // values are omitted from API requests. However, any field with an 3147 // empty value appearing in NullFields will be sent to the server as 3148 // null. It is an error if a field in this list has a non-empty value. 3149 // This may be used to include null fields in Patch requests. 3150 NullFields []string `json:"-"` 3151} 3152 3153func (s *PushTokenId) MarshalJSON() ([]byte, error) { 3154 type NoMethod PushTokenId 3155 raw := NoMethod(*s) 3156 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3157} 3158 3159// PushTokenIdIos: A push token ID for iOS devices. 3160type PushTokenIdIos struct { 3161 // ApnsDeviceToken: Device token supplied by an iOS system call to 3162 // register for remote notifications. Encode this field as web-safe 3163 // base64. 3164 ApnsDeviceToken string `json:"apns_device_token,omitempty"` 3165 3166 // ApnsEnvironment: Indicates whether this token should be used for the 3167 // production or sandbox APNS server. 3168 ApnsEnvironment string `json:"apns_environment,omitempty"` 3169 3170 // ForceSendFields is a list of field names (e.g. "ApnsDeviceToken") to 3171 // unconditionally include in API requests. By default, fields with 3172 // empty values are omitted from API requests. However, any non-pointer, 3173 // non-interface field appearing in ForceSendFields will be sent to the 3174 // server regardless of whether the field is empty or not. This may be 3175 // used to include empty fields in Patch requests. 3176 ForceSendFields []string `json:"-"` 3177 3178 // NullFields is a list of field names (e.g. "ApnsDeviceToken") to 3179 // include in API requests with the JSON null value. By default, fields 3180 // with empty values are omitted from API requests. However, any field 3181 // with an empty value appearing in NullFields will be sent to the 3182 // server as null. It is an error if a field in this list has a 3183 // non-empty value. This may be used to include null fields in Patch 3184 // requests. 3185 NullFields []string `json:"-"` 3186} 3187 3188func (s *PushTokenIdIos) MarshalJSON() ([]byte, error) { 3189 type NoMethod PushTokenIdIos 3190 raw := NoMethod(*s) 3191 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3192} 3193 3194// Quest: This is a JSON template for a Quest resource. 3195type Quest struct { 3196 // AcceptedTimestampMillis: The timestamp at which the user accepted the 3197 // quest in milliseconds since the epoch in UTC. Only present if the 3198 // player has accepted the quest. 3199 AcceptedTimestampMillis int64 `json:"acceptedTimestampMillis,omitempty,string"` 3200 3201 // ApplicationId: The ID of the application this quest is part of. 3202 ApplicationId string `json:"applicationId,omitempty"` 3203 3204 // BannerUrl: The banner image URL for the quest. 3205 BannerUrl string `json:"bannerUrl,omitempty"` 3206 3207 // Description: The description of the quest. 3208 Description string `json:"description,omitempty"` 3209 3210 // EndTimestampMillis: The timestamp at which the quest ceases to be 3211 // active in milliseconds since the epoch in UTC. 3212 EndTimestampMillis int64 `json:"endTimestampMillis,omitempty,string"` 3213 3214 // IconUrl: The icon image URL for the quest. 3215 IconUrl string `json:"iconUrl,omitempty"` 3216 3217 // Id: The ID of the quest. 3218 Id string `json:"id,omitempty"` 3219 3220 // IsDefaultBannerUrl: Indicates whether the banner image being returned 3221 // is a default image, or is game-provided. 3222 IsDefaultBannerUrl bool `json:"isDefaultBannerUrl,omitempty"` 3223 3224 // IsDefaultIconUrl: Indicates whether the icon image being returned is 3225 // a default image, or is game-provided. 3226 IsDefaultIconUrl bool `json:"isDefaultIconUrl,omitempty"` 3227 3228 // Kind: Uniquely identifies the type of this resource. Value is always 3229 // the fixed string games#quest. 3230 Kind string `json:"kind,omitempty"` 3231 3232 // LastUpdatedTimestampMillis: The timestamp at which the quest was last 3233 // updated by the user in milliseconds since the epoch in UTC. Only 3234 // present if the player has accepted the quest. 3235 LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"` 3236 3237 // Milestones: The quest milestones. 3238 Milestones []*QuestMilestone `json:"milestones,omitempty"` 3239 3240 // Name: The name of the quest. 3241 Name string `json:"name,omitempty"` 3242 3243 // NotifyTimestampMillis: The timestamp at which the user should be 3244 // notified that the quest will end soon in milliseconds since the epoch 3245 // in UTC. 3246 NotifyTimestampMillis int64 `json:"notifyTimestampMillis,omitempty,string"` 3247 3248 // StartTimestampMillis: The timestamp at which the quest becomes active 3249 // in milliseconds since the epoch in UTC. 3250 StartTimestampMillis int64 `json:"startTimestampMillis,omitempty,string"` 3251 3252 // State: The state of the quest. 3253 // Possible values are: 3254 // - "UPCOMING": The quest is upcoming. The user can see the quest, but 3255 // cannot accept it until it is open. 3256 // - "OPEN": The quest is currently open and may be accepted at this 3257 // time. 3258 // - "ACCEPTED": The user is currently participating in this quest. 3259 // - "COMPLETED": The user has completed the quest. 3260 // - "FAILED": The quest was attempted but was not completed before the 3261 // deadline expired. 3262 // - "EXPIRED": The quest has expired and was not accepted. 3263 // - "DELETED": The quest should be deleted from the local database. 3264 State string `json:"state,omitempty"` 3265 3266 // ServerResponse contains the HTTP response code and headers from the 3267 // server. 3268 googleapi.ServerResponse `json:"-"` 3269 3270 // ForceSendFields is a list of field names (e.g. 3271 // "AcceptedTimestampMillis") to unconditionally include in API 3272 // requests. By default, fields with empty values are omitted from API 3273 // requests. However, any non-pointer, non-interface field appearing in 3274 // ForceSendFields will be sent to the server regardless of whether the 3275 // field is empty or not. This may be used to include empty fields in 3276 // Patch requests. 3277 ForceSendFields []string `json:"-"` 3278 3279 // NullFields is a list of field names (e.g. "AcceptedTimestampMillis") 3280 // to include in API requests with the JSON null value. By default, 3281 // fields with empty values are omitted from API requests. However, any 3282 // field with an empty value appearing in NullFields will be sent to the 3283 // server as null. It is an error if a field in this list has a 3284 // non-empty value. This may be used to include null fields in Patch 3285 // requests. 3286 NullFields []string `json:"-"` 3287} 3288 3289func (s *Quest) MarshalJSON() ([]byte, error) { 3290 type NoMethod Quest 3291 raw := NoMethod(*s) 3292 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3293} 3294 3295// QuestContribution: This is a JSON template for a Quest Criterion 3296// Contribution resource. 3297type QuestContribution struct { 3298 // FormattedValue: The formatted value of the contribution as a string. 3299 // Format depends on the configuration for the associated event 3300 // definition in the Play Games Developer Console. 3301 FormattedValue string `json:"formattedValue,omitempty"` 3302 3303 // Kind: Uniquely identifies the type of this resource. Value is always 3304 // the fixed string games#questContribution. 3305 Kind string `json:"kind,omitempty"` 3306 3307 // Value: The value of the contribution. 3308 Value int64 `json:"value,omitempty,string"` 3309 3310 // ForceSendFields is a list of field names (e.g. "FormattedValue") to 3311 // unconditionally include in API requests. By default, fields with 3312 // empty values are omitted from API requests. However, any non-pointer, 3313 // non-interface field appearing in ForceSendFields will be sent to the 3314 // server regardless of whether the field is empty or not. This may be 3315 // used to include empty fields in Patch requests. 3316 ForceSendFields []string `json:"-"` 3317 3318 // NullFields is a list of field names (e.g. "FormattedValue") to 3319 // include in API requests with the JSON null value. By default, fields 3320 // with empty values are omitted from API requests. However, any field 3321 // with an empty value appearing in NullFields will be sent to the 3322 // server as null. It is an error if a field in this list has a 3323 // non-empty value. This may be used to include null fields in Patch 3324 // requests. 3325 NullFields []string `json:"-"` 3326} 3327 3328func (s *QuestContribution) MarshalJSON() ([]byte, error) { 3329 type NoMethod QuestContribution 3330 raw := NoMethod(*s) 3331 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3332} 3333 3334// QuestCriterion: This is a JSON template for a Quest Criterion 3335// resource. 3336type QuestCriterion struct { 3337 // CompletionContribution: The total number of times the associated 3338 // event must be incremented for the player to complete this quest. 3339 CompletionContribution *QuestContribution `json:"completionContribution,omitempty"` 3340 3341 // CurrentContribution: The number of increments the player has made 3342 // toward the completion count event increments required to complete the 3343 // quest. This value will not exceed the completion contribution. 3344 // There will be no currentContribution until the player has accepted 3345 // the quest. 3346 CurrentContribution *QuestContribution `json:"currentContribution,omitempty"` 3347 3348 // EventId: The ID of the event the criterion corresponds to. 3349 EventId string `json:"eventId,omitempty"` 3350 3351 // InitialPlayerProgress: The value of the event associated with this 3352 // quest at the time that the quest was accepted. This value may change 3353 // if event increments that took place before the start of quest are 3354 // uploaded after the quest starts. 3355 // There will be no initialPlayerProgress until the player has accepted 3356 // the quest. 3357 InitialPlayerProgress *QuestContribution `json:"initialPlayerProgress,omitempty"` 3358 3359 // Kind: Uniquely identifies the type of this resource. Value is always 3360 // the fixed string games#questCriterion. 3361 Kind string `json:"kind,omitempty"` 3362 3363 // ForceSendFields is a list of field names (e.g. 3364 // "CompletionContribution") to unconditionally include in API requests. 3365 // By default, fields with empty values are omitted from API requests. 3366 // However, any non-pointer, non-interface field appearing in 3367 // ForceSendFields will be sent to the server regardless of whether the 3368 // field is empty or not. This may be used to include empty fields in 3369 // Patch requests. 3370 ForceSendFields []string `json:"-"` 3371 3372 // NullFields is a list of field names (e.g. "CompletionContribution") 3373 // to include in API requests with the JSON null value. By default, 3374 // fields with empty values are omitted from API requests. However, any 3375 // field with an empty value appearing in NullFields will be sent to the 3376 // server as null. It is an error if a field in this list has a 3377 // non-empty value. This may be used to include null fields in Patch 3378 // requests. 3379 NullFields []string `json:"-"` 3380} 3381 3382func (s *QuestCriterion) MarshalJSON() ([]byte, error) { 3383 type NoMethod QuestCriterion 3384 raw := NoMethod(*s) 3385 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3386} 3387 3388// QuestListResponse: This is a JSON template for a list of quest 3389// objects. 3390type QuestListResponse struct { 3391 // Items: The quests. 3392 Items []*Quest `json:"items,omitempty"` 3393 3394 // Kind: Uniquely identifies the type of this resource. Value is always 3395 // the fixed string games#questListResponse. 3396 Kind string `json:"kind,omitempty"` 3397 3398 // NextPageToken: Token corresponding to the next page of results. 3399 NextPageToken string `json:"nextPageToken,omitempty"` 3400 3401 // ServerResponse contains the HTTP response code and headers from the 3402 // server. 3403 googleapi.ServerResponse `json:"-"` 3404 3405 // ForceSendFields is a list of field names (e.g. "Items") to 3406 // unconditionally include in API requests. By default, fields with 3407 // empty values are omitted from API requests. However, any non-pointer, 3408 // non-interface field appearing in ForceSendFields will be sent to the 3409 // server regardless of whether the field is empty or not. This may be 3410 // used to include empty fields in Patch requests. 3411 ForceSendFields []string `json:"-"` 3412 3413 // NullFields is a list of field names (e.g. "Items") to include in API 3414 // requests with the JSON null value. By default, fields with empty 3415 // values are omitted from API requests. However, any field with an 3416 // empty value appearing in NullFields will be sent to the server as 3417 // null. It is an error if a field in this list has a non-empty value. 3418 // This may be used to include null fields in Patch requests. 3419 NullFields []string `json:"-"` 3420} 3421 3422func (s *QuestListResponse) MarshalJSON() ([]byte, error) { 3423 type NoMethod QuestListResponse 3424 raw := NoMethod(*s) 3425 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3426} 3427 3428// QuestMilestone: This is a JSON template for a Quest Milestone 3429// resource. 3430type QuestMilestone struct { 3431 // CompletionRewardData: The completion reward data of the milestone, 3432 // represented as a Base64-encoded string. This is a developer-specified 3433 // binary blob with size between 0 and 2 KB before encoding. 3434 CompletionRewardData string `json:"completionRewardData,omitempty"` 3435 3436 // Criteria: The criteria of the milestone. 3437 Criteria []*QuestCriterion `json:"criteria,omitempty"` 3438 3439 // Id: The milestone ID. 3440 Id string `json:"id,omitempty"` 3441 3442 // Kind: Uniquely identifies the type of this resource. Value is always 3443 // the fixed string games#questMilestone. 3444 Kind string `json:"kind,omitempty"` 3445 3446 // State: The current state of the milestone. 3447 // Possible values are: 3448 // - "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has not 3449 // yet been claimed. 3450 // - "CLAIMED" - The milestone is complete and has been claimed. 3451 // - "NOT_COMPLETED" - The milestone has not yet been completed. 3452 // - "NOT_STARTED" - The milestone is for a quest that has not yet been 3453 // accepted. 3454 State string `json:"state,omitempty"` 3455 3456 // ForceSendFields is a list of field names (e.g. 3457 // "CompletionRewardData") to unconditionally include in API requests. 3458 // By default, fields with empty values are omitted from API requests. 3459 // However, any non-pointer, non-interface field appearing in 3460 // ForceSendFields will be sent to the server regardless of whether the 3461 // field is empty or not. This may be used to include empty fields in 3462 // Patch requests. 3463 ForceSendFields []string `json:"-"` 3464 3465 // NullFields is a list of field names (e.g. "CompletionRewardData") to 3466 // include in API requests with the JSON null value. By default, fields 3467 // with empty values are omitted from API requests. However, any field 3468 // with an empty value appearing in NullFields will be sent to the 3469 // server as null. It is an error if a field in this list has a 3470 // non-empty value. This may be used to include null fields in Patch 3471 // requests. 3472 NullFields []string `json:"-"` 3473} 3474 3475func (s *QuestMilestone) MarshalJSON() ([]byte, error) { 3476 type NoMethod QuestMilestone 3477 raw := NoMethod(*s) 3478 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3479} 3480 3481// RevisionCheckResponse: This is a JSON template for the result of 3482// checking a revision. 3483type RevisionCheckResponse struct { 3484 // ApiVersion: The version of the API this client revision should use 3485 // when calling API methods. 3486 ApiVersion string `json:"apiVersion,omitempty"` 3487 3488 // Kind: Uniquely identifies the type of this resource. Value is always 3489 // the fixed string games#revisionCheckResponse. 3490 Kind string `json:"kind,omitempty"` 3491 3492 // RevisionStatus: The result of the revision check. 3493 // Possible values are: 3494 // - "OK" - The revision being used is current. 3495 // - "DEPRECATED" - There is currently a newer version available, but 3496 // the revision being used still works. 3497 // - "INVALID" - The revision being used is not supported in any 3498 // released version. 3499 RevisionStatus string `json:"revisionStatus,omitempty"` 3500 3501 // ServerResponse contains the HTTP response code and headers from the 3502 // server. 3503 googleapi.ServerResponse `json:"-"` 3504 3505 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 3506 // unconditionally include in API requests. By default, fields with 3507 // empty values are omitted from API requests. However, any non-pointer, 3508 // non-interface field appearing in ForceSendFields will be sent to the 3509 // server regardless of whether the field is empty or not. This may be 3510 // used to include empty fields in Patch requests. 3511 ForceSendFields []string `json:"-"` 3512 3513 // NullFields is a list of field names (e.g. "ApiVersion") to include in 3514 // API requests with the JSON null value. By default, fields with empty 3515 // values are omitted from API requests. However, any field with an 3516 // empty value appearing in NullFields will be sent to the server as 3517 // null. It is an error if a field in this list has a non-empty value. 3518 // This may be used to include null fields in Patch requests. 3519 NullFields []string `json:"-"` 3520} 3521 3522func (s *RevisionCheckResponse) MarshalJSON() ([]byte, error) { 3523 type NoMethod RevisionCheckResponse 3524 raw := NoMethod(*s) 3525 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3526} 3527 3528// Room: This is a JSON template for a room resource object. 3529type Room struct { 3530 // ApplicationId: The ID of the application being played. 3531 ApplicationId string `json:"applicationId,omitempty"` 3532 3533 // AutoMatchingCriteria: Criteria for auto-matching players into this 3534 // room. 3535 AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` 3536 3537 // AutoMatchingStatus: Auto-matching status for this room. Not set if 3538 // the room is not currently in the auto-matching queue. 3539 AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"` 3540 3541 // CreationDetails: Details about the room creation. 3542 CreationDetails *RoomModification `json:"creationDetails,omitempty"` 3543 3544 // Description: This short description is generated by our servers and 3545 // worded relative to the player requesting the room. It is intended to 3546 // be displayed when the room is shown in a list (that is, an invitation 3547 // to a room.) 3548 Description string `json:"description,omitempty"` 3549 3550 // InviterId: The ID of the participant that invited the user to the 3551 // room. Not set if the user was not invited to the room. 3552 InviterId string `json:"inviterId,omitempty"` 3553 3554 // Kind: Uniquely identifies the type of this resource. Value is always 3555 // the fixed string games#room. 3556 Kind string `json:"kind,omitempty"` 3557 3558 // LastUpdateDetails: Details about the last update to the room. 3559 LastUpdateDetails *RoomModification `json:"lastUpdateDetails,omitempty"` 3560 3561 // Participants: The participants involved in the room, along with their 3562 // statuses. Includes participants who have left or declined 3563 // invitations. 3564 Participants []*RoomParticipant `json:"participants,omitempty"` 3565 3566 // RoomId: Globally unique ID for a room. 3567 RoomId string `json:"roomId,omitempty"` 3568 3569 // RoomStatusVersion: The version of the room status: an increasing 3570 // counter, used by the client to ignore out-of-order updates to room 3571 // status. 3572 RoomStatusVersion int64 `json:"roomStatusVersion,omitempty"` 3573 3574 // Status: The status of the room. 3575 // Possible values are: 3576 // - "ROOM_INVITING" - One or more players have been invited and not 3577 // responded. 3578 // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by 3579 // auto-matching. 3580 // - "ROOM_CONNECTING" - Players have joined and are connecting to each 3581 // other (either before or after auto-matching). 3582 // - "ROOM_ACTIVE" - All players have joined and connected to each 3583 // other. 3584 // - "ROOM_DELETED" - The room should no longer be shown on the client. 3585 // Returned in sync calls when a player joins a room (as a tombstone), 3586 // or for rooms where all joined participants have left. 3587 Status string `json:"status,omitempty"` 3588 3589 // Variant: The variant / mode of the application being played; can be 3590 // any integer value, or left blank. 3591 Variant int64 `json:"variant,omitempty"` 3592 3593 // ServerResponse contains the HTTP response code and headers from the 3594 // server. 3595 googleapi.ServerResponse `json:"-"` 3596 3597 // ForceSendFields is a list of field names (e.g. "ApplicationId") to 3598 // unconditionally include in API requests. By default, fields with 3599 // empty values are omitted from API requests. However, any non-pointer, 3600 // non-interface field appearing in ForceSendFields will be sent to the 3601 // server regardless of whether the field is empty or not. This may be 3602 // used to include empty fields in Patch requests. 3603 ForceSendFields []string `json:"-"` 3604 3605 // NullFields is a list of field names (e.g. "ApplicationId") to include 3606 // in API requests with the JSON null value. By default, fields with 3607 // empty values are omitted from API requests. However, any field with 3608 // an empty value appearing in NullFields will be sent to the server as 3609 // null. It is an error if a field in this list has a non-empty value. 3610 // This may be used to include null fields in Patch requests. 3611 NullFields []string `json:"-"` 3612} 3613 3614func (s *Room) MarshalJSON() ([]byte, error) { 3615 type NoMethod Room 3616 raw := NoMethod(*s) 3617 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3618} 3619 3620// RoomAutoMatchStatus: This is a JSON template for status of room 3621// automatching that is in progress. 3622type RoomAutoMatchStatus struct { 3623 // Kind: Uniquely identifies the type of this resource. Value is always 3624 // the fixed string games#roomAutoMatchStatus. 3625 Kind string `json:"kind,omitempty"` 3626 3627 // WaitEstimateSeconds: An estimate for the amount of time (in seconds) 3628 // that auto-matching is expected to take to complete. 3629 WaitEstimateSeconds int64 `json:"waitEstimateSeconds,omitempty"` 3630 3631 // ForceSendFields is a list of field names (e.g. "Kind") to 3632 // unconditionally include in API requests. By default, fields with 3633 // empty values are omitted from API requests. However, any non-pointer, 3634 // non-interface field appearing in ForceSendFields will be sent to the 3635 // server regardless of whether the field is empty or not. This may be 3636 // used to include empty fields in Patch requests. 3637 ForceSendFields []string `json:"-"` 3638 3639 // NullFields is a list of field names (e.g. "Kind") to include in API 3640 // requests with the JSON null value. By default, fields with empty 3641 // values are omitted from API requests. However, any field with an 3642 // empty value appearing in NullFields will be sent to the server as 3643 // null. It is an error if a field in this list has a non-empty value. 3644 // This may be used to include null fields in Patch requests. 3645 NullFields []string `json:"-"` 3646} 3647 3648func (s *RoomAutoMatchStatus) MarshalJSON() ([]byte, error) { 3649 type NoMethod RoomAutoMatchStatus 3650 raw := NoMethod(*s) 3651 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3652} 3653 3654// RoomAutoMatchingCriteria: This is a JSON template for a room 3655// auto-match criteria object. 3656type RoomAutoMatchingCriteria struct { 3657 // ExclusiveBitmask: A bitmask indicating when auto-matches are valid. 3658 // When ANDed with other exclusive bitmasks, the result must be zero. 3659 // Can be used to support exclusive roles within a game. 3660 ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"` 3661 3662 // Kind: Uniquely identifies the type of this resource. Value is always 3663 // the fixed string games#roomAutoMatchingCriteria. 3664 Kind string `json:"kind,omitempty"` 3665 3666 // MaxAutoMatchingPlayers: The maximum number of players that should be 3667 // added to the room by auto-matching. 3668 MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"` 3669 3670 // MinAutoMatchingPlayers: The minimum number of players that should be 3671 // added to the room by auto-matching. 3672 MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"` 3673 3674 // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to 3675 // unconditionally include in API requests. By default, fields with 3676 // empty values are omitted from API requests. However, any non-pointer, 3677 // non-interface field appearing in ForceSendFields will be sent to the 3678 // server regardless of whether the field is empty or not. This may be 3679 // used to include empty fields in Patch requests. 3680 ForceSendFields []string `json:"-"` 3681 3682 // NullFields is a list of field names (e.g. "ExclusiveBitmask") to 3683 // include in API requests with the JSON null value. By default, fields 3684 // with empty values are omitted from API requests. However, any field 3685 // with an empty value appearing in NullFields will be sent to the 3686 // server as null. It is an error if a field in this list has a 3687 // non-empty value. This may be used to include null fields in Patch 3688 // requests. 3689 NullFields []string `json:"-"` 3690} 3691 3692func (s *RoomAutoMatchingCriteria) MarshalJSON() ([]byte, error) { 3693 type NoMethod RoomAutoMatchingCriteria 3694 raw := NoMethod(*s) 3695 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3696} 3697 3698// RoomClientAddress: This is a JSON template for the client address 3699// when setting up a room. 3700type RoomClientAddress struct { 3701 // Kind: Uniquely identifies the type of this resource. Value is always 3702 // the fixed string games#roomClientAddress. 3703 Kind string `json:"kind,omitempty"` 3704 3705 // XmppAddress: The XMPP address of the client on the Google Games XMPP 3706 // network. 3707 XmppAddress string `json:"xmppAddress,omitempty"` 3708 3709 // ForceSendFields is a list of field names (e.g. "Kind") to 3710 // unconditionally include in API requests. By default, fields with 3711 // empty values are omitted from API requests. However, any non-pointer, 3712 // non-interface field appearing in ForceSendFields will be sent to the 3713 // server regardless of whether the field is empty or not. This may be 3714 // used to include empty fields in Patch requests. 3715 ForceSendFields []string `json:"-"` 3716 3717 // NullFields is a list of field names (e.g. "Kind") to include in API 3718 // requests with the JSON null value. By default, fields with empty 3719 // values are omitted from API requests. However, any field with an 3720 // empty value appearing in NullFields will be sent to the server as 3721 // null. It is an error if a field in this list has a non-empty value. 3722 // This may be used to include null fields in Patch requests. 3723 NullFields []string `json:"-"` 3724} 3725 3726func (s *RoomClientAddress) MarshalJSON() ([]byte, error) { 3727 type NoMethod RoomClientAddress 3728 raw := NoMethod(*s) 3729 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3730} 3731 3732// RoomCreateRequest: This is a JSON template for a room creation 3733// request. 3734type RoomCreateRequest struct { 3735 // AutoMatchingCriteria: Criteria for auto-matching players into this 3736 // room. 3737 AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` 3738 3739 // Capabilities: The capabilities that this client supports for realtime 3740 // communication. 3741 Capabilities []string `json:"capabilities,omitempty"` 3742 3743 // ClientAddress: Client address for the player creating the room. 3744 ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` 3745 3746 // InvitedPlayerIds: The player IDs to invite to the room. 3747 InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"` 3748 3749 // Kind: Uniquely identifies the type of this resource. Value is always 3750 // the fixed string games#roomCreateRequest. 3751 Kind string `json:"kind,omitempty"` 3752 3753 // NetworkDiagnostics: Network diagnostics for the client creating the 3754 // room. 3755 NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"` 3756 3757 // RequestId: A randomly generated numeric ID. This number is used at 3758 // the server to ensure that the request is handled correctly across 3759 // retries. 3760 RequestId int64 `json:"requestId,omitempty,string"` 3761 3762 // Variant: The variant / mode of the application to be played. This can 3763 // be any integer value, or left blank. You should use a small number of 3764 // variants to keep the auto-matching pool as large as possible. 3765 Variant int64 `json:"variant,omitempty"` 3766 3767 // ForceSendFields is a list of field names (e.g. 3768 // "AutoMatchingCriteria") to unconditionally include in API requests. 3769 // By default, fields with empty values are omitted from API requests. 3770 // However, any non-pointer, non-interface field appearing in 3771 // ForceSendFields will be sent to the server regardless of whether the 3772 // field is empty or not. This may be used to include empty fields in 3773 // Patch requests. 3774 ForceSendFields []string `json:"-"` 3775 3776 // NullFields is a list of field names (e.g. "AutoMatchingCriteria") to 3777 // include in API requests with the JSON null value. By default, fields 3778 // with empty values are omitted from API requests. However, any field 3779 // with an empty value appearing in NullFields will be sent to the 3780 // server as null. It is an error if a field in this list has a 3781 // non-empty value. This may be used to include null fields in Patch 3782 // requests. 3783 NullFields []string `json:"-"` 3784} 3785 3786func (s *RoomCreateRequest) MarshalJSON() ([]byte, error) { 3787 type NoMethod RoomCreateRequest 3788 raw := NoMethod(*s) 3789 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3790} 3791 3792// RoomJoinRequest: This is a JSON template for a join room request. 3793type RoomJoinRequest struct { 3794 // Capabilities: The capabilities that this client supports for realtime 3795 // communication. 3796 Capabilities []string `json:"capabilities,omitempty"` 3797 3798 // ClientAddress: Client address for the player joining the room. 3799 ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` 3800 3801 // Kind: Uniquely identifies the type of this resource. Value is always 3802 // the fixed string games#roomJoinRequest. 3803 Kind string `json:"kind,omitempty"` 3804 3805 // NetworkDiagnostics: Network diagnostics for the client joining the 3806 // room. 3807 NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"` 3808 3809 // ForceSendFields is a list of field names (e.g. "Capabilities") to 3810 // unconditionally include in API requests. By default, fields with 3811 // empty values are omitted from API requests. However, any non-pointer, 3812 // non-interface field appearing in ForceSendFields will be sent to the 3813 // server regardless of whether the field is empty or not. This may be 3814 // used to include empty fields in Patch requests. 3815 ForceSendFields []string `json:"-"` 3816 3817 // NullFields is a list of field names (e.g. "Capabilities") to include 3818 // in API requests with the JSON null value. By default, fields with 3819 // empty values are omitted from API requests. However, any field with 3820 // an empty value appearing in NullFields will be sent to the server as 3821 // null. It is an error if a field in this list has a non-empty value. 3822 // This may be used to include null fields in Patch requests. 3823 NullFields []string `json:"-"` 3824} 3825 3826func (s *RoomJoinRequest) MarshalJSON() ([]byte, error) { 3827 type NoMethod RoomJoinRequest 3828 raw := NoMethod(*s) 3829 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3830} 3831 3832// RoomLeaveDiagnostics: This is a JSON template for room leave 3833// diagnostics. 3834type RoomLeaveDiagnostics struct { 3835 // AndroidNetworkSubtype: Android network subtype. 3836 // http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype() 3837 AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"` 3838 3839 // AndroidNetworkType: Android network type. 3840 // http://developer.android.com/reference/android/net/NetworkInfo.html#getType() 3841 AndroidNetworkType int64 `json:"androidNetworkType,omitempty"` 3842 3843 // IosNetworkType: iOS network type as defined in Reachability.h. 3844 IosNetworkType int64 `json:"iosNetworkType,omitempty"` 3845 3846 // Kind: Uniquely identifies the type of this resource. Value is always 3847 // the fixed string games#roomLeaveDiagnostics. 3848 Kind string `json:"kind,omitempty"` 3849 3850 // NetworkOperatorCode: The MCC+MNC code for the client's network 3851 // connection. On Android: 3852 // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: 3853 // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html 3854 NetworkOperatorCode string `json:"networkOperatorCode,omitempty"` 3855 3856 // NetworkOperatorName: The name of the carrier of the client's network 3857 // connection. On Android: 3858 // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: 3859 // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName 3860 NetworkOperatorName string `json:"networkOperatorName,omitempty"` 3861 3862 // PeerSession: Diagnostics about all peer sessions. 3863 PeerSession []*PeerSessionDiagnostics `json:"peerSession,omitempty"` 3864 3865 // SocketsUsed: Whether or not sockets were used. 3866 SocketsUsed bool `json:"socketsUsed,omitempty"` 3867 3868 // ForceSendFields is a list of field names (e.g. 3869 // "AndroidNetworkSubtype") to unconditionally include in API requests. 3870 // By default, fields with empty values are omitted from API requests. 3871 // However, any non-pointer, non-interface field appearing in 3872 // ForceSendFields will be sent to the server regardless of whether the 3873 // field is empty or not. This may be used to include empty fields in 3874 // Patch requests. 3875 ForceSendFields []string `json:"-"` 3876 3877 // NullFields is a list of field names (e.g. "AndroidNetworkSubtype") to 3878 // include in API requests with the JSON null value. By default, fields 3879 // with empty values are omitted from API requests. However, any field 3880 // with an empty value appearing in NullFields will be sent to the 3881 // server as null. It is an error if a field in this list has a 3882 // non-empty value. This may be used to include null fields in Patch 3883 // requests. 3884 NullFields []string `json:"-"` 3885} 3886 3887func (s *RoomLeaveDiagnostics) MarshalJSON() ([]byte, error) { 3888 type NoMethod RoomLeaveDiagnostics 3889 raw := NoMethod(*s) 3890 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3891} 3892 3893// RoomLeaveRequest: This is a JSON template for a leave room request. 3894type RoomLeaveRequest struct { 3895 // Kind: Uniquely identifies the type of this resource. Value is always 3896 // the fixed string games#roomLeaveRequest. 3897 Kind string `json:"kind,omitempty"` 3898 3899 // LeaveDiagnostics: Diagnostics for a player leaving the room. 3900 LeaveDiagnostics *RoomLeaveDiagnostics `json:"leaveDiagnostics,omitempty"` 3901 3902 // Reason: Reason for leaving the match. 3903 // Possible values are: 3904 // - "PLAYER_LEFT" - The player chose to leave the room.. 3905 // - "GAME_LEFT" - The game chose to remove the player from the room. 3906 // - "REALTIME_ABANDONED" - The player switched to another application 3907 // and abandoned the room. 3908 // - "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to 3909 // establish a connection to other peer(s). 3910 // - "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to 3911 // communicate with the server. 3912 // - "REALTIME_SERVER_ERROR" - The client received an error response 3913 // when it tried to communicate with the server. 3914 // - "REALTIME_TIMEOUT" - The client timed out while waiting for a room. 3915 // 3916 // - "REALTIME_CLIENT_DISCONNECTING" - The client disconnects without 3917 // first calling Leave. 3918 // - "REALTIME_SIGN_OUT" - The user signed out of G+ while in the room. 3919 // 3920 // - "REALTIME_GAME_CRASHED" - The game crashed. 3921 // - "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed. 3922 // - "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is 3923 // trying to enter a room. 3924 // - "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is trying 3925 // to enter a new room. 3926 Reason string `json:"reason,omitempty"` 3927 3928 // ForceSendFields is a list of field names (e.g. "Kind") to 3929 // unconditionally include in API requests. By default, fields with 3930 // empty values are omitted from API requests. However, any non-pointer, 3931 // non-interface field appearing in ForceSendFields will be sent to the 3932 // server regardless of whether the field is empty or not. This may be 3933 // used to include empty fields in Patch requests. 3934 ForceSendFields []string `json:"-"` 3935 3936 // NullFields is a list of field names (e.g. "Kind") to include in API 3937 // requests with the JSON null value. By default, fields with empty 3938 // values are omitted from API requests. However, any field with an 3939 // empty value appearing in NullFields will be sent to the server as 3940 // null. It is an error if a field in this list has a non-empty value. 3941 // This may be used to include null fields in Patch requests. 3942 NullFields []string `json:"-"` 3943} 3944 3945func (s *RoomLeaveRequest) MarshalJSON() ([]byte, error) { 3946 type NoMethod RoomLeaveRequest 3947 raw := NoMethod(*s) 3948 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3949} 3950 3951// RoomList: This is a JSON template for a list of rooms. 3952type RoomList struct { 3953 // Items: The rooms. 3954 Items []*Room `json:"items,omitempty"` 3955 3956 // Kind: Uniquely identifies the type of this resource. Value is always 3957 // the fixed string games#roomList. 3958 Kind string `json:"kind,omitempty"` 3959 3960 // NextPageToken: The pagination token for the next page of results. 3961 NextPageToken string `json:"nextPageToken,omitempty"` 3962 3963 // ServerResponse contains the HTTP response code and headers from the 3964 // server. 3965 googleapi.ServerResponse `json:"-"` 3966 3967 // ForceSendFields is a list of field names (e.g. "Items") to 3968 // unconditionally include in API requests. By default, fields with 3969 // empty values are omitted from API requests. However, any non-pointer, 3970 // non-interface field appearing in ForceSendFields will be sent to the 3971 // server regardless of whether the field is empty or not. This may be 3972 // used to include empty fields in Patch requests. 3973 ForceSendFields []string `json:"-"` 3974 3975 // NullFields is a list of field names (e.g. "Items") to include in API 3976 // requests with the JSON null value. By default, fields with empty 3977 // values are omitted from API requests. However, any field with an 3978 // empty value appearing in NullFields will be sent to the server as 3979 // null. It is an error if a field in this list has a non-empty value. 3980 // This may be used to include null fields in Patch requests. 3981 NullFields []string `json:"-"` 3982} 3983 3984func (s *RoomList) MarshalJSON() ([]byte, error) { 3985 type NoMethod RoomList 3986 raw := NoMethod(*s) 3987 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3988} 3989 3990// RoomModification: This is a JSON template for room modification 3991// metadata. 3992type RoomModification struct { 3993 // Kind: Uniquely identifies the type of this resource. Value is always 3994 // the fixed string games#roomModification. 3995 Kind string `json:"kind,omitempty"` 3996 3997 // ModifiedTimestampMillis: The timestamp at which they modified the 3998 // room, in milliseconds since the epoch in UTC. 3999 ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"` 4000 4001 // ParticipantId: The ID of the participant that modified the room. 4002 ParticipantId string `json:"participantId,omitempty"` 4003 4004 // ForceSendFields is a list of field names (e.g. "Kind") to 4005 // unconditionally include in API requests. By default, fields with 4006 // empty values are omitted from API requests. However, any non-pointer, 4007 // non-interface field appearing in ForceSendFields will be sent to the 4008 // server regardless of whether the field is empty or not. This may be 4009 // used to include empty fields in Patch requests. 4010 ForceSendFields []string `json:"-"` 4011 4012 // NullFields is a list of field names (e.g. "Kind") to include in API 4013 // requests with the JSON null value. By default, fields with empty 4014 // values are omitted from API requests. However, any field with an 4015 // empty value appearing in NullFields will be sent to the server as 4016 // null. It is an error if a field in this list has a non-empty value. 4017 // This may be used to include null fields in Patch requests. 4018 NullFields []string `json:"-"` 4019} 4020 4021func (s *RoomModification) MarshalJSON() ([]byte, error) { 4022 type NoMethod RoomModification 4023 raw := NoMethod(*s) 4024 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4025} 4026 4027// RoomP2PStatus: This is a JSON template for an update on the status of 4028// a peer in a room. 4029type RoomP2PStatus struct { 4030 // ConnectionSetupLatencyMillis: The amount of time in milliseconds it 4031 // took to establish connections with this peer. 4032 ConnectionSetupLatencyMillis int64 `json:"connectionSetupLatencyMillis,omitempty"` 4033 4034 // Error: The error code in event of a failure. 4035 // Possible values are: 4036 // - "P2P_FAILED" - The client failed to establish a P2P connection with 4037 // the peer. 4038 // - "PRESENCE_FAILED" - The client failed to register to receive P2P 4039 // connections. 4040 // - "RELAY_SERVER_FAILED" - The client received an error when trying to 4041 // use the relay server to establish a P2P connection with the peer. 4042 Error string `json:"error,omitempty"` 4043 4044 // ErrorReason: More detailed diagnostic message returned in event of a 4045 // failure. 4046 ErrorReason string `json:"error_reason,omitempty"` 4047 4048 // Kind: Uniquely identifies the type of this resource. Value is always 4049 // the fixed string games#roomP2PStatus. 4050 Kind string `json:"kind,omitempty"` 4051 4052 // ParticipantId: The ID of the participant. 4053 ParticipantId string `json:"participantId,omitempty"` 4054 4055 // Status: The status of the peer in the room. 4056 // Possible values are: 4057 // - "CONNECTION_ESTABLISHED" - The client established a P2P connection 4058 // with the peer. 4059 // - "CONNECTION_FAILED" - The client failed to establish directed 4060 // presence with the peer. 4061 Status string `json:"status,omitempty"` 4062 4063 // UnreliableRoundtripLatencyMillis: The amount of time in milliseconds 4064 // it took to send packets back and forth on the unreliable channel with 4065 // this peer. 4066 UnreliableRoundtripLatencyMillis int64 `json:"unreliableRoundtripLatencyMillis,omitempty"` 4067 4068 // ForceSendFields is a list of field names (e.g. 4069 // "ConnectionSetupLatencyMillis") to unconditionally include in API 4070 // requests. By default, fields with empty values are omitted from API 4071 // requests. However, any non-pointer, non-interface field appearing in 4072 // ForceSendFields will be sent to the server regardless of whether the 4073 // field is empty or not. This may be used to include empty fields in 4074 // Patch requests. 4075 ForceSendFields []string `json:"-"` 4076 4077 // NullFields is a list of field names (e.g. 4078 // "ConnectionSetupLatencyMillis") to include in API requests with the 4079 // JSON null value. By default, fields with empty values are omitted 4080 // from API requests. However, any field with an empty value appearing 4081 // in NullFields will be sent to the server as null. It is an error if a 4082 // field in this list has a non-empty value. This may be used to include 4083 // null fields in Patch requests. 4084 NullFields []string `json:"-"` 4085} 4086 4087func (s *RoomP2PStatus) MarshalJSON() ([]byte, error) { 4088 type NoMethod RoomP2PStatus 4089 raw := NoMethod(*s) 4090 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4091} 4092 4093// RoomP2PStatuses: This is a JSON template for an update on the status 4094// of peers in a room. 4095type RoomP2PStatuses struct { 4096 // Kind: Uniquely identifies the type of this resource. Value is always 4097 // the fixed string games#roomP2PStatuses. 4098 Kind string `json:"kind,omitempty"` 4099 4100 // Updates: The updates for the peers. 4101 Updates []*RoomP2PStatus `json:"updates,omitempty"` 4102 4103 // ForceSendFields is a list of field names (e.g. "Kind") to 4104 // unconditionally include in API requests. By default, fields with 4105 // empty values are omitted from API requests. However, any non-pointer, 4106 // non-interface field appearing in ForceSendFields will be sent to the 4107 // server regardless of whether the field is empty or not. This may be 4108 // used to include empty fields in Patch requests. 4109 ForceSendFields []string `json:"-"` 4110 4111 // NullFields is a list of field names (e.g. "Kind") to include in API 4112 // requests with the JSON null value. By default, fields with empty 4113 // values are omitted from API requests. However, any field with an 4114 // empty value appearing in NullFields will be sent to the server as 4115 // null. It is an error if a field in this list has a non-empty value. 4116 // This may be used to include null fields in Patch requests. 4117 NullFields []string `json:"-"` 4118} 4119 4120func (s *RoomP2PStatuses) MarshalJSON() ([]byte, error) { 4121 type NoMethod RoomP2PStatuses 4122 raw := NoMethod(*s) 4123 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4124} 4125 4126// RoomParticipant: This is a JSON template for a participant in a room. 4127type RoomParticipant struct { 4128 // AutoMatched: True if this participant was auto-matched with the 4129 // requesting player. 4130 AutoMatched bool `json:"autoMatched,omitempty"` 4131 4132 // AutoMatchedPlayer: Information about a player that has been 4133 // anonymously auto-matched against the requesting player. (Either 4134 // player or autoMatchedPlayer will be set.) 4135 AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"` 4136 4137 // Capabilities: The capabilities which can be used when communicating 4138 // with this participant. 4139 Capabilities []string `json:"capabilities,omitempty"` 4140 4141 // ClientAddress: Client address for the participant. 4142 ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` 4143 4144 // Connected: True if this participant is in the fully connected set of 4145 // peers in the room. 4146 Connected bool `json:"connected,omitempty"` 4147 4148 // Id: An identifier for the participant in the scope of the room. 4149 // Cannot be used to identify a player across rooms or in other 4150 // contexts. 4151 Id string `json:"id,omitempty"` 4152 4153 // Kind: Uniquely identifies the type of this resource. Value is always 4154 // the fixed string games#roomParticipant. 4155 Kind string `json:"kind,omitempty"` 4156 4157 // LeaveReason: The reason the participant left the room; populated if 4158 // the participant status is PARTICIPANT_LEFT. 4159 // Possible values are: 4160 // - "PLAYER_LEFT" - The player explicitly chose to leave the room. 4161 // - "GAME_LEFT" - The game chose to remove the player from the room. 4162 // - "ABANDONED" - The player switched to another application and 4163 // abandoned the room. 4164 // - "PEER_CONNECTION_FAILURE" - The client was unable to establish or 4165 // maintain a connection to other peer(s) in the room. 4166 // - "SERVER_ERROR" - The client received an error response when it 4167 // tried to communicate with the server. 4168 // - "TIMEOUT" - The client timed out while waiting for players to join 4169 // and connect. 4170 // - "PRESENCE_FAILURE" - The client's XMPP connection ended abruptly. 4171 LeaveReason string `json:"leaveReason,omitempty"` 4172 4173 // Player: Information about the player. Not populated if this player 4174 // was anonymously auto-matched against the requesting player. (Either 4175 // player or autoMatchedPlayer will be set.) 4176 Player *Player `json:"player,omitempty"` 4177 4178 // Status: The status of the participant with respect to the 4179 // room. 4180 // Possible values are: 4181 // - "PARTICIPANT_INVITED" - The participant has been invited to join 4182 // the room, but has not yet responded. 4183 // - "PARTICIPANT_JOINED" - The participant has joined the room (either 4184 // after creating it or accepting an invitation.) 4185 // - "PARTICIPANT_DECLINED" - The participant declined an invitation to 4186 // join the room. 4187 // - "PARTICIPANT_LEFT" - The participant joined the room and then left 4188 // it. 4189 Status string `json:"status,omitempty"` 4190 4191 // ForceSendFields is a list of field names (e.g. "AutoMatched") to 4192 // unconditionally include in API requests. By default, fields with 4193 // empty values are omitted from API requests. However, any non-pointer, 4194 // non-interface field appearing in ForceSendFields will be sent to the 4195 // server regardless of whether the field is empty or not. This may be 4196 // used to include empty fields in Patch requests. 4197 ForceSendFields []string `json:"-"` 4198 4199 // NullFields is a list of field names (e.g. "AutoMatched") to include 4200 // in API requests with the JSON null value. By default, fields with 4201 // empty values are omitted from API requests. However, any field with 4202 // an empty value appearing in NullFields will be sent to the server as 4203 // null. It is an error if a field in this list has a non-empty value. 4204 // This may be used to include null fields in Patch requests. 4205 NullFields []string `json:"-"` 4206} 4207 4208func (s *RoomParticipant) MarshalJSON() ([]byte, error) { 4209 type NoMethod RoomParticipant 4210 raw := NoMethod(*s) 4211 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4212} 4213 4214// RoomStatus: This is a JSON template for the status of a room that the 4215// player has joined. 4216type RoomStatus struct { 4217 // AutoMatchingStatus: Auto-matching status for this room. Not set if 4218 // the room is not currently in the automatching queue. 4219 AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"` 4220 4221 // Kind: Uniquely identifies the type of this resource. Value is always 4222 // the fixed string games#roomStatus. 4223 Kind string `json:"kind,omitempty"` 4224 4225 // Participants: The participants involved in the room, along with their 4226 // statuses. Includes participants who have left or declined 4227 // invitations. 4228 Participants []*RoomParticipant `json:"participants,omitempty"` 4229 4230 // RoomId: Globally unique ID for a room. 4231 RoomId string `json:"roomId,omitempty"` 4232 4233 // Status: The status of the room. 4234 // Possible values are: 4235 // - "ROOM_INVITING" - One or more players have been invited and not 4236 // responded. 4237 // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by 4238 // auto-matching. 4239 // - "ROOM_CONNECTING" - Players have joined are connecting to each 4240 // other (either before or after auto-matching). 4241 // - "ROOM_ACTIVE" - All players have joined and connected to each 4242 // other. 4243 // - "ROOM_DELETED" - All joined players have left. 4244 Status string `json:"status,omitempty"` 4245 4246 // StatusVersion: The version of the status for the room: an increasing 4247 // counter, used by the client to ignore out-of-order updates to room 4248 // status. 4249 StatusVersion int64 `json:"statusVersion,omitempty"` 4250 4251 // ServerResponse contains the HTTP response code and headers from the 4252 // server. 4253 googleapi.ServerResponse `json:"-"` 4254 4255 // ForceSendFields is a list of field names (e.g. "AutoMatchingStatus") 4256 // to unconditionally include in API requests. By default, fields with 4257 // empty values are omitted from API requests. However, any non-pointer, 4258 // non-interface field appearing in ForceSendFields will be sent to the 4259 // server regardless of whether the field is empty or not. This may be 4260 // used to include empty fields in Patch requests. 4261 ForceSendFields []string `json:"-"` 4262 4263 // NullFields is a list of field names (e.g. "AutoMatchingStatus") to 4264 // include in API requests with the JSON null value. By default, fields 4265 // with empty values are omitted from API requests. However, any field 4266 // with an empty value appearing in NullFields will be sent to the 4267 // server as null. It is an error if a field in this list has a 4268 // non-empty value. This may be used to include null fields in Patch 4269 // requests. 4270 NullFields []string `json:"-"` 4271} 4272 4273func (s *RoomStatus) MarshalJSON() ([]byte, error) { 4274 type NoMethod RoomStatus 4275 raw := NoMethod(*s) 4276 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4277} 4278 4279// ScoreSubmission: This is a JSON template for a request to submit a 4280// score to leaderboards. 4281type ScoreSubmission struct { 4282 // Kind: Uniquely identifies the type of this resource. Value is always 4283 // the fixed string games#scoreSubmission. 4284 Kind string `json:"kind,omitempty"` 4285 4286 // LeaderboardId: The leaderboard this score is being submitted to. 4287 LeaderboardId string `json:"leaderboardId,omitempty"` 4288 4289 // Score: The new score being submitted. 4290 Score int64 `json:"score,omitempty,string"` 4291 4292 // ScoreTag: Additional information about this score. Values will 4293 // contain no more than 64 URI-safe characters as defined by section 2.3 4294 // of RFC 3986. 4295 ScoreTag string `json:"scoreTag,omitempty"` 4296 4297 // Signature: Signature Values will contain URI-safe characters as 4298 // defined by section 2.3 of RFC 3986. 4299 Signature string `json:"signature,omitempty"` 4300 4301 // ForceSendFields is a list of field names (e.g. "Kind") to 4302 // unconditionally include in API requests. By default, fields with 4303 // empty values are omitted from API requests. However, any non-pointer, 4304 // non-interface field appearing in ForceSendFields will be sent to the 4305 // server regardless of whether the field is empty or not. This may be 4306 // used to include empty fields in Patch requests. 4307 ForceSendFields []string `json:"-"` 4308 4309 // NullFields is a list of field names (e.g. "Kind") to include in API 4310 // requests with the JSON null value. By default, fields with empty 4311 // values are omitted from API requests. However, any field with an 4312 // empty value appearing in NullFields will be sent to the server as 4313 // null. It is an error if a field in this list has a non-empty value. 4314 // This may be used to include null fields in Patch requests. 4315 NullFields []string `json:"-"` 4316} 4317 4318func (s *ScoreSubmission) MarshalJSON() ([]byte, error) { 4319 type NoMethod ScoreSubmission 4320 raw := NoMethod(*s) 4321 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4322} 4323 4324// Snapshot: This is a JSON template for an snapshot object. 4325type Snapshot struct { 4326 // CoverImage: The cover image of this snapshot. May be absent if there 4327 // is no image. 4328 CoverImage *SnapshotImage `json:"coverImage,omitempty"` 4329 4330 // Description: The description of this snapshot. 4331 Description string `json:"description,omitempty"` 4332 4333 // DriveId: The ID of the file underlying this snapshot in the Drive 4334 // API. Only present if the snapshot is a view on a Drive file and the 4335 // file is owned by the caller. 4336 DriveId string `json:"driveId,omitempty"` 4337 4338 // DurationMillis: The duration associated with this snapshot, in 4339 // millis. 4340 DurationMillis int64 `json:"durationMillis,omitempty,string"` 4341 4342 // Id: The ID of the snapshot. 4343 Id string `json:"id,omitempty"` 4344 4345 // Kind: Uniquely identifies the type of this resource. Value is always 4346 // the fixed string games#snapshot. 4347 Kind string `json:"kind,omitempty"` 4348 4349 // LastModifiedMillis: The timestamp (in millis since Unix epoch) of the 4350 // last modification to this snapshot. 4351 LastModifiedMillis int64 `json:"lastModifiedMillis,omitempty,string"` 4352 4353 // ProgressValue: The progress value (64-bit integer set by developer) 4354 // associated with this snapshot. 4355 ProgressValue int64 `json:"progressValue,omitempty,string"` 4356 4357 // Title: The title of this snapshot. 4358 Title string `json:"title,omitempty"` 4359 4360 // Type: The type of this snapshot. 4361 // Possible values are: 4362 // - "SAVE_GAME" - A snapshot representing a save game. 4363 Type string `json:"type,omitempty"` 4364 4365 // UniqueName: The unique name provided when the snapshot was created. 4366 UniqueName string `json:"uniqueName,omitempty"` 4367 4368 // ServerResponse contains the HTTP response code and headers from the 4369 // server. 4370 googleapi.ServerResponse `json:"-"` 4371 4372 // ForceSendFields is a list of field names (e.g. "CoverImage") to 4373 // unconditionally include in API requests. By default, fields with 4374 // empty values are omitted from API requests. However, any non-pointer, 4375 // non-interface field appearing in ForceSendFields will be sent to the 4376 // server regardless of whether the field is empty or not. This may be 4377 // used to include empty fields in Patch requests. 4378 ForceSendFields []string `json:"-"` 4379 4380 // NullFields is a list of field names (e.g. "CoverImage") to include in 4381 // API requests with the JSON null value. By default, fields with empty 4382 // values are omitted from API requests. However, any field with an 4383 // empty value appearing in NullFields will be sent to the server as 4384 // null. It is an error if a field in this list has a non-empty value. 4385 // This may be used to include null fields in Patch requests. 4386 NullFields []string `json:"-"` 4387} 4388 4389func (s *Snapshot) MarshalJSON() ([]byte, error) { 4390 type NoMethod Snapshot 4391 raw := NoMethod(*s) 4392 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4393} 4394 4395// SnapshotImage: This is a JSON template for an image of a snapshot. 4396type SnapshotImage struct { 4397 // Height: The height of the image. 4398 Height int64 `json:"height,omitempty"` 4399 4400 // Kind: Uniquely identifies the type of this resource. Value is always 4401 // the fixed string games#snapshotImage. 4402 Kind string `json:"kind,omitempty"` 4403 4404 // MimeType: The MIME type of the image. 4405 MimeType string `json:"mime_type,omitempty"` 4406 4407 // Url: The URL of the image. This URL may be invalidated at any time 4408 // and should not be cached. 4409 Url string `json:"url,omitempty"` 4410 4411 // Width: The width of the image. 4412 Width int64 `json:"width,omitempty"` 4413 4414 // ForceSendFields is a list of field names (e.g. "Height") to 4415 // unconditionally include in API requests. By default, fields with 4416 // empty values are omitted from API requests. However, any non-pointer, 4417 // non-interface field appearing in ForceSendFields will be sent to the 4418 // server regardless of whether the field is empty or not. This may be 4419 // used to include empty fields in Patch requests. 4420 ForceSendFields []string `json:"-"` 4421 4422 // NullFields is a list of field names (e.g. "Height") to include in API 4423 // requests with the JSON null value. By default, fields with empty 4424 // values are omitted from API requests. However, any field with an 4425 // empty value appearing in NullFields will be sent to the server as 4426 // null. It is an error if a field in this list has a non-empty value. 4427 // This may be used to include null fields in Patch requests. 4428 NullFields []string `json:"-"` 4429} 4430 4431func (s *SnapshotImage) MarshalJSON() ([]byte, error) { 4432 type NoMethod SnapshotImage 4433 raw := NoMethod(*s) 4434 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4435} 4436 4437// SnapshotListResponse: This is a JSON template for a list of snapshot 4438// objects. 4439type SnapshotListResponse struct { 4440 // Items: The snapshots. 4441 Items []*Snapshot `json:"items,omitempty"` 4442 4443 // Kind: Uniquely identifies the type of this resource. Value is always 4444 // the fixed string games#snapshotListResponse. 4445 Kind string `json:"kind,omitempty"` 4446 4447 // NextPageToken: Token corresponding to the next page of results. If 4448 // there are no more results, the token is omitted. 4449 NextPageToken string `json:"nextPageToken,omitempty"` 4450 4451 // ServerResponse contains the HTTP response code and headers from the 4452 // server. 4453 googleapi.ServerResponse `json:"-"` 4454 4455 // ForceSendFields is a list of field names (e.g. "Items") to 4456 // unconditionally include in API requests. By default, fields with 4457 // empty values are omitted from API requests. However, any non-pointer, 4458 // non-interface field appearing in ForceSendFields will be sent to the 4459 // server regardless of whether the field is empty or not. This may be 4460 // used to include empty fields in Patch requests. 4461 ForceSendFields []string `json:"-"` 4462 4463 // NullFields is a list of field names (e.g. "Items") to include in API 4464 // requests with the JSON null value. By default, fields with empty 4465 // values are omitted from API requests. However, any field with an 4466 // empty value appearing in NullFields will be sent to the server as 4467 // null. It is an error if a field in this list has a non-empty value. 4468 // This may be used to include null fields in Patch requests. 4469 NullFields []string `json:"-"` 4470} 4471 4472func (s *SnapshotListResponse) MarshalJSON() ([]byte, error) { 4473 type NoMethod SnapshotListResponse 4474 raw := NoMethod(*s) 4475 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4476} 4477 4478// TurnBasedAutoMatchingCriteria: This is a JSON template for an 4479// turn-based auto-match criteria object. 4480type TurnBasedAutoMatchingCriteria struct { 4481 // ExclusiveBitmask: A bitmask indicating when auto-matches are valid. 4482 // When ANDed with other exclusive bitmasks, the result must be zero. 4483 // Can be used to support exclusive roles within a game. 4484 ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"` 4485 4486 // Kind: Uniquely identifies the type of this resource. Value is always 4487 // the fixed string games#turnBasedAutoMatchingCriteria. 4488 Kind string `json:"kind,omitempty"` 4489 4490 // MaxAutoMatchingPlayers: The maximum number of players that should be 4491 // added to the match by auto-matching. 4492 MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"` 4493 4494 // MinAutoMatchingPlayers: The minimum number of players that should be 4495 // added to the match by auto-matching. 4496 MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"` 4497 4498 // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to 4499 // unconditionally include in API requests. By default, fields with 4500 // empty values are omitted from API requests. However, any non-pointer, 4501 // non-interface field appearing in ForceSendFields will be sent to the 4502 // server regardless of whether the field is empty or not. This may be 4503 // used to include empty fields in Patch requests. 4504 ForceSendFields []string `json:"-"` 4505 4506 // NullFields is a list of field names (e.g. "ExclusiveBitmask") to 4507 // include in API requests with the JSON null value. By default, fields 4508 // with empty values are omitted from API requests. However, any field 4509 // with an empty value appearing in NullFields will be sent to the 4510 // server as null. It is an error if a field in this list has a 4511 // non-empty value. This may be used to include null fields in Patch 4512 // requests. 4513 NullFields []string `json:"-"` 4514} 4515 4516func (s *TurnBasedAutoMatchingCriteria) MarshalJSON() ([]byte, error) { 4517 type NoMethod TurnBasedAutoMatchingCriteria 4518 raw := NoMethod(*s) 4519 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4520} 4521 4522// TurnBasedMatch: This is a JSON template for a turn-based match 4523// resource object. 4524type TurnBasedMatch struct { 4525 // ApplicationId: The ID of the application being played. 4526 ApplicationId string `json:"applicationId,omitempty"` 4527 4528 // AutoMatchingCriteria: Criteria for auto-matching players into this 4529 // match. 4530 AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` 4531 4532 // CreationDetails: Details about the match creation. 4533 CreationDetails *TurnBasedMatchModification `json:"creationDetails,omitempty"` 4534 4535 // Data: The data / game state for this match. 4536 Data *TurnBasedMatchData `json:"data,omitempty"` 4537 4538 // Description: This short description is generated by our servers based 4539 // on turn state and is localized and worded relative to the player 4540 // requesting the match. It is intended to be displayed when the match 4541 // is shown in a list. 4542 Description string `json:"description,omitempty"` 4543 4544 // InviterId: The ID of the participant that invited the user to the 4545 // match. Not set if the user was not invited to the match. 4546 InviterId string `json:"inviterId,omitempty"` 4547 4548 // Kind: Uniquely identifies the type of this resource. Value is always 4549 // the fixed string games#turnBasedMatch. 4550 Kind string `json:"kind,omitempty"` 4551 4552 // LastUpdateDetails: Details about the last update to the match. 4553 LastUpdateDetails *TurnBasedMatchModification `json:"lastUpdateDetails,omitempty"` 4554 4555 // MatchId: Globally unique ID for a turn-based match. 4556 MatchId string `json:"matchId,omitempty"` 4557 4558 // MatchNumber: The number of the match in a chain of rematches. Will be 4559 // set to 1 for the first match and incremented by 1 for each rematch. 4560 MatchNumber int64 `json:"matchNumber,omitempty"` 4561 4562 // MatchVersion: The version of this match: an increasing counter, used 4563 // to avoid out-of-date updates to the match. 4564 MatchVersion int64 `json:"matchVersion,omitempty"` 4565 4566 // Participants: The participants involved in the match, along with 4567 // their statuses. Includes participants who have left or declined 4568 // invitations. 4569 Participants []*TurnBasedMatchParticipant `json:"participants,omitempty"` 4570 4571 // PendingParticipantId: The ID of the participant that is taking a 4572 // turn. 4573 PendingParticipantId string `json:"pendingParticipantId,omitempty"` 4574 4575 // PreviousMatchData: The data / game state for the previous match; set 4576 // for the first turn of rematches only. 4577 PreviousMatchData *TurnBasedMatchData `json:"previousMatchData,omitempty"` 4578 4579 // RematchId: The ID of a rematch of this match. Only set for completed 4580 // matches that have been rematched. 4581 RematchId string `json:"rematchId,omitempty"` 4582 4583 // Results: The results reported for this match. 4584 Results []*ParticipantResult `json:"results,omitempty"` 4585 4586 // Status: The status of the match. 4587 // Possible values are: 4588 // - "MATCH_AUTO_MATCHING" - One or more slots need to be filled by 4589 // auto-matching; the match cannot be established until they are filled. 4590 // 4591 // - "MATCH_ACTIVE" - The match has started. 4592 // - "MATCH_COMPLETE" - The match has finished. 4593 // - "MATCH_CANCELED" - The match was canceled. 4594 // - "MATCH_EXPIRED" - The match expired due to inactivity. 4595 // - "MATCH_DELETED" - The match should no longer be shown on the 4596 // client. Returned only for tombstones for matches when sync is called. 4597 Status string `json:"status,omitempty"` 4598 4599 // UserMatchStatus: The status of the current user in the match. Derived 4600 // from the match type, match status, the user's participant status, and 4601 // the pending participant for the match. 4602 // Possible values are: 4603 // - "USER_INVITED" - The user has been invited to join the match and 4604 // has not responded yet. 4605 // - "USER_AWAITING_TURN" - The user is waiting for their turn. 4606 // - "USER_TURN" - The user has an action to take in the match. 4607 // - "USER_MATCH_COMPLETED" - The match has ended (it is completed, 4608 // canceled, or expired.) 4609 UserMatchStatus string `json:"userMatchStatus,omitempty"` 4610 4611 // Variant: The variant / mode of the application being played; can be 4612 // any integer value, or left blank. 4613 Variant int64 `json:"variant,omitempty"` 4614 4615 // WithParticipantId: The ID of another participant in the match that 4616 // can be used when describing the participants the user is playing 4617 // with. 4618 WithParticipantId string `json:"withParticipantId,omitempty"` 4619 4620 // ServerResponse contains the HTTP response code and headers from the 4621 // server. 4622 googleapi.ServerResponse `json:"-"` 4623 4624 // ForceSendFields is a list of field names (e.g. "ApplicationId") to 4625 // unconditionally include in API requests. By default, fields with 4626 // empty values are omitted from API requests. However, any non-pointer, 4627 // non-interface field appearing in ForceSendFields will be sent to the 4628 // server regardless of whether the field is empty or not. This may be 4629 // used to include empty fields in Patch requests. 4630 ForceSendFields []string `json:"-"` 4631 4632 // NullFields is a list of field names (e.g. "ApplicationId") to include 4633 // in API requests with the JSON null value. By default, fields with 4634 // empty values are omitted from API requests. However, any field with 4635 // an empty value appearing in NullFields will be sent to the server as 4636 // null. It is an error if a field in this list has a non-empty value. 4637 // This may be used to include null fields in Patch requests. 4638 NullFields []string `json:"-"` 4639} 4640 4641func (s *TurnBasedMatch) MarshalJSON() ([]byte, error) { 4642 type NoMethod TurnBasedMatch 4643 raw := NoMethod(*s) 4644 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4645} 4646 4647// TurnBasedMatchCreateRequest: This is a JSON template for a turn-based 4648// match creation request. 4649type TurnBasedMatchCreateRequest struct { 4650 // AutoMatchingCriteria: Criteria for auto-matching players into this 4651 // match. 4652 AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` 4653 4654 // InvitedPlayerIds: The player ids to invite to the match. 4655 InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"` 4656 4657 // Kind: Uniquely identifies the type of this resource. Value is always 4658 // the fixed string games#turnBasedMatchCreateRequest. 4659 Kind string `json:"kind,omitempty"` 4660 4661 // RequestId: A randomly generated numeric ID. This number is used at 4662 // the server to ensure that the request is handled correctly across 4663 // retries. 4664 RequestId int64 `json:"requestId,omitempty,string"` 4665 4666 // Variant: The variant / mode of the application to be played. This can 4667 // be any integer value, or left blank. You should use a small number of 4668 // variants to keep the auto-matching pool as large as possible. 4669 Variant int64 `json:"variant,omitempty"` 4670 4671 // ForceSendFields is a list of field names (e.g. 4672 // "AutoMatchingCriteria") to unconditionally include in API requests. 4673 // By default, fields with empty values are omitted from API requests. 4674 // However, any non-pointer, non-interface field appearing in 4675 // ForceSendFields will be sent to the server regardless of whether the 4676 // field is empty or not. This may be used to include empty fields in 4677 // Patch requests. 4678 ForceSendFields []string `json:"-"` 4679 4680 // NullFields is a list of field names (e.g. "AutoMatchingCriteria") to 4681 // include in API requests with the JSON null value. By default, fields 4682 // with empty values are omitted from API requests. However, any field 4683 // with an empty value appearing in NullFields will be sent to the 4684 // server as null. It is an error if a field in this list has a 4685 // non-empty value. This may be used to include null fields in Patch 4686 // requests. 4687 NullFields []string `json:"-"` 4688} 4689 4690func (s *TurnBasedMatchCreateRequest) MarshalJSON() ([]byte, error) { 4691 type NoMethod TurnBasedMatchCreateRequest 4692 raw := NoMethod(*s) 4693 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4694} 4695 4696// TurnBasedMatchData: This is a JSON template for a turn-based match 4697// data object. 4698type TurnBasedMatchData struct { 4699 // Data: The byte representation of the data (limited to 128 kB), as a 4700 // Base64-encoded string with the URL_SAFE encoding option. 4701 Data string `json:"data,omitempty"` 4702 4703 // DataAvailable: True if this match has data available but it wasn't 4704 // returned in a list response; fetching the match individually will 4705 // retrieve this data. 4706 DataAvailable bool `json:"dataAvailable,omitempty"` 4707 4708 // Kind: Uniquely identifies the type of this resource. Value is always 4709 // the fixed string games#turnBasedMatchData. 4710 Kind string `json:"kind,omitempty"` 4711 4712 // ForceSendFields is a list of field names (e.g. "Data") to 4713 // unconditionally include in API requests. By default, fields with 4714 // empty values are omitted from API requests. However, any non-pointer, 4715 // non-interface field appearing in ForceSendFields will be sent to the 4716 // server regardless of whether the field is empty or not. This may be 4717 // used to include empty fields in Patch requests. 4718 ForceSendFields []string `json:"-"` 4719 4720 // NullFields is a list of field names (e.g. "Data") to include in API 4721 // requests with the JSON null value. By default, fields with empty 4722 // values are omitted from API requests. However, any field with an 4723 // empty value appearing in NullFields will be sent to the server as 4724 // null. It is an error if a field in this list has a non-empty value. 4725 // This may be used to include null fields in Patch requests. 4726 NullFields []string `json:"-"` 4727} 4728 4729func (s *TurnBasedMatchData) MarshalJSON() ([]byte, error) { 4730 type NoMethod TurnBasedMatchData 4731 raw := NoMethod(*s) 4732 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4733} 4734 4735// TurnBasedMatchDataRequest: This is a JSON template for sending a 4736// turn-based match data object. 4737type TurnBasedMatchDataRequest struct { 4738 // Data: The byte representation of the data (limited to 128 kB), as a 4739 // Base64-encoded string with the URL_SAFE encoding option. 4740 Data string `json:"data,omitempty"` 4741 4742 // Kind: Uniquely identifies the type of this resource. Value is always 4743 // the fixed string games#turnBasedMatchDataRequest. 4744 Kind string `json:"kind,omitempty"` 4745 4746 // ForceSendFields is a list of field names (e.g. "Data") to 4747 // unconditionally include in API requests. By default, fields with 4748 // empty values are omitted from API requests. However, any non-pointer, 4749 // non-interface field appearing in ForceSendFields will be sent to the 4750 // server regardless of whether the field is empty or not. This may be 4751 // used to include empty fields in Patch requests. 4752 ForceSendFields []string `json:"-"` 4753 4754 // NullFields is a list of field names (e.g. "Data") to include in API 4755 // requests with the JSON null value. By default, fields with empty 4756 // values are omitted from API requests. However, any field with an 4757 // empty value appearing in NullFields will be sent to the server as 4758 // null. It is an error if a field in this list has a non-empty value. 4759 // This may be used to include null fields in Patch requests. 4760 NullFields []string `json:"-"` 4761} 4762 4763func (s *TurnBasedMatchDataRequest) MarshalJSON() ([]byte, error) { 4764 type NoMethod TurnBasedMatchDataRequest 4765 raw := NoMethod(*s) 4766 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4767} 4768 4769// TurnBasedMatchList: This is a JSON template for a list of turn-based 4770// matches. 4771type TurnBasedMatchList struct { 4772 // Items: The matches. 4773 Items []*TurnBasedMatch `json:"items,omitempty"` 4774 4775 // Kind: Uniquely identifies the type of this resource. Value is always 4776 // the fixed string games#turnBasedMatchList. 4777 Kind string `json:"kind,omitempty"` 4778 4779 // NextPageToken: The pagination token for the next page of results. 4780 NextPageToken string `json:"nextPageToken,omitempty"` 4781 4782 // ServerResponse contains the HTTP response code and headers from the 4783 // server. 4784 googleapi.ServerResponse `json:"-"` 4785 4786 // ForceSendFields is a list of field names (e.g. "Items") to 4787 // unconditionally include in API requests. By default, fields with 4788 // empty values are omitted from API requests. However, any non-pointer, 4789 // non-interface field appearing in ForceSendFields will be sent to the 4790 // server regardless of whether the field is empty or not. This may be 4791 // used to include empty fields in Patch requests. 4792 ForceSendFields []string `json:"-"` 4793 4794 // NullFields is a list of field names (e.g. "Items") to include in API 4795 // requests with the JSON null value. By default, fields with empty 4796 // values are omitted from API requests. However, any field with an 4797 // empty value appearing in NullFields will be sent to the server as 4798 // null. It is an error if a field in this list has a non-empty value. 4799 // This may be used to include null fields in Patch requests. 4800 NullFields []string `json:"-"` 4801} 4802 4803func (s *TurnBasedMatchList) MarshalJSON() ([]byte, error) { 4804 type NoMethod TurnBasedMatchList 4805 raw := NoMethod(*s) 4806 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4807} 4808 4809// TurnBasedMatchModification: This is a JSON template for turn-based 4810// match modification metadata. 4811type TurnBasedMatchModification struct { 4812 // Kind: Uniquely identifies the type of this resource. Value is always 4813 // the fixed string games#turnBasedMatchModification. 4814 Kind string `json:"kind,omitempty"` 4815 4816 // ModifiedTimestampMillis: The timestamp at which they modified the 4817 // match, in milliseconds since the epoch in UTC. 4818 ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"` 4819 4820 // ParticipantId: The ID of the participant that modified the match. 4821 ParticipantId string `json:"participantId,omitempty"` 4822 4823 // ForceSendFields is a list of field names (e.g. "Kind") to 4824 // unconditionally include in API requests. By default, fields with 4825 // empty values are omitted from API requests. However, any non-pointer, 4826 // non-interface field appearing in ForceSendFields will be sent to the 4827 // server regardless of whether the field is empty or not. This may be 4828 // used to include empty fields in Patch requests. 4829 ForceSendFields []string `json:"-"` 4830 4831 // NullFields is a list of field names (e.g. "Kind") to include in API 4832 // requests with the JSON null value. By default, fields with empty 4833 // values are omitted from API requests. However, any field with an 4834 // empty value appearing in NullFields will be sent to the server as 4835 // null. It is an error if a field in this list has a non-empty value. 4836 // This may be used to include null fields in Patch requests. 4837 NullFields []string `json:"-"` 4838} 4839 4840func (s *TurnBasedMatchModification) MarshalJSON() ([]byte, error) { 4841 type NoMethod TurnBasedMatchModification 4842 raw := NoMethod(*s) 4843 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4844} 4845 4846// TurnBasedMatchParticipant: This is a JSON template for a participant 4847// in a turn-based match. 4848type TurnBasedMatchParticipant struct { 4849 // AutoMatched: True if this participant was auto-matched with the 4850 // requesting player. 4851 AutoMatched bool `json:"autoMatched,omitempty"` 4852 4853 // AutoMatchedPlayer: Information about a player that has been 4854 // anonymously auto-matched against the requesting player. (Either 4855 // player or autoMatchedPlayer will be set.) 4856 AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"` 4857 4858 // Id: An identifier for the participant in the scope of the match. 4859 // Cannot be used to identify a player across matches or in other 4860 // contexts. 4861 Id string `json:"id,omitempty"` 4862 4863 // Kind: Uniquely identifies the type of this resource. Value is always 4864 // the fixed string games#turnBasedMatchParticipant. 4865 Kind string `json:"kind,omitempty"` 4866 4867 // Player: Information about the player. Not populated if this player 4868 // was anonymously auto-matched against the requesting player. (Either 4869 // player or autoMatchedPlayer will be set.) 4870 Player *Player `json:"player,omitempty"` 4871 4872 // Status: The status of the participant with respect to the 4873 // match. 4874 // Possible values are: 4875 // - "PARTICIPANT_NOT_INVITED_YET" - The participant is slated to be 4876 // invited to the match, but the invitation has not been sent; the 4877 // invite will be sent when it becomes their turn. 4878 // - "PARTICIPANT_INVITED" - The participant has been invited to join 4879 // the match, but has not yet responded. 4880 // - "PARTICIPANT_JOINED" - The participant has joined the match (either 4881 // after creating it or accepting an invitation.) 4882 // - "PARTICIPANT_DECLINED" - The participant declined an invitation to 4883 // join the match. 4884 // - "PARTICIPANT_LEFT" - The participant joined the match and then left 4885 // it. 4886 // - "PARTICIPANT_FINISHED" - The participant finished playing in the 4887 // match. 4888 // - "PARTICIPANT_UNRESPONSIVE" - The participant did not take their 4889 // turn in the allotted time. 4890 Status string `json:"status,omitempty"` 4891 4892 // ForceSendFields is a list of field names (e.g. "AutoMatched") to 4893 // unconditionally include in API requests. By default, fields with 4894 // empty values are omitted from API requests. However, any non-pointer, 4895 // non-interface field appearing in ForceSendFields will be sent to the 4896 // server regardless of whether the field is empty or not. This may be 4897 // used to include empty fields in Patch requests. 4898 ForceSendFields []string `json:"-"` 4899 4900 // NullFields is a list of field names (e.g. "AutoMatched") to include 4901 // in API requests with the JSON null value. By default, fields with 4902 // empty values are omitted from API requests. However, any field with 4903 // an empty value appearing in NullFields will be sent to the server as 4904 // null. It is an error if a field in this list has a non-empty value. 4905 // This may be used to include null fields in Patch requests. 4906 NullFields []string `json:"-"` 4907} 4908 4909func (s *TurnBasedMatchParticipant) MarshalJSON() ([]byte, error) { 4910 type NoMethod TurnBasedMatchParticipant 4911 raw := NoMethod(*s) 4912 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4913} 4914 4915// TurnBasedMatchRematch: This is a JSON template for a rematch 4916// response. 4917type TurnBasedMatchRematch struct { 4918 // Kind: Uniquely identifies the type of this resource. Value is always 4919 // the fixed string games#turnBasedMatchRematch. 4920 Kind string `json:"kind,omitempty"` 4921 4922 // PreviousMatch: The old match that the rematch was created from; will 4923 // be updated such that the rematchId field will point at the new match. 4924 PreviousMatch *TurnBasedMatch `json:"previousMatch,omitempty"` 4925 4926 // Rematch: The newly created match; a rematch of the old match with the 4927 // same participants. 4928 Rematch *TurnBasedMatch `json:"rematch,omitempty"` 4929 4930 // ServerResponse contains the HTTP response code and headers from the 4931 // server. 4932 googleapi.ServerResponse `json:"-"` 4933 4934 // ForceSendFields is a list of field names (e.g. "Kind") to 4935 // unconditionally include in API requests. By default, fields with 4936 // empty values are omitted from API requests. However, any non-pointer, 4937 // non-interface field appearing in ForceSendFields will be sent to the 4938 // server regardless of whether the field is empty or not. This may be 4939 // used to include empty fields in Patch requests. 4940 ForceSendFields []string `json:"-"` 4941 4942 // NullFields is a list of field names (e.g. "Kind") to include in API 4943 // requests with the JSON null value. By default, fields with empty 4944 // values are omitted from API requests. However, any field with an 4945 // empty value appearing in NullFields will be sent to the server as 4946 // null. It is an error if a field in this list has a non-empty value. 4947 // This may be used to include null fields in Patch requests. 4948 NullFields []string `json:"-"` 4949} 4950 4951func (s *TurnBasedMatchRematch) MarshalJSON() ([]byte, error) { 4952 type NoMethod TurnBasedMatchRematch 4953 raw := NoMethod(*s) 4954 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4955} 4956 4957// TurnBasedMatchResults: This is a JSON template for a turn-based match 4958// results object. 4959type TurnBasedMatchResults struct { 4960 // Data: The final match data. 4961 Data *TurnBasedMatchDataRequest `json:"data,omitempty"` 4962 4963 // Kind: Uniquely identifies the type of this resource. Value is always 4964 // the fixed string games#turnBasedMatchResults. 4965 Kind string `json:"kind,omitempty"` 4966 4967 // MatchVersion: The version of the match being updated. 4968 MatchVersion int64 `json:"matchVersion,omitempty"` 4969 4970 // Results: The match results for the participants in the match. 4971 Results []*ParticipantResult `json:"results,omitempty"` 4972 4973 // ForceSendFields is a list of field names (e.g. "Data") to 4974 // unconditionally include in API requests. By default, fields with 4975 // empty values are omitted from API requests. However, any non-pointer, 4976 // non-interface field appearing in ForceSendFields will be sent to the 4977 // server regardless of whether the field is empty or not. This may be 4978 // used to include empty fields in Patch requests. 4979 ForceSendFields []string `json:"-"` 4980 4981 // NullFields is a list of field names (e.g. "Data") to include in API 4982 // requests with the JSON null value. By default, fields with empty 4983 // values are omitted from API requests. However, any field with an 4984 // empty value appearing in NullFields will be sent to the server as 4985 // null. It is an error if a field in this list has a non-empty value. 4986 // This may be used to include null fields in Patch requests. 4987 NullFields []string `json:"-"` 4988} 4989 4990func (s *TurnBasedMatchResults) MarshalJSON() ([]byte, error) { 4991 type NoMethod TurnBasedMatchResults 4992 raw := NoMethod(*s) 4993 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4994} 4995 4996// TurnBasedMatchSync: This is a JSON template for a list of turn-based 4997// matches returned from a sync. 4998type TurnBasedMatchSync struct { 4999 // Items: The matches. 5000 Items []*TurnBasedMatch `json:"items,omitempty"` 5001 5002 // Kind: Uniquely identifies the type of this resource. Value is always 5003 // the fixed string games#turnBasedMatchSync. 5004 Kind string `json:"kind,omitempty"` 5005 5006 // MoreAvailable: True if there were more matches available to fetch at 5007 // the time the response was generated (which were not returned due to 5008 // page size limits.) 5009 MoreAvailable bool `json:"moreAvailable,omitempty"` 5010 5011 // NextPageToken: The pagination token for the next page of results. 5012 NextPageToken string `json:"nextPageToken,omitempty"` 5013 5014 // ServerResponse contains the HTTP response code and headers from the 5015 // server. 5016 googleapi.ServerResponse `json:"-"` 5017 5018 // ForceSendFields is a list of field names (e.g. "Items") to 5019 // unconditionally include in API requests. By default, fields with 5020 // empty values are omitted from API requests. However, any non-pointer, 5021 // non-interface field appearing in ForceSendFields will be sent to the 5022 // server regardless of whether the field is empty or not. This may be 5023 // used to include empty fields in Patch requests. 5024 ForceSendFields []string `json:"-"` 5025 5026 // NullFields is a list of field names (e.g. "Items") to include in API 5027 // requests with the JSON null value. By default, fields with empty 5028 // values are omitted from API requests. However, any field with an 5029 // empty value appearing in NullFields will be sent to the server as 5030 // null. It is an error if a field in this list has a non-empty value. 5031 // This may be used to include null fields in Patch requests. 5032 NullFields []string `json:"-"` 5033} 5034 5035func (s *TurnBasedMatchSync) MarshalJSON() ([]byte, error) { 5036 type NoMethod TurnBasedMatchSync 5037 raw := NoMethod(*s) 5038 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5039} 5040 5041// TurnBasedMatchTurn: This is a JSON template for the object 5042// representing a turn. 5043type TurnBasedMatchTurn struct { 5044 // Data: The shared game state data after the turn is over. 5045 Data *TurnBasedMatchDataRequest `json:"data,omitempty"` 5046 5047 // Kind: Uniquely identifies the type of this resource. Value is always 5048 // the fixed string games#turnBasedMatchTurn. 5049 Kind string `json:"kind,omitempty"` 5050 5051 // MatchVersion: The version of this match: an increasing counter, used 5052 // to avoid out-of-date updates to the match. 5053 MatchVersion int64 `json:"matchVersion,omitempty"` 5054 5055 // PendingParticipantId: The ID of the participant who should take their 5056 // turn next. May be set to the current player's participant ID to 5057 // update match state without changing the turn. If not set, the match 5058 // will wait for other player(s) to join via automatching; this is only 5059 // valid if automatch criteria is set on the match with remaining slots 5060 // for automatched players. 5061 PendingParticipantId string `json:"pendingParticipantId,omitempty"` 5062 5063 // Results: The match results for the participants in the match. 5064 Results []*ParticipantResult `json:"results,omitempty"` 5065 5066 // ForceSendFields is a list of field names (e.g. "Data") to 5067 // unconditionally include in API requests. By default, fields with 5068 // empty values are omitted from API requests. However, any non-pointer, 5069 // non-interface field appearing in ForceSendFields will be sent to the 5070 // server regardless of whether the field is empty or not. This may be 5071 // used to include empty fields in Patch requests. 5072 ForceSendFields []string `json:"-"` 5073 5074 // NullFields is a list of field names (e.g. "Data") to include in API 5075 // requests with the JSON null value. By default, fields with empty 5076 // values are omitted from API requests. However, any field with an 5077 // empty value appearing in NullFields will be sent to the server as 5078 // null. It is an error if a field in this list has a non-empty value. 5079 // This may be used to include null fields in Patch requests. 5080 NullFields []string `json:"-"` 5081} 5082 5083func (s *TurnBasedMatchTurn) MarshalJSON() ([]byte, error) { 5084 type NoMethod TurnBasedMatchTurn 5085 raw := NoMethod(*s) 5086 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 5087} 5088 5089// method id "games.achievementDefinitions.list": 5090 5091type AchievementDefinitionsListCall struct { 5092 s *Service 5093 urlParams_ gensupport.URLParams 5094 ifNoneMatch_ string 5095 ctx_ context.Context 5096 header_ http.Header 5097} 5098 5099// List: Lists all the achievement definitions for your application. 5100func (r *AchievementDefinitionsService) List() *AchievementDefinitionsListCall { 5101 c := &AchievementDefinitionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5102 return c 5103} 5104 5105// Language sets the optional parameter "language": The preferred 5106// language to use for strings returned by this method. 5107func (c *AchievementDefinitionsListCall) Language(language string) *AchievementDefinitionsListCall { 5108 c.urlParams_.Set("language", language) 5109 return c 5110} 5111 5112// MaxResults sets the optional parameter "maxResults": The maximum 5113// number of achievement resources to return in the response, used for 5114// paging. For any response, the actual number of achievement resources 5115// returned may be less than the specified maxResults. 5116func (c *AchievementDefinitionsListCall) MaxResults(maxResults int64) *AchievementDefinitionsListCall { 5117 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5118 return c 5119} 5120 5121// PageToken sets the optional parameter "pageToken": The token returned 5122// by the previous request. 5123func (c *AchievementDefinitionsListCall) PageToken(pageToken string) *AchievementDefinitionsListCall { 5124 c.urlParams_.Set("pageToken", pageToken) 5125 return c 5126} 5127 5128// Fields allows partial responses to be retrieved. See 5129// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5130// for more information. 5131func (c *AchievementDefinitionsListCall) Fields(s ...googleapi.Field) *AchievementDefinitionsListCall { 5132 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5133 return c 5134} 5135 5136// IfNoneMatch sets the optional parameter which makes the operation 5137// fail if the object's ETag matches the given value. This is useful for 5138// getting updates only after the object has changed since the last 5139// request. Use googleapi.IsNotModified to check whether the response 5140// error from Do is the result of In-None-Match. 5141func (c *AchievementDefinitionsListCall) IfNoneMatch(entityTag string) *AchievementDefinitionsListCall { 5142 c.ifNoneMatch_ = entityTag 5143 return c 5144} 5145 5146// Context sets the context to be used in this call's Do method. Any 5147// pending HTTP request will be aborted if the provided context is 5148// canceled. 5149func (c *AchievementDefinitionsListCall) Context(ctx context.Context) *AchievementDefinitionsListCall { 5150 c.ctx_ = ctx 5151 return c 5152} 5153 5154// Header returns an http.Header that can be modified by the caller to 5155// add HTTP headers to the request. 5156func (c *AchievementDefinitionsListCall) Header() http.Header { 5157 if c.header_ == nil { 5158 c.header_ = make(http.Header) 5159 } 5160 return c.header_ 5161} 5162 5163func (c *AchievementDefinitionsListCall) doRequest(alt string) (*http.Response, error) { 5164 reqHeaders := make(http.Header) 5165 for k, v := range c.header_ { 5166 reqHeaders[k] = v 5167 } 5168 reqHeaders.Set("User-Agent", c.s.userAgent()) 5169 if c.ifNoneMatch_ != "" { 5170 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5171 } 5172 var body io.Reader = nil 5173 c.urlParams_.Set("alt", alt) 5174 c.urlParams_.Set("prettyPrint", "false") 5175 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements") 5176 urls += "?" + c.urlParams_.Encode() 5177 req, err := http.NewRequest("GET", urls, body) 5178 if err != nil { 5179 return nil, err 5180 } 5181 req.Header = reqHeaders 5182 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5183} 5184 5185// Do executes the "games.achievementDefinitions.list" call. 5186// Exactly one of *AchievementDefinitionsListResponse or error will be 5187// non-nil. Any non-2xx status code is an error. Response headers are in 5188// either *AchievementDefinitionsListResponse.ServerResponse.Header or 5189// (if a response was returned at all) in 5190// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5191// whether the returned error was because http.StatusNotModified was 5192// returned. 5193func (c *AchievementDefinitionsListCall) Do(opts ...googleapi.CallOption) (*AchievementDefinitionsListResponse, error) { 5194 gensupport.SetOptions(c.urlParams_, opts...) 5195 res, err := c.doRequest("json") 5196 if res != nil && res.StatusCode == http.StatusNotModified { 5197 if res.Body != nil { 5198 res.Body.Close() 5199 } 5200 return nil, &googleapi.Error{ 5201 Code: res.StatusCode, 5202 Header: res.Header, 5203 } 5204 } 5205 if err != nil { 5206 return nil, err 5207 } 5208 defer googleapi.CloseBody(res) 5209 if err := googleapi.CheckResponse(res); err != nil { 5210 return nil, err 5211 } 5212 ret := &AchievementDefinitionsListResponse{ 5213 ServerResponse: googleapi.ServerResponse{ 5214 Header: res.Header, 5215 HTTPStatusCode: res.StatusCode, 5216 }, 5217 } 5218 target := &ret 5219 if err := gensupport.DecodeResponse(target, res); err != nil { 5220 return nil, err 5221 } 5222 return ret, nil 5223 // { 5224 // "description": "Lists all the achievement definitions for your application.", 5225 // "httpMethod": "GET", 5226 // "id": "games.achievementDefinitions.list", 5227 // "parameters": { 5228 // "language": { 5229 // "description": "The preferred language to use for strings returned by this method.", 5230 // "location": "query", 5231 // "type": "string" 5232 // }, 5233 // "maxResults": { 5234 // "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.", 5235 // "format": "int32", 5236 // "location": "query", 5237 // "maximum": "200", 5238 // "minimum": "1", 5239 // "type": "integer" 5240 // }, 5241 // "pageToken": { 5242 // "description": "The token returned by the previous request.", 5243 // "location": "query", 5244 // "type": "string" 5245 // } 5246 // }, 5247 // "path": "achievements", 5248 // "response": { 5249 // "$ref": "AchievementDefinitionsListResponse" 5250 // }, 5251 // "scopes": [ 5252 // "https://www.googleapis.com/auth/games" 5253 // ] 5254 // } 5255 5256} 5257 5258// Pages invokes f for each page of results. 5259// A non-nil error returned from f will halt the iteration. 5260// The provided context supersedes any context provided to the Context method. 5261func (c *AchievementDefinitionsListCall) Pages(ctx context.Context, f func(*AchievementDefinitionsListResponse) error) error { 5262 c.ctx_ = ctx 5263 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5264 for { 5265 x, err := c.Do() 5266 if err != nil { 5267 return err 5268 } 5269 if err := f(x); err != nil { 5270 return err 5271 } 5272 if x.NextPageToken == "" { 5273 return nil 5274 } 5275 c.PageToken(x.NextPageToken) 5276 } 5277} 5278 5279// method id "games.achievements.increment": 5280 5281type AchievementsIncrementCall struct { 5282 s *Service 5283 achievementId string 5284 urlParams_ gensupport.URLParams 5285 ctx_ context.Context 5286 header_ http.Header 5287} 5288 5289// Increment: Increments the steps of the achievement with the given ID 5290// for the currently authenticated player. 5291func (r *AchievementsService) Increment(achievementId string, stepsToIncrement int64) *AchievementsIncrementCall { 5292 c := &AchievementsIncrementCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5293 c.achievementId = achievementId 5294 c.urlParams_.Set("stepsToIncrement", fmt.Sprint(stepsToIncrement)) 5295 return c 5296} 5297 5298// RequestId sets the optional parameter "requestId": A randomly 5299// generated numeric ID for each request specified by the caller. This 5300// number is used at the server to ensure that the request is handled 5301// correctly across retries. 5302func (c *AchievementsIncrementCall) RequestId(requestId int64) *AchievementsIncrementCall { 5303 c.urlParams_.Set("requestId", fmt.Sprint(requestId)) 5304 return c 5305} 5306 5307// Fields allows partial responses to be retrieved. See 5308// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5309// for more information. 5310func (c *AchievementsIncrementCall) Fields(s ...googleapi.Field) *AchievementsIncrementCall { 5311 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5312 return c 5313} 5314 5315// Context sets the context to be used in this call's Do method. Any 5316// pending HTTP request will be aborted if the provided context is 5317// canceled. 5318func (c *AchievementsIncrementCall) Context(ctx context.Context) *AchievementsIncrementCall { 5319 c.ctx_ = ctx 5320 return c 5321} 5322 5323// Header returns an http.Header that can be modified by the caller to 5324// add HTTP headers to the request. 5325func (c *AchievementsIncrementCall) Header() http.Header { 5326 if c.header_ == nil { 5327 c.header_ = make(http.Header) 5328 } 5329 return c.header_ 5330} 5331 5332func (c *AchievementsIncrementCall) doRequest(alt string) (*http.Response, error) { 5333 reqHeaders := make(http.Header) 5334 for k, v := range c.header_ { 5335 reqHeaders[k] = v 5336 } 5337 reqHeaders.Set("User-Agent", c.s.userAgent()) 5338 var body io.Reader = nil 5339 c.urlParams_.Set("alt", alt) 5340 c.urlParams_.Set("prettyPrint", "false") 5341 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/increment") 5342 urls += "?" + c.urlParams_.Encode() 5343 req, err := http.NewRequest("POST", urls, body) 5344 if err != nil { 5345 return nil, err 5346 } 5347 req.Header = reqHeaders 5348 googleapi.Expand(req.URL, map[string]string{ 5349 "achievementId": c.achievementId, 5350 }) 5351 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5352} 5353 5354// Do executes the "games.achievements.increment" call. 5355// Exactly one of *AchievementIncrementResponse or error will be 5356// non-nil. Any non-2xx status code is an error. Response headers are in 5357// either *AchievementIncrementResponse.ServerResponse.Header or (if a 5358// response was returned at all) in error.(*googleapi.Error).Header. Use 5359// googleapi.IsNotModified to check whether the returned error was 5360// because http.StatusNotModified was returned. 5361func (c *AchievementsIncrementCall) Do(opts ...googleapi.CallOption) (*AchievementIncrementResponse, error) { 5362 gensupport.SetOptions(c.urlParams_, opts...) 5363 res, err := c.doRequest("json") 5364 if res != nil && res.StatusCode == http.StatusNotModified { 5365 if res.Body != nil { 5366 res.Body.Close() 5367 } 5368 return nil, &googleapi.Error{ 5369 Code: res.StatusCode, 5370 Header: res.Header, 5371 } 5372 } 5373 if err != nil { 5374 return nil, err 5375 } 5376 defer googleapi.CloseBody(res) 5377 if err := googleapi.CheckResponse(res); err != nil { 5378 return nil, err 5379 } 5380 ret := &AchievementIncrementResponse{ 5381 ServerResponse: googleapi.ServerResponse{ 5382 Header: res.Header, 5383 HTTPStatusCode: res.StatusCode, 5384 }, 5385 } 5386 target := &ret 5387 if err := gensupport.DecodeResponse(target, res); err != nil { 5388 return nil, err 5389 } 5390 return ret, nil 5391 // { 5392 // "description": "Increments the steps of the achievement with the given ID for the currently authenticated player.", 5393 // "httpMethod": "POST", 5394 // "id": "games.achievements.increment", 5395 // "parameterOrder": [ 5396 // "achievementId", 5397 // "stepsToIncrement" 5398 // ], 5399 // "parameters": { 5400 // "achievementId": { 5401 // "description": "The ID of the achievement used by this method.", 5402 // "location": "path", 5403 // "required": true, 5404 // "type": "string" 5405 // }, 5406 // "requestId": { 5407 // "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.", 5408 // "format": "int64", 5409 // "location": "query", 5410 // "type": "string" 5411 // }, 5412 // "stepsToIncrement": { 5413 // "description": "The number of steps to increment.", 5414 // "format": "int32", 5415 // "location": "query", 5416 // "minimum": "1", 5417 // "required": true, 5418 // "type": "integer" 5419 // } 5420 // }, 5421 // "path": "achievements/{achievementId}/increment", 5422 // "response": { 5423 // "$ref": "AchievementIncrementResponse" 5424 // }, 5425 // "scopes": [ 5426 // "https://www.googleapis.com/auth/games" 5427 // ] 5428 // } 5429 5430} 5431 5432// method id "games.achievements.list": 5433 5434type AchievementsListCall struct { 5435 s *Service 5436 playerId string 5437 urlParams_ gensupport.URLParams 5438 ifNoneMatch_ string 5439 ctx_ context.Context 5440 header_ http.Header 5441} 5442 5443// List: Lists the progress for all your application's achievements for 5444// the currently authenticated player. 5445func (r *AchievementsService) List(playerId string) *AchievementsListCall { 5446 c := &AchievementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5447 c.playerId = playerId 5448 return c 5449} 5450 5451// Language sets the optional parameter "language": The preferred 5452// language to use for strings returned by this method. 5453func (c *AchievementsListCall) Language(language string) *AchievementsListCall { 5454 c.urlParams_.Set("language", language) 5455 return c 5456} 5457 5458// MaxResults sets the optional parameter "maxResults": The maximum 5459// number of achievement resources to return in the response, used for 5460// paging. For any response, the actual number of achievement resources 5461// returned may be less than the specified maxResults. 5462func (c *AchievementsListCall) MaxResults(maxResults int64) *AchievementsListCall { 5463 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5464 return c 5465} 5466 5467// PageToken sets the optional parameter "pageToken": The token returned 5468// by the previous request. 5469func (c *AchievementsListCall) PageToken(pageToken string) *AchievementsListCall { 5470 c.urlParams_.Set("pageToken", pageToken) 5471 return c 5472} 5473 5474// State sets the optional parameter "state": Tells the server to return 5475// only achievements with the specified state. If this parameter isn't 5476// specified, all achievements are returned. 5477// 5478// Possible values: 5479// "ALL" - List all achievements. This is the default. 5480// "HIDDEN" - List only hidden achievements. 5481// "REVEALED" - List only revealed achievements. 5482// "UNLOCKED" - List only unlocked achievements. 5483func (c *AchievementsListCall) State(state string) *AchievementsListCall { 5484 c.urlParams_.Set("state", state) 5485 return c 5486} 5487 5488// Fields allows partial responses to be retrieved. See 5489// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5490// for more information. 5491func (c *AchievementsListCall) Fields(s ...googleapi.Field) *AchievementsListCall { 5492 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5493 return c 5494} 5495 5496// IfNoneMatch sets the optional parameter which makes the operation 5497// fail if the object's ETag matches the given value. This is useful for 5498// getting updates only after the object has changed since the last 5499// request. Use googleapi.IsNotModified to check whether the response 5500// error from Do is the result of In-None-Match. 5501func (c *AchievementsListCall) IfNoneMatch(entityTag string) *AchievementsListCall { 5502 c.ifNoneMatch_ = entityTag 5503 return c 5504} 5505 5506// Context sets the context to be used in this call's Do method. Any 5507// pending HTTP request will be aborted if the provided context is 5508// canceled. 5509func (c *AchievementsListCall) Context(ctx context.Context) *AchievementsListCall { 5510 c.ctx_ = ctx 5511 return c 5512} 5513 5514// Header returns an http.Header that can be modified by the caller to 5515// add HTTP headers to the request. 5516func (c *AchievementsListCall) Header() http.Header { 5517 if c.header_ == nil { 5518 c.header_ = make(http.Header) 5519 } 5520 return c.header_ 5521} 5522 5523func (c *AchievementsListCall) doRequest(alt string) (*http.Response, error) { 5524 reqHeaders := make(http.Header) 5525 for k, v := range c.header_ { 5526 reqHeaders[k] = v 5527 } 5528 reqHeaders.Set("User-Agent", c.s.userAgent()) 5529 if c.ifNoneMatch_ != "" { 5530 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5531 } 5532 var body io.Reader = nil 5533 c.urlParams_.Set("alt", alt) 5534 c.urlParams_.Set("prettyPrint", "false") 5535 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/achievements") 5536 urls += "?" + c.urlParams_.Encode() 5537 req, err := http.NewRequest("GET", urls, body) 5538 if err != nil { 5539 return nil, err 5540 } 5541 req.Header = reqHeaders 5542 googleapi.Expand(req.URL, map[string]string{ 5543 "playerId": c.playerId, 5544 }) 5545 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5546} 5547 5548// Do executes the "games.achievements.list" call. 5549// Exactly one of *PlayerAchievementListResponse or error will be 5550// non-nil. Any non-2xx status code is an error. Response headers are in 5551// either *PlayerAchievementListResponse.ServerResponse.Header or (if a 5552// response was returned at all) in error.(*googleapi.Error).Header. Use 5553// googleapi.IsNotModified to check whether the returned error was 5554// because http.StatusNotModified was returned. 5555func (c *AchievementsListCall) Do(opts ...googleapi.CallOption) (*PlayerAchievementListResponse, error) { 5556 gensupport.SetOptions(c.urlParams_, opts...) 5557 res, err := c.doRequest("json") 5558 if res != nil && res.StatusCode == http.StatusNotModified { 5559 if res.Body != nil { 5560 res.Body.Close() 5561 } 5562 return nil, &googleapi.Error{ 5563 Code: res.StatusCode, 5564 Header: res.Header, 5565 } 5566 } 5567 if err != nil { 5568 return nil, err 5569 } 5570 defer googleapi.CloseBody(res) 5571 if err := googleapi.CheckResponse(res); err != nil { 5572 return nil, err 5573 } 5574 ret := &PlayerAchievementListResponse{ 5575 ServerResponse: googleapi.ServerResponse{ 5576 Header: res.Header, 5577 HTTPStatusCode: res.StatusCode, 5578 }, 5579 } 5580 target := &ret 5581 if err := gensupport.DecodeResponse(target, res); err != nil { 5582 return nil, err 5583 } 5584 return ret, nil 5585 // { 5586 // "description": "Lists the progress for all your application's achievements for the currently authenticated player.", 5587 // "httpMethod": "GET", 5588 // "id": "games.achievements.list", 5589 // "parameterOrder": [ 5590 // "playerId" 5591 // ], 5592 // "parameters": { 5593 // "language": { 5594 // "description": "The preferred language to use for strings returned by this method.", 5595 // "location": "query", 5596 // "type": "string" 5597 // }, 5598 // "maxResults": { 5599 // "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.", 5600 // "format": "int32", 5601 // "location": "query", 5602 // "maximum": "200", 5603 // "minimum": "1", 5604 // "type": "integer" 5605 // }, 5606 // "pageToken": { 5607 // "description": "The token returned by the previous request.", 5608 // "location": "query", 5609 // "type": "string" 5610 // }, 5611 // "playerId": { 5612 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 5613 // "location": "path", 5614 // "required": true, 5615 // "type": "string" 5616 // }, 5617 // "state": { 5618 // "description": "Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.", 5619 // "enum": [ 5620 // "ALL", 5621 // "HIDDEN", 5622 // "REVEALED", 5623 // "UNLOCKED" 5624 // ], 5625 // "enumDescriptions": [ 5626 // "List all achievements. This is the default.", 5627 // "List only hidden achievements.", 5628 // "List only revealed achievements.", 5629 // "List only unlocked achievements." 5630 // ], 5631 // "location": "query", 5632 // "type": "string" 5633 // } 5634 // }, 5635 // "path": "players/{playerId}/achievements", 5636 // "response": { 5637 // "$ref": "PlayerAchievementListResponse" 5638 // }, 5639 // "scopes": [ 5640 // "https://www.googleapis.com/auth/games" 5641 // ] 5642 // } 5643 5644} 5645 5646// Pages invokes f for each page of results. 5647// A non-nil error returned from f will halt the iteration. 5648// The provided context supersedes any context provided to the Context method. 5649func (c *AchievementsListCall) Pages(ctx context.Context, f func(*PlayerAchievementListResponse) error) error { 5650 c.ctx_ = ctx 5651 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5652 for { 5653 x, err := c.Do() 5654 if err != nil { 5655 return err 5656 } 5657 if err := f(x); err != nil { 5658 return err 5659 } 5660 if x.NextPageToken == "" { 5661 return nil 5662 } 5663 c.PageToken(x.NextPageToken) 5664 } 5665} 5666 5667// method id "games.achievements.reveal": 5668 5669type AchievementsRevealCall struct { 5670 s *Service 5671 achievementId string 5672 urlParams_ gensupport.URLParams 5673 ctx_ context.Context 5674 header_ http.Header 5675} 5676 5677// Reveal: Sets the state of the achievement with the given ID to 5678// REVEALED for the currently authenticated player. 5679func (r *AchievementsService) Reveal(achievementId string) *AchievementsRevealCall { 5680 c := &AchievementsRevealCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5681 c.achievementId = achievementId 5682 return c 5683} 5684 5685// Fields allows partial responses to be retrieved. See 5686// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5687// for more information. 5688func (c *AchievementsRevealCall) Fields(s ...googleapi.Field) *AchievementsRevealCall { 5689 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5690 return c 5691} 5692 5693// Context sets the context to be used in this call's Do method. Any 5694// pending HTTP request will be aborted if the provided context is 5695// canceled. 5696func (c *AchievementsRevealCall) Context(ctx context.Context) *AchievementsRevealCall { 5697 c.ctx_ = ctx 5698 return c 5699} 5700 5701// Header returns an http.Header that can be modified by the caller to 5702// add HTTP headers to the request. 5703func (c *AchievementsRevealCall) Header() http.Header { 5704 if c.header_ == nil { 5705 c.header_ = make(http.Header) 5706 } 5707 return c.header_ 5708} 5709 5710func (c *AchievementsRevealCall) doRequest(alt string) (*http.Response, error) { 5711 reqHeaders := make(http.Header) 5712 for k, v := range c.header_ { 5713 reqHeaders[k] = v 5714 } 5715 reqHeaders.Set("User-Agent", c.s.userAgent()) 5716 var body io.Reader = nil 5717 c.urlParams_.Set("alt", alt) 5718 c.urlParams_.Set("prettyPrint", "false") 5719 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reveal") 5720 urls += "?" + c.urlParams_.Encode() 5721 req, err := http.NewRequest("POST", urls, body) 5722 if err != nil { 5723 return nil, err 5724 } 5725 req.Header = reqHeaders 5726 googleapi.Expand(req.URL, map[string]string{ 5727 "achievementId": c.achievementId, 5728 }) 5729 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5730} 5731 5732// Do executes the "games.achievements.reveal" call. 5733// Exactly one of *AchievementRevealResponse or error will be non-nil. 5734// Any non-2xx status code is an error. Response headers are in either 5735// *AchievementRevealResponse.ServerResponse.Header or (if a response 5736// was returned at all) in error.(*googleapi.Error).Header. Use 5737// googleapi.IsNotModified to check whether the returned error was 5738// because http.StatusNotModified was returned. 5739func (c *AchievementsRevealCall) Do(opts ...googleapi.CallOption) (*AchievementRevealResponse, error) { 5740 gensupport.SetOptions(c.urlParams_, opts...) 5741 res, err := c.doRequest("json") 5742 if res != nil && res.StatusCode == http.StatusNotModified { 5743 if res.Body != nil { 5744 res.Body.Close() 5745 } 5746 return nil, &googleapi.Error{ 5747 Code: res.StatusCode, 5748 Header: res.Header, 5749 } 5750 } 5751 if err != nil { 5752 return nil, err 5753 } 5754 defer googleapi.CloseBody(res) 5755 if err := googleapi.CheckResponse(res); err != nil { 5756 return nil, err 5757 } 5758 ret := &AchievementRevealResponse{ 5759 ServerResponse: googleapi.ServerResponse{ 5760 Header: res.Header, 5761 HTTPStatusCode: res.StatusCode, 5762 }, 5763 } 5764 target := &ret 5765 if err := gensupport.DecodeResponse(target, res); err != nil { 5766 return nil, err 5767 } 5768 return ret, nil 5769 // { 5770 // "description": "Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.", 5771 // "httpMethod": "POST", 5772 // "id": "games.achievements.reveal", 5773 // "parameterOrder": [ 5774 // "achievementId" 5775 // ], 5776 // "parameters": { 5777 // "achievementId": { 5778 // "description": "The ID of the achievement used by this method.", 5779 // "location": "path", 5780 // "required": true, 5781 // "type": "string" 5782 // } 5783 // }, 5784 // "path": "achievements/{achievementId}/reveal", 5785 // "response": { 5786 // "$ref": "AchievementRevealResponse" 5787 // }, 5788 // "scopes": [ 5789 // "https://www.googleapis.com/auth/games" 5790 // ] 5791 // } 5792 5793} 5794 5795// method id "games.achievements.setStepsAtLeast": 5796 5797type AchievementsSetStepsAtLeastCall struct { 5798 s *Service 5799 achievementId string 5800 urlParams_ gensupport.URLParams 5801 ctx_ context.Context 5802 header_ http.Header 5803} 5804 5805// SetStepsAtLeast: Sets the steps for the currently authenticated 5806// player towards unlocking an achievement. If the steps parameter is 5807// less than the current number of steps that the player already gained 5808// for the achievement, the achievement is not modified. 5809func (r *AchievementsService) SetStepsAtLeast(achievementId string, steps int64) *AchievementsSetStepsAtLeastCall { 5810 c := &AchievementsSetStepsAtLeastCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5811 c.achievementId = achievementId 5812 c.urlParams_.Set("steps", fmt.Sprint(steps)) 5813 return c 5814} 5815 5816// Fields allows partial responses to be retrieved. See 5817// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5818// for more information. 5819func (c *AchievementsSetStepsAtLeastCall) Fields(s ...googleapi.Field) *AchievementsSetStepsAtLeastCall { 5820 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5821 return c 5822} 5823 5824// Context sets the context to be used in this call's Do method. Any 5825// pending HTTP request will be aborted if the provided context is 5826// canceled. 5827func (c *AchievementsSetStepsAtLeastCall) Context(ctx context.Context) *AchievementsSetStepsAtLeastCall { 5828 c.ctx_ = ctx 5829 return c 5830} 5831 5832// Header returns an http.Header that can be modified by the caller to 5833// add HTTP headers to the request. 5834func (c *AchievementsSetStepsAtLeastCall) Header() http.Header { 5835 if c.header_ == nil { 5836 c.header_ = make(http.Header) 5837 } 5838 return c.header_ 5839} 5840 5841func (c *AchievementsSetStepsAtLeastCall) doRequest(alt string) (*http.Response, error) { 5842 reqHeaders := make(http.Header) 5843 for k, v := range c.header_ { 5844 reqHeaders[k] = v 5845 } 5846 reqHeaders.Set("User-Agent", c.s.userAgent()) 5847 var body io.Reader = nil 5848 c.urlParams_.Set("alt", alt) 5849 c.urlParams_.Set("prettyPrint", "false") 5850 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/setStepsAtLeast") 5851 urls += "?" + c.urlParams_.Encode() 5852 req, err := http.NewRequest("POST", urls, body) 5853 if err != nil { 5854 return nil, err 5855 } 5856 req.Header = reqHeaders 5857 googleapi.Expand(req.URL, map[string]string{ 5858 "achievementId": c.achievementId, 5859 }) 5860 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5861} 5862 5863// Do executes the "games.achievements.setStepsAtLeast" call. 5864// Exactly one of *AchievementSetStepsAtLeastResponse or error will be 5865// non-nil. Any non-2xx status code is an error. Response headers are in 5866// either *AchievementSetStepsAtLeastResponse.ServerResponse.Header or 5867// (if a response was returned at all) in 5868// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5869// whether the returned error was because http.StatusNotModified was 5870// returned. 5871func (c *AchievementsSetStepsAtLeastCall) Do(opts ...googleapi.CallOption) (*AchievementSetStepsAtLeastResponse, error) { 5872 gensupport.SetOptions(c.urlParams_, opts...) 5873 res, err := c.doRequest("json") 5874 if res != nil && res.StatusCode == http.StatusNotModified { 5875 if res.Body != nil { 5876 res.Body.Close() 5877 } 5878 return nil, &googleapi.Error{ 5879 Code: res.StatusCode, 5880 Header: res.Header, 5881 } 5882 } 5883 if err != nil { 5884 return nil, err 5885 } 5886 defer googleapi.CloseBody(res) 5887 if err := googleapi.CheckResponse(res); err != nil { 5888 return nil, err 5889 } 5890 ret := &AchievementSetStepsAtLeastResponse{ 5891 ServerResponse: googleapi.ServerResponse{ 5892 Header: res.Header, 5893 HTTPStatusCode: res.StatusCode, 5894 }, 5895 } 5896 target := &ret 5897 if err := gensupport.DecodeResponse(target, res); err != nil { 5898 return nil, err 5899 } 5900 return ret, nil 5901 // { 5902 // "description": "Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified.", 5903 // "httpMethod": "POST", 5904 // "id": "games.achievements.setStepsAtLeast", 5905 // "parameterOrder": [ 5906 // "achievementId", 5907 // "steps" 5908 // ], 5909 // "parameters": { 5910 // "achievementId": { 5911 // "description": "The ID of the achievement used by this method.", 5912 // "location": "path", 5913 // "required": true, 5914 // "type": "string" 5915 // }, 5916 // "steps": { 5917 // "description": "The minimum value to set the steps to.", 5918 // "format": "int32", 5919 // "location": "query", 5920 // "minimum": "1", 5921 // "required": true, 5922 // "type": "integer" 5923 // } 5924 // }, 5925 // "path": "achievements/{achievementId}/setStepsAtLeast", 5926 // "response": { 5927 // "$ref": "AchievementSetStepsAtLeastResponse" 5928 // }, 5929 // "scopes": [ 5930 // "https://www.googleapis.com/auth/games" 5931 // ] 5932 // } 5933 5934} 5935 5936// method id "games.achievements.unlock": 5937 5938type AchievementsUnlockCall struct { 5939 s *Service 5940 achievementId string 5941 urlParams_ gensupport.URLParams 5942 ctx_ context.Context 5943 header_ http.Header 5944} 5945 5946// Unlock: Unlocks this achievement for the currently authenticated 5947// player. 5948func (r *AchievementsService) Unlock(achievementId string) *AchievementsUnlockCall { 5949 c := &AchievementsUnlockCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5950 c.achievementId = achievementId 5951 return c 5952} 5953 5954// BuiltinGameId sets the optional parameter "builtinGameId": Override 5955// used only by built-in games in Play Games application. 5956func (c *AchievementsUnlockCall) BuiltinGameId(builtinGameId string) *AchievementsUnlockCall { 5957 c.urlParams_.Set("builtinGameId", builtinGameId) 5958 return c 5959} 5960 5961// Fields allows partial responses to be retrieved. See 5962// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5963// for more information. 5964func (c *AchievementsUnlockCall) Fields(s ...googleapi.Field) *AchievementsUnlockCall { 5965 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5966 return c 5967} 5968 5969// Context sets the context to be used in this call's Do method. Any 5970// pending HTTP request will be aborted if the provided context is 5971// canceled. 5972func (c *AchievementsUnlockCall) Context(ctx context.Context) *AchievementsUnlockCall { 5973 c.ctx_ = ctx 5974 return c 5975} 5976 5977// Header returns an http.Header that can be modified by the caller to 5978// add HTTP headers to the request. 5979func (c *AchievementsUnlockCall) Header() http.Header { 5980 if c.header_ == nil { 5981 c.header_ = make(http.Header) 5982 } 5983 return c.header_ 5984} 5985 5986func (c *AchievementsUnlockCall) doRequest(alt string) (*http.Response, error) { 5987 reqHeaders := make(http.Header) 5988 for k, v := range c.header_ { 5989 reqHeaders[k] = v 5990 } 5991 reqHeaders.Set("User-Agent", c.s.userAgent()) 5992 var body io.Reader = nil 5993 c.urlParams_.Set("alt", alt) 5994 c.urlParams_.Set("prettyPrint", "false") 5995 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/unlock") 5996 urls += "?" + c.urlParams_.Encode() 5997 req, err := http.NewRequest("POST", urls, body) 5998 if err != nil { 5999 return nil, err 6000 } 6001 req.Header = reqHeaders 6002 googleapi.Expand(req.URL, map[string]string{ 6003 "achievementId": c.achievementId, 6004 }) 6005 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6006} 6007 6008// Do executes the "games.achievements.unlock" call. 6009// Exactly one of *AchievementUnlockResponse or error will be non-nil. 6010// Any non-2xx status code is an error. Response headers are in either 6011// *AchievementUnlockResponse.ServerResponse.Header or (if a response 6012// was returned at all) in error.(*googleapi.Error).Header. Use 6013// googleapi.IsNotModified to check whether the returned error was 6014// because http.StatusNotModified was returned. 6015func (c *AchievementsUnlockCall) Do(opts ...googleapi.CallOption) (*AchievementUnlockResponse, error) { 6016 gensupport.SetOptions(c.urlParams_, opts...) 6017 res, err := c.doRequest("json") 6018 if res != nil && res.StatusCode == http.StatusNotModified { 6019 if res.Body != nil { 6020 res.Body.Close() 6021 } 6022 return nil, &googleapi.Error{ 6023 Code: res.StatusCode, 6024 Header: res.Header, 6025 } 6026 } 6027 if err != nil { 6028 return nil, err 6029 } 6030 defer googleapi.CloseBody(res) 6031 if err := googleapi.CheckResponse(res); err != nil { 6032 return nil, err 6033 } 6034 ret := &AchievementUnlockResponse{ 6035 ServerResponse: googleapi.ServerResponse{ 6036 Header: res.Header, 6037 HTTPStatusCode: res.StatusCode, 6038 }, 6039 } 6040 target := &ret 6041 if err := gensupport.DecodeResponse(target, res); err != nil { 6042 return nil, err 6043 } 6044 return ret, nil 6045 // { 6046 // "description": "Unlocks this achievement for the currently authenticated player.", 6047 // "httpMethod": "POST", 6048 // "id": "games.achievements.unlock", 6049 // "parameterOrder": [ 6050 // "achievementId" 6051 // ], 6052 // "parameters": { 6053 // "achievementId": { 6054 // "description": "The ID of the achievement used by this method.", 6055 // "location": "path", 6056 // "required": true, 6057 // "type": "string" 6058 // }, 6059 // "builtinGameId": { 6060 // "description": "Override used only by built-in games in Play Games application.", 6061 // "location": "query", 6062 // "type": "string" 6063 // } 6064 // }, 6065 // "path": "achievements/{achievementId}/unlock", 6066 // "response": { 6067 // "$ref": "AchievementUnlockResponse" 6068 // }, 6069 // "scopes": [ 6070 // "https://www.googleapis.com/auth/games" 6071 // ] 6072 // } 6073 6074} 6075 6076// method id "games.achievements.updateMultiple": 6077 6078type AchievementsUpdateMultipleCall struct { 6079 s *Service 6080 achievementupdatemultiplerequest *AchievementUpdateMultipleRequest 6081 urlParams_ gensupport.URLParams 6082 ctx_ context.Context 6083 header_ http.Header 6084} 6085 6086// UpdateMultiple: Updates multiple achievements for the currently 6087// authenticated player. 6088func (r *AchievementsService) UpdateMultiple(achievementupdatemultiplerequest *AchievementUpdateMultipleRequest) *AchievementsUpdateMultipleCall { 6089 c := &AchievementsUpdateMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6090 c.achievementupdatemultiplerequest = achievementupdatemultiplerequest 6091 return c 6092} 6093 6094// BuiltinGameId sets the optional parameter "builtinGameId": Override 6095// used only by built-in games in Play Games application. 6096func (c *AchievementsUpdateMultipleCall) BuiltinGameId(builtinGameId string) *AchievementsUpdateMultipleCall { 6097 c.urlParams_.Set("builtinGameId", builtinGameId) 6098 return c 6099} 6100 6101// Fields allows partial responses to be retrieved. See 6102// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6103// for more information. 6104func (c *AchievementsUpdateMultipleCall) Fields(s ...googleapi.Field) *AchievementsUpdateMultipleCall { 6105 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6106 return c 6107} 6108 6109// Context sets the context to be used in this call's Do method. Any 6110// pending HTTP request will be aborted if the provided context is 6111// canceled. 6112func (c *AchievementsUpdateMultipleCall) Context(ctx context.Context) *AchievementsUpdateMultipleCall { 6113 c.ctx_ = ctx 6114 return c 6115} 6116 6117// Header returns an http.Header that can be modified by the caller to 6118// add HTTP headers to the request. 6119func (c *AchievementsUpdateMultipleCall) Header() http.Header { 6120 if c.header_ == nil { 6121 c.header_ = make(http.Header) 6122 } 6123 return c.header_ 6124} 6125 6126func (c *AchievementsUpdateMultipleCall) doRequest(alt string) (*http.Response, error) { 6127 reqHeaders := make(http.Header) 6128 for k, v := range c.header_ { 6129 reqHeaders[k] = v 6130 } 6131 reqHeaders.Set("User-Agent", c.s.userAgent()) 6132 var body io.Reader = nil 6133 body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementupdatemultiplerequest) 6134 if err != nil { 6135 return nil, err 6136 } 6137 reqHeaders.Set("Content-Type", "application/json") 6138 c.urlParams_.Set("alt", alt) 6139 c.urlParams_.Set("prettyPrint", "false") 6140 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/updateMultiple") 6141 urls += "?" + c.urlParams_.Encode() 6142 req, err := http.NewRequest("POST", urls, body) 6143 if err != nil { 6144 return nil, err 6145 } 6146 req.Header = reqHeaders 6147 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6148} 6149 6150// Do executes the "games.achievements.updateMultiple" call. 6151// Exactly one of *AchievementUpdateMultipleResponse or error will be 6152// non-nil. Any non-2xx status code is an error. Response headers are in 6153// either *AchievementUpdateMultipleResponse.ServerResponse.Header or 6154// (if a response was returned at all) in 6155// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6156// whether the returned error was because http.StatusNotModified was 6157// returned. 6158func (c *AchievementsUpdateMultipleCall) Do(opts ...googleapi.CallOption) (*AchievementUpdateMultipleResponse, error) { 6159 gensupport.SetOptions(c.urlParams_, opts...) 6160 res, err := c.doRequest("json") 6161 if res != nil && res.StatusCode == http.StatusNotModified { 6162 if res.Body != nil { 6163 res.Body.Close() 6164 } 6165 return nil, &googleapi.Error{ 6166 Code: res.StatusCode, 6167 Header: res.Header, 6168 } 6169 } 6170 if err != nil { 6171 return nil, err 6172 } 6173 defer googleapi.CloseBody(res) 6174 if err := googleapi.CheckResponse(res); err != nil { 6175 return nil, err 6176 } 6177 ret := &AchievementUpdateMultipleResponse{ 6178 ServerResponse: googleapi.ServerResponse{ 6179 Header: res.Header, 6180 HTTPStatusCode: res.StatusCode, 6181 }, 6182 } 6183 target := &ret 6184 if err := gensupport.DecodeResponse(target, res); err != nil { 6185 return nil, err 6186 } 6187 return ret, nil 6188 // { 6189 // "description": "Updates multiple achievements for the currently authenticated player.", 6190 // "httpMethod": "POST", 6191 // "id": "games.achievements.updateMultiple", 6192 // "parameters": { 6193 // "builtinGameId": { 6194 // "description": "Override used only by built-in games in Play Games application.", 6195 // "location": "query", 6196 // "type": "string" 6197 // } 6198 // }, 6199 // "path": "achievements/updateMultiple", 6200 // "request": { 6201 // "$ref": "AchievementUpdateMultipleRequest" 6202 // }, 6203 // "response": { 6204 // "$ref": "AchievementUpdateMultipleResponse" 6205 // }, 6206 // "scopes": [ 6207 // "https://www.googleapis.com/auth/games" 6208 // ] 6209 // } 6210 6211} 6212 6213// method id "games.applications.get": 6214 6215type ApplicationsGetCall struct { 6216 s *Service 6217 applicationId string 6218 urlParams_ gensupport.URLParams 6219 ifNoneMatch_ string 6220 ctx_ context.Context 6221 header_ http.Header 6222} 6223 6224// Get: Retrieves the metadata of the application with the given ID. If 6225// the requested application is not available for the specified 6226// platformType, the returned response will not include any instance 6227// data. 6228func (r *ApplicationsService) Get(applicationId string) *ApplicationsGetCall { 6229 c := &ApplicationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6230 c.applicationId = applicationId 6231 return c 6232} 6233 6234// Language sets the optional parameter "language": The preferred 6235// language to use for strings returned by this method. 6236func (c *ApplicationsGetCall) Language(language string) *ApplicationsGetCall { 6237 c.urlParams_.Set("language", language) 6238 return c 6239} 6240 6241// PlatformType sets the optional parameter "platformType": Restrict 6242// application details returned to the specific platform. 6243// 6244// Possible values: 6245// "ANDROID" - Retrieve applications that can be played on Android. 6246// "IOS" - Retrieve applications that can be played on iOS. 6247// "WEB_APP" - Retrieve applications that can be played on desktop 6248// web. 6249func (c *ApplicationsGetCall) PlatformType(platformType string) *ApplicationsGetCall { 6250 c.urlParams_.Set("platformType", platformType) 6251 return c 6252} 6253 6254// Fields allows partial responses to be retrieved. See 6255// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6256// for more information. 6257func (c *ApplicationsGetCall) Fields(s ...googleapi.Field) *ApplicationsGetCall { 6258 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6259 return c 6260} 6261 6262// IfNoneMatch sets the optional parameter which makes the operation 6263// fail if the object's ETag matches the given value. This is useful for 6264// getting updates only after the object has changed since the last 6265// request. Use googleapi.IsNotModified to check whether the response 6266// error from Do is the result of In-None-Match. 6267func (c *ApplicationsGetCall) IfNoneMatch(entityTag string) *ApplicationsGetCall { 6268 c.ifNoneMatch_ = entityTag 6269 return c 6270} 6271 6272// Context sets the context to be used in this call's Do method. Any 6273// pending HTTP request will be aborted if the provided context is 6274// canceled. 6275func (c *ApplicationsGetCall) Context(ctx context.Context) *ApplicationsGetCall { 6276 c.ctx_ = ctx 6277 return c 6278} 6279 6280// Header returns an http.Header that can be modified by the caller to 6281// add HTTP headers to the request. 6282func (c *ApplicationsGetCall) Header() http.Header { 6283 if c.header_ == nil { 6284 c.header_ = make(http.Header) 6285 } 6286 return c.header_ 6287} 6288 6289func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) { 6290 reqHeaders := make(http.Header) 6291 for k, v := range c.header_ { 6292 reqHeaders[k] = v 6293 } 6294 reqHeaders.Set("User-Agent", c.s.userAgent()) 6295 if c.ifNoneMatch_ != "" { 6296 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6297 } 6298 var body io.Reader = nil 6299 c.urlParams_.Set("alt", alt) 6300 c.urlParams_.Set("prettyPrint", "false") 6301 urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}") 6302 urls += "?" + c.urlParams_.Encode() 6303 req, err := http.NewRequest("GET", urls, body) 6304 if err != nil { 6305 return nil, err 6306 } 6307 req.Header = reqHeaders 6308 googleapi.Expand(req.URL, map[string]string{ 6309 "applicationId": c.applicationId, 6310 }) 6311 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6312} 6313 6314// Do executes the "games.applications.get" call. 6315// Exactly one of *Application or error will be non-nil. Any non-2xx 6316// status code is an error. Response headers are in either 6317// *Application.ServerResponse.Header or (if a response was returned at 6318// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6319// to check whether the returned error was because 6320// http.StatusNotModified was returned. 6321func (c *ApplicationsGetCall) Do(opts ...googleapi.CallOption) (*Application, error) { 6322 gensupport.SetOptions(c.urlParams_, opts...) 6323 res, err := c.doRequest("json") 6324 if res != nil && res.StatusCode == http.StatusNotModified { 6325 if res.Body != nil { 6326 res.Body.Close() 6327 } 6328 return nil, &googleapi.Error{ 6329 Code: res.StatusCode, 6330 Header: res.Header, 6331 } 6332 } 6333 if err != nil { 6334 return nil, err 6335 } 6336 defer googleapi.CloseBody(res) 6337 if err := googleapi.CheckResponse(res); err != nil { 6338 return nil, err 6339 } 6340 ret := &Application{ 6341 ServerResponse: googleapi.ServerResponse{ 6342 Header: res.Header, 6343 HTTPStatusCode: res.StatusCode, 6344 }, 6345 } 6346 target := &ret 6347 if err := gensupport.DecodeResponse(target, res); err != nil { 6348 return nil, err 6349 } 6350 return ret, nil 6351 // { 6352 // "description": "Retrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned response will not include any instance data.", 6353 // "httpMethod": "GET", 6354 // "id": "games.applications.get", 6355 // "parameterOrder": [ 6356 // "applicationId" 6357 // ], 6358 // "parameters": { 6359 // "applicationId": { 6360 // "description": "The application ID from the Google Play developer console.", 6361 // "location": "path", 6362 // "required": true, 6363 // "type": "string" 6364 // }, 6365 // "language": { 6366 // "description": "The preferred language to use for strings returned by this method.", 6367 // "location": "query", 6368 // "type": "string" 6369 // }, 6370 // "platformType": { 6371 // "description": "Restrict application details returned to the specific platform.", 6372 // "enum": [ 6373 // "ANDROID", 6374 // "IOS", 6375 // "WEB_APP" 6376 // ], 6377 // "enumDescriptions": [ 6378 // "Retrieve applications that can be played on Android.", 6379 // "Retrieve applications that can be played on iOS.", 6380 // "Retrieve applications that can be played on desktop web." 6381 // ], 6382 // "location": "query", 6383 // "type": "string" 6384 // } 6385 // }, 6386 // "path": "applications/{applicationId}", 6387 // "response": { 6388 // "$ref": "Application" 6389 // }, 6390 // "scopes": [ 6391 // "https://www.googleapis.com/auth/games" 6392 // ] 6393 // } 6394 6395} 6396 6397// method id "games.applications.played": 6398 6399type ApplicationsPlayedCall struct { 6400 s *Service 6401 urlParams_ gensupport.URLParams 6402 ctx_ context.Context 6403 header_ http.Header 6404} 6405 6406// Played: Indicate that the the currently authenticated user is playing 6407// your application. 6408func (r *ApplicationsService) Played() *ApplicationsPlayedCall { 6409 c := &ApplicationsPlayedCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6410 return c 6411} 6412 6413// BuiltinGameId sets the optional parameter "builtinGameId": Override 6414// used only by built-in games in Play Games application. 6415func (c *ApplicationsPlayedCall) BuiltinGameId(builtinGameId string) *ApplicationsPlayedCall { 6416 c.urlParams_.Set("builtinGameId", builtinGameId) 6417 return c 6418} 6419 6420// Fields allows partial responses to be retrieved. See 6421// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6422// for more information. 6423func (c *ApplicationsPlayedCall) Fields(s ...googleapi.Field) *ApplicationsPlayedCall { 6424 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6425 return c 6426} 6427 6428// Context sets the context to be used in this call's Do method. Any 6429// pending HTTP request will be aborted if the provided context is 6430// canceled. 6431func (c *ApplicationsPlayedCall) Context(ctx context.Context) *ApplicationsPlayedCall { 6432 c.ctx_ = ctx 6433 return c 6434} 6435 6436// Header returns an http.Header that can be modified by the caller to 6437// add HTTP headers to the request. 6438func (c *ApplicationsPlayedCall) Header() http.Header { 6439 if c.header_ == nil { 6440 c.header_ = make(http.Header) 6441 } 6442 return c.header_ 6443} 6444 6445func (c *ApplicationsPlayedCall) doRequest(alt string) (*http.Response, error) { 6446 reqHeaders := make(http.Header) 6447 for k, v := range c.header_ { 6448 reqHeaders[k] = v 6449 } 6450 reqHeaders.Set("User-Agent", c.s.userAgent()) 6451 var body io.Reader = nil 6452 c.urlParams_.Set("alt", alt) 6453 c.urlParams_.Set("prettyPrint", "false") 6454 urls := googleapi.ResolveRelative(c.s.BasePath, "applications/played") 6455 urls += "?" + c.urlParams_.Encode() 6456 req, err := http.NewRequest("POST", urls, body) 6457 if err != nil { 6458 return nil, err 6459 } 6460 req.Header = reqHeaders 6461 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6462} 6463 6464// Do executes the "games.applications.played" call. 6465func (c *ApplicationsPlayedCall) Do(opts ...googleapi.CallOption) error { 6466 gensupport.SetOptions(c.urlParams_, opts...) 6467 res, err := c.doRequest("json") 6468 if err != nil { 6469 return err 6470 } 6471 defer googleapi.CloseBody(res) 6472 if err := googleapi.CheckResponse(res); err != nil { 6473 return err 6474 } 6475 return nil 6476 // { 6477 // "description": "Indicate that the the currently authenticated user is playing your application.", 6478 // "httpMethod": "POST", 6479 // "id": "games.applications.played", 6480 // "parameters": { 6481 // "builtinGameId": { 6482 // "description": "Override used only by built-in games in Play Games application.", 6483 // "location": "query", 6484 // "type": "string" 6485 // } 6486 // }, 6487 // "path": "applications/played", 6488 // "scopes": [ 6489 // "https://www.googleapis.com/auth/games" 6490 // ] 6491 // } 6492 6493} 6494 6495// method id "games.applications.verify": 6496 6497type ApplicationsVerifyCall struct { 6498 s *Service 6499 applicationId string 6500 urlParams_ gensupport.URLParams 6501 ifNoneMatch_ string 6502 ctx_ context.Context 6503 header_ http.Header 6504} 6505 6506// Verify: Verifies the auth token provided with this request is for the 6507// application with the specified ID, and returns the ID of the player 6508// it was granted for. 6509func (r *ApplicationsService) Verify(applicationId string) *ApplicationsVerifyCall { 6510 c := &ApplicationsVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6511 c.applicationId = applicationId 6512 return c 6513} 6514 6515// Fields allows partial responses to be retrieved. See 6516// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6517// for more information. 6518func (c *ApplicationsVerifyCall) Fields(s ...googleapi.Field) *ApplicationsVerifyCall { 6519 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6520 return c 6521} 6522 6523// IfNoneMatch sets the optional parameter which makes the operation 6524// fail if the object's ETag matches the given value. This is useful for 6525// getting updates only after the object has changed since the last 6526// request. Use googleapi.IsNotModified to check whether the response 6527// error from Do is the result of In-None-Match. 6528func (c *ApplicationsVerifyCall) IfNoneMatch(entityTag string) *ApplicationsVerifyCall { 6529 c.ifNoneMatch_ = entityTag 6530 return c 6531} 6532 6533// Context sets the context to be used in this call's Do method. Any 6534// pending HTTP request will be aborted if the provided context is 6535// canceled. 6536func (c *ApplicationsVerifyCall) Context(ctx context.Context) *ApplicationsVerifyCall { 6537 c.ctx_ = ctx 6538 return c 6539} 6540 6541// Header returns an http.Header that can be modified by the caller to 6542// add HTTP headers to the request. 6543func (c *ApplicationsVerifyCall) Header() http.Header { 6544 if c.header_ == nil { 6545 c.header_ = make(http.Header) 6546 } 6547 return c.header_ 6548} 6549 6550func (c *ApplicationsVerifyCall) doRequest(alt string) (*http.Response, error) { 6551 reqHeaders := make(http.Header) 6552 for k, v := range c.header_ { 6553 reqHeaders[k] = v 6554 } 6555 reqHeaders.Set("User-Agent", c.s.userAgent()) 6556 if c.ifNoneMatch_ != "" { 6557 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6558 } 6559 var body io.Reader = nil 6560 c.urlParams_.Set("alt", alt) 6561 c.urlParams_.Set("prettyPrint", "false") 6562 urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/verify") 6563 urls += "?" + c.urlParams_.Encode() 6564 req, err := http.NewRequest("GET", urls, body) 6565 if err != nil { 6566 return nil, err 6567 } 6568 req.Header = reqHeaders 6569 googleapi.Expand(req.URL, map[string]string{ 6570 "applicationId": c.applicationId, 6571 }) 6572 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6573} 6574 6575// Do executes the "games.applications.verify" call. 6576// Exactly one of *ApplicationVerifyResponse or error will be non-nil. 6577// Any non-2xx status code is an error. Response headers are in either 6578// *ApplicationVerifyResponse.ServerResponse.Header or (if a response 6579// was returned at all) in error.(*googleapi.Error).Header. Use 6580// googleapi.IsNotModified to check whether the returned error was 6581// because http.StatusNotModified was returned. 6582func (c *ApplicationsVerifyCall) Do(opts ...googleapi.CallOption) (*ApplicationVerifyResponse, error) { 6583 gensupport.SetOptions(c.urlParams_, opts...) 6584 res, err := c.doRequest("json") 6585 if res != nil && res.StatusCode == http.StatusNotModified { 6586 if res.Body != nil { 6587 res.Body.Close() 6588 } 6589 return nil, &googleapi.Error{ 6590 Code: res.StatusCode, 6591 Header: res.Header, 6592 } 6593 } 6594 if err != nil { 6595 return nil, err 6596 } 6597 defer googleapi.CloseBody(res) 6598 if err := googleapi.CheckResponse(res); err != nil { 6599 return nil, err 6600 } 6601 ret := &ApplicationVerifyResponse{ 6602 ServerResponse: googleapi.ServerResponse{ 6603 Header: res.Header, 6604 HTTPStatusCode: res.StatusCode, 6605 }, 6606 } 6607 target := &ret 6608 if err := gensupport.DecodeResponse(target, res); err != nil { 6609 return nil, err 6610 } 6611 return ret, nil 6612 // { 6613 // "description": "Verifies the auth token provided with this request is for the application with the specified ID, and returns the ID of the player it was granted for.", 6614 // "httpMethod": "GET", 6615 // "id": "games.applications.verify", 6616 // "parameterOrder": [ 6617 // "applicationId" 6618 // ], 6619 // "parameters": { 6620 // "applicationId": { 6621 // "description": "The application ID from the Google Play developer console.", 6622 // "location": "path", 6623 // "required": true, 6624 // "type": "string" 6625 // } 6626 // }, 6627 // "path": "applications/{applicationId}/verify", 6628 // "response": { 6629 // "$ref": "ApplicationVerifyResponse" 6630 // }, 6631 // "scopes": [ 6632 // "https://www.googleapis.com/auth/games" 6633 // ] 6634 // } 6635 6636} 6637 6638// method id "games.events.listByPlayer": 6639 6640type EventsListByPlayerCall struct { 6641 s *Service 6642 urlParams_ gensupport.URLParams 6643 ifNoneMatch_ string 6644 ctx_ context.Context 6645 header_ http.Header 6646} 6647 6648// ListByPlayer: Returns a list showing the current progress on events 6649// in this application for the currently authenticated user. 6650func (r *EventsService) ListByPlayer() *EventsListByPlayerCall { 6651 c := &EventsListByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6652 return c 6653} 6654 6655// Language sets the optional parameter "language": The preferred 6656// language to use for strings returned by this method. 6657func (c *EventsListByPlayerCall) Language(language string) *EventsListByPlayerCall { 6658 c.urlParams_.Set("language", language) 6659 return c 6660} 6661 6662// MaxResults sets the optional parameter "maxResults": The maximum 6663// number of events to return in the response, used for paging. For any 6664// response, the actual number of events to return may be less than the 6665// specified maxResults. 6666func (c *EventsListByPlayerCall) MaxResults(maxResults int64) *EventsListByPlayerCall { 6667 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6668 return c 6669} 6670 6671// PageToken sets the optional parameter "pageToken": The token returned 6672// by the previous request. 6673func (c *EventsListByPlayerCall) PageToken(pageToken string) *EventsListByPlayerCall { 6674 c.urlParams_.Set("pageToken", pageToken) 6675 return c 6676} 6677 6678// Fields allows partial responses to be retrieved. See 6679// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6680// for more information. 6681func (c *EventsListByPlayerCall) Fields(s ...googleapi.Field) *EventsListByPlayerCall { 6682 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6683 return c 6684} 6685 6686// IfNoneMatch sets the optional parameter which makes the operation 6687// fail if the object's ETag matches the given value. This is useful for 6688// getting updates only after the object has changed since the last 6689// request. Use googleapi.IsNotModified to check whether the response 6690// error from Do is the result of In-None-Match. 6691func (c *EventsListByPlayerCall) IfNoneMatch(entityTag string) *EventsListByPlayerCall { 6692 c.ifNoneMatch_ = entityTag 6693 return c 6694} 6695 6696// Context sets the context to be used in this call's Do method. Any 6697// pending HTTP request will be aborted if the provided context is 6698// canceled. 6699func (c *EventsListByPlayerCall) Context(ctx context.Context) *EventsListByPlayerCall { 6700 c.ctx_ = ctx 6701 return c 6702} 6703 6704// Header returns an http.Header that can be modified by the caller to 6705// add HTTP headers to the request. 6706func (c *EventsListByPlayerCall) Header() http.Header { 6707 if c.header_ == nil { 6708 c.header_ = make(http.Header) 6709 } 6710 return c.header_ 6711} 6712 6713func (c *EventsListByPlayerCall) doRequest(alt string) (*http.Response, error) { 6714 reqHeaders := make(http.Header) 6715 for k, v := range c.header_ { 6716 reqHeaders[k] = v 6717 } 6718 reqHeaders.Set("User-Agent", c.s.userAgent()) 6719 if c.ifNoneMatch_ != "" { 6720 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6721 } 6722 var body io.Reader = nil 6723 c.urlParams_.Set("alt", alt) 6724 c.urlParams_.Set("prettyPrint", "false") 6725 urls := googleapi.ResolveRelative(c.s.BasePath, "events") 6726 urls += "?" + c.urlParams_.Encode() 6727 req, err := http.NewRequest("GET", urls, body) 6728 if err != nil { 6729 return nil, err 6730 } 6731 req.Header = reqHeaders 6732 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6733} 6734 6735// Do executes the "games.events.listByPlayer" call. 6736// Exactly one of *PlayerEventListResponse or error will be non-nil. Any 6737// non-2xx status code is an error. Response headers are in either 6738// *PlayerEventListResponse.ServerResponse.Header or (if a response was 6739// returned at all) in error.(*googleapi.Error).Header. Use 6740// googleapi.IsNotModified to check whether the returned error was 6741// because http.StatusNotModified was returned. 6742func (c *EventsListByPlayerCall) Do(opts ...googleapi.CallOption) (*PlayerEventListResponse, error) { 6743 gensupport.SetOptions(c.urlParams_, opts...) 6744 res, err := c.doRequest("json") 6745 if res != nil && res.StatusCode == http.StatusNotModified { 6746 if res.Body != nil { 6747 res.Body.Close() 6748 } 6749 return nil, &googleapi.Error{ 6750 Code: res.StatusCode, 6751 Header: res.Header, 6752 } 6753 } 6754 if err != nil { 6755 return nil, err 6756 } 6757 defer googleapi.CloseBody(res) 6758 if err := googleapi.CheckResponse(res); err != nil { 6759 return nil, err 6760 } 6761 ret := &PlayerEventListResponse{ 6762 ServerResponse: googleapi.ServerResponse{ 6763 Header: res.Header, 6764 HTTPStatusCode: res.StatusCode, 6765 }, 6766 } 6767 target := &ret 6768 if err := gensupport.DecodeResponse(target, res); err != nil { 6769 return nil, err 6770 } 6771 return ret, nil 6772 // { 6773 // "description": "Returns a list showing the current progress on events in this application for the currently authenticated user.", 6774 // "httpMethod": "GET", 6775 // "id": "games.events.listByPlayer", 6776 // "parameters": { 6777 // "language": { 6778 // "description": "The preferred language to use for strings returned by this method.", 6779 // "location": "query", 6780 // "type": "string" 6781 // }, 6782 // "maxResults": { 6783 // "description": "The maximum number of events to return in the response, used for paging. For any response, the actual number of events to return may be less than the specified maxResults.", 6784 // "format": "int32", 6785 // "location": "query", 6786 // "maximum": "100", 6787 // "minimum": "1", 6788 // "type": "integer" 6789 // }, 6790 // "pageToken": { 6791 // "description": "The token returned by the previous request.", 6792 // "location": "query", 6793 // "type": "string" 6794 // } 6795 // }, 6796 // "path": "events", 6797 // "response": { 6798 // "$ref": "PlayerEventListResponse" 6799 // }, 6800 // "scopes": [ 6801 // "https://www.googleapis.com/auth/games" 6802 // ] 6803 // } 6804 6805} 6806 6807// Pages invokes f for each page of results. 6808// A non-nil error returned from f will halt the iteration. 6809// The provided context supersedes any context provided to the Context method. 6810func (c *EventsListByPlayerCall) Pages(ctx context.Context, f func(*PlayerEventListResponse) error) error { 6811 c.ctx_ = ctx 6812 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6813 for { 6814 x, err := c.Do() 6815 if err != nil { 6816 return err 6817 } 6818 if err := f(x); err != nil { 6819 return err 6820 } 6821 if x.NextPageToken == "" { 6822 return nil 6823 } 6824 c.PageToken(x.NextPageToken) 6825 } 6826} 6827 6828// method id "games.events.listDefinitions": 6829 6830type EventsListDefinitionsCall struct { 6831 s *Service 6832 urlParams_ gensupport.URLParams 6833 ifNoneMatch_ string 6834 ctx_ context.Context 6835 header_ http.Header 6836} 6837 6838// ListDefinitions: Returns a list of the event definitions in this 6839// application. 6840func (r *EventsService) ListDefinitions() *EventsListDefinitionsCall { 6841 c := &EventsListDefinitionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6842 return c 6843} 6844 6845// Language sets the optional parameter "language": The preferred 6846// language to use for strings returned by this method. 6847func (c *EventsListDefinitionsCall) Language(language string) *EventsListDefinitionsCall { 6848 c.urlParams_.Set("language", language) 6849 return c 6850} 6851 6852// MaxResults sets the optional parameter "maxResults": The maximum 6853// number of event definitions to return in the response, used for 6854// paging. For any response, the actual number of event definitions to 6855// return may be less than the specified maxResults. 6856func (c *EventsListDefinitionsCall) MaxResults(maxResults int64) *EventsListDefinitionsCall { 6857 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6858 return c 6859} 6860 6861// PageToken sets the optional parameter "pageToken": The token returned 6862// by the previous request. 6863func (c *EventsListDefinitionsCall) PageToken(pageToken string) *EventsListDefinitionsCall { 6864 c.urlParams_.Set("pageToken", pageToken) 6865 return c 6866} 6867 6868// Fields allows partial responses to be retrieved. See 6869// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6870// for more information. 6871func (c *EventsListDefinitionsCall) Fields(s ...googleapi.Field) *EventsListDefinitionsCall { 6872 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6873 return c 6874} 6875 6876// IfNoneMatch sets the optional parameter which makes the operation 6877// fail if the object's ETag matches the given value. This is useful for 6878// getting updates only after the object has changed since the last 6879// request. Use googleapi.IsNotModified to check whether the response 6880// error from Do is the result of In-None-Match. 6881func (c *EventsListDefinitionsCall) IfNoneMatch(entityTag string) *EventsListDefinitionsCall { 6882 c.ifNoneMatch_ = entityTag 6883 return c 6884} 6885 6886// Context sets the context to be used in this call's Do method. Any 6887// pending HTTP request will be aborted if the provided context is 6888// canceled. 6889func (c *EventsListDefinitionsCall) Context(ctx context.Context) *EventsListDefinitionsCall { 6890 c.ctx_ = ctx 6891 return c 6892} 6893 6894// Header returns an http.Header that can be modified by the caller to 6895// add HTTP headers to the request. 6896func (c *EventsListDefinitionsCall) Header() http.Header { 6897 if c.header_ == nil { 6898 c.header_ = make(http.Header) 6899 } 6900 return c.header_ 6901} 6902 6903func (c *EventsListDefinitionsCall) doRequest(alt string) (*http.Response, error) { 6904 reqHeaders := make(http.Header) 6905 for k, v := range c.header_ { 6906 reqHeaders[k] = v 6907 } 6908 reqHeaders.Set("User-Agent", c.s.userAgent()) 6909 if c.ifNoneMatch_ != "" { 6910 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6911 } 6912 var body io.Reader = nil 6913 c.urlParams_.Set("alt", alt) 6914 c.urlParams_.Set("prettyPrint", "false") 6915 urls := googleapi.ResolveRelative(c.s.BasePath, "eventDefinitions") 6916 urls += "?" + c.urlParams_.Encode() 6917 req, err := http.NewRequest("GET", urls, body) 6918 if err != nil { 6919 return nil, err 6920 } 6921 req.Header = reqHeaders 6922 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6923} 6924 6925// Do executes the "games.events.listDefinitions" call. 6926// Exactly one of *EventDefinitionListResponse or error will be non-nil. 6927// Any non-2xx status code is an error. Response headers are in either 6928// *EventDefinitionListResponse.ServerResponse.Header or (if a response 6929// was returned at all) in error.(*googleapi.Error).Header. Use 6930// googleapi.IsNotModified to check whether the returned error was 6931// because http.StatusNotModified was returned. 6932func (c *EventsListDefinitionsCall) Do(opts ...googleapi.CallOption) (*EventDefinitionListResponse, error) { 6933 gensupport.SetOptions(c.urlParams_, opts...) 6934 res, err := c.doRequest("json") 6935 if res != nil && res.StatusCode == http.StatusNotModified { 6936 if res.Body != nil { 6937 res.Body.Close() 6938 } 6939 return nil, &googleapi.Error{ 6940 Code: res.StatusCode, 6941 Header: res.Header, 6942 } 6943 } 6944 if err != nil { 6945 return nil, err 6946 } 6947 defer googleapi.CloseBody(res) 6948 if err := googleapi.CheckResponse(res); err != nil { 6949 return nil, err 6950 } 6951 ret := &EventDefinitionListResponse{ 6952 ServerResponse: googleapi.ServerResponse{ 6953 Header: res.Header, 6954 HTTPStatusCode: res.StatusCode, 6955 }, 6956 } 6957 target := &ret 6958 if err := gensupport.DecodeResponse(target, res); err != nil { 6959 return nil, err 6960 } 6961 return ret, nil 6962 // { 6963 // "description": "Returns a list of the event definitions in this application.", 6964 // "httpMethod": "GET", 6965 // "id": "games.events.listDefinitions", 6966 // "parameters": { 6967 // "language": { 6968 // "description": "The preferred language to use for strings returned by this method.", 6969 // "location": "query", 6970 // "type": "string" 6971 // }, 6972 // "maxResults": { 6973 // "description": "The maximum number of event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified maxResults.", 6974 // "format": "int32", 6975 // "location": "query", 6976 // "maximum": "100", 6977 // "minimum": "1", 6978 // "type": "integer" 6979 // }, 6980 // "pageToken": { 6981 // "description": "The token returned by the previous request.", 6982 // "location": "query", 6983 // "type": "string" 6984 // } 6985 // }, 6986 // "path": "eventDefinitions", 6987 // "response": { 6988 // "$ref": "EventDefinitionListResponse" 6989 // }, 6990 // "scopes": [ 6991 // "https://www.googleapis.com/auth/games" 6992 // ] 6993 // } 6994 6995} 6996 6997// Pages invokes f for each page of results. 6998// A non-nil error returned from f will halt the iteration. 6999// The provided context supersedes any context provided to the Context method. 7000func (c *EventsListDefinitionsCall) Pages(ctx context.Context, f func(*EventDefinitionListResponse) error) error { 7001 c.ctx_ = ctx 7002 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7003 for { 7004 x, err := c.Do() 7005 if err != nil { 7006 return err 7007 } 7008 if err := f(x); err != nil { 7009 return err 7010 } 7011 if x.NextPageToken == "" { 7012 return nil 7013 } 7014 c.PageToken(x.NextPageToken) 7015 } 7016} 7017 7018// method id "games.events.record": 7019 7020type EventsRecordCall struct { 7021 s *Service 7022 eventrecordrequest *EventRecordRequest 7023 urlParams_ gensupport.URLParams 7024 ctx_ context.Context 7025 header_ http.Header 7026} 7027 7028// Record: Records a batch of changes to the number of times events have 7029// occurred for the currently authenticated user of this application. 7030func (r *EventsService) Record(eventrecordrequest *EventRecordRequest) *EventsRecordCall { 7031 c := &EventsRecordCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7032 c.eventrecordrequest = eventrecordrequest 7033 return c 7034} 7035 7036// Language sets the optional parameter "language": The preferred 7037// language to use for strings returned by this method. 7038func (c *EventsRecordCall) Language(language string) *EventsRecordCall { 7039 c.urlParams_.Set("language", language) 7040 return c 7041} 7042 7043// Fields allows partial responses to be retrieved. See 7044// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7045// for more information. 7046func (c *EventsRecordCall) Fields(s ...googleapi.Field) *EventsRecordCall { 7047 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7048 return c 7049} 7050 7051// Context sets the context to be used in this call's Do method. Any 7052// pending HTTP request will be aborted if the provided context is 7053// canceled. 7054func (c *EventsRecordCall) Context(ctx context.Context) *EventsRecordCall { 7055 c.ctx_ = ctx 7056 return c 7057} 7058 7059// Header returns an http.Header that can be modified by the caller to 7060// add HTTP headers to the request. 7061func (c *EventsRecordCall) Header() http.Header { 7062 if c.header_ == nil { 7063 c.header_ = make(http.Header) 7064 } 7065 return c.header_ 7066} 7067 7068func (c *EventsRecordCall) doRequest(alt string) (*http.Response, error) { 7069 reqHeaders := make(http.Header) 7070 for k, v := range c.header_ { 7071 reqHeaders[k] = v 7072 } 7073 reqHeaders.Set("User-Agent", c.s.userAgent()) 7074 var body io.Reader = nil 7075 body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventrecordrequest) 7076 if err != nil { 7077 return nil, err 7078 } 7079 reqHeaders.Set("Content-Type", "application/json") 7080 c.urlParams_.Set("alt", alt) 7081 c.urlParams_.Set("prettyPrint", "false") 7082 urls := googleapi.ResolveRelative(c.s.BasePath, "events") 7083 urls += "?" + c.urlParams_.Encode() 7084 req, err := http.NewRequest("POST", urls, body) 7085 if err != nil { 7086 return nil, err 7087 } 7088 req.Header = reqHeaders 7089 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7090} 7091 7092// Do executes the "games.events.record" call. 7093// Exactly one of *EventUpdateResponse or error will be non-nil. Any 7094// non-2xx status code is an error. Response headers are in either 7095// *EventUpdateResponse.ServerResponse.Header or (if a response was 7096// returned at all) in error.(*googleapi.Error).Header. Use 7097// googleapi.IsNotModified to check whether the returned error was 7098// because http.StatusNotModified was returned. 7099func (c *EventsRecordCall) Do(opts ...googleapi.CallOption) (*EventUpdateResponse, error) { 7100 gensupport.SetOptions(c.urlParams_, opts...) 7101 res, err := c.doRequest("json") 7102 if res != nil && res.StatusCode == http.StatusNotModified { 7103 if res.Body != nil { 7104 res.Body.Close() 7105 } 7106 return nil, &googleapi.Error{ 7107 Code: res.StatusCode, 7108 Header: res.Header, 7109 } 7110 } 7111 if err != nil { 7112 return nil, err 7113 } 7114 defer googleapi.CloseBody(res) 7115 if err := googleapi.CheckResponse(res); err != nil { 7116 return nil, err 7117 } 7118 ret := &EventUpdateResponse{ 7119 ServerResponse: googleapi.ServerResponse{ 7120 Header: res.Header, 7121 HTTPStatusCode: res.StatusCode, 7122 }, 7123 } 7124 target := &ret 7125 if err := gensupport.DecodeResponse(target, res); err != nil { 7126 return nil, err 7127 } 7128 return ret, nil 7129 // { 7130 // "description": "Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.", 7131 // "httpMethod": "POST", 7132 // "id": "games.events.record", 7133 // "parameters": { 7134 // "language": { 7135 // "description": "The preferred language to use for strings returned by this method.", 7136 // "location": "query", 7137 // "type": "string" 7138 // } 7139 // }, 7140 // "path": "events", 7141 // "request": { 7142 // "$ref": "EventRecordRequest" 7143 // }, 7144 // "response": { 7145 // "$ref": "EventUpdateResponse" 7146 // }, 7147 // "scopes": [ 7148 // "https://www.googleapis.com/auth/games" 7149 // ] 7150 // } 7151 7152} 7153 7154// method id "games.leaderboards.get": 7155 7156type LeaderboardsGetCall struct { 7157 s *Service 7158 leaderboardId string 7159 urlParams_ gensupport.URLParams 7160 ifNoneMatch_ string 7161 ctx_ context.Context 7162 header_ http.Header 7163} 7164 7165// Get: Retrieves the metadata of the leaderboard with the given ID. 7166func (r *LeaderboardsService) Get(leaderboardId string) *LeaderboardsGetCall { 7167 c := &LeaderboardsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7168 c.leaderboardId = leaderboardId 7169 return c 7170} 7171 7172// Language sets the optional parameter "language": The preferred 7173// language to use for strings returned by this method. 7174func (c *LeaderboardsGetCall) Language(language string) *LeaderboardsGetCall { 7175 c.urlParams_.Set("language", language) 7176 return c 7177} 7178 7179// Fields allows partial responses to be retrieved. See 7180// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7181// for more information. 7182func (c *LeaderboardsGetCall) Fields(s ...googleapi.Field) *LeaderboardsGetCall { 7183 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7184 return c 7185} 7186 7187// IfNoneMatch sets the optional parameter which makes the operation 7188// fail if the object's ETag matches the given value. This is useful for 7189// getting updates only after the object has changed since the last 7190// request. Use googleapi.IsNotModified to check whether the response 7191// error from Do is the result of In-None-Match. 7192func (c *LeaderboardsGetCall) IfNoneMatch(entityTag string) *LeaderboardsGetCall { 7193 c.ifNoneMatch_ = entityTag 7194 return c 7195} 7196 7197// Context sets the context to be used in this call's Do method. Any 7198// pending HTTP request will be aborted if the provided context is 7199// canceled. 7200func (c *LeaderboardsGetCall) Context(ctx context.Context) *LeaderboardsGetCall { 7201 c.ctx_ = ctx 7202 return c 7203} 7204 7205// Header returns an http.Header that can be modified by the caller to 7206// add HTTP headers to the request. 7207func (c *LeaderboardsGetCall) Header() http.Header { 7208 if c.header_ == nil { 7209 c.header_ = make(http.Header) 7210 } 7211 return c.header_ 7212} 7213 7214func (c *LeaderboardsGetCall) doRequest(alt string) (*http.Response, error) { 7215 reqHeaders := make(http.Header) 7216 for k, v := range c.header_ { 7217 reqHeaders[k] = v 7218 } 7219 reqHeaders.Set("User-Agent", c.s.userAgent()) 7220 if c.ifNoneMatch_ != "" { 7221 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7222 } 7223 var body io.Reader = nil 7224 c.urlParams_.Set("alt", alt) 7225 c.urlParams_.Set("prettyPrint", "false") 7226 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}") 7227 urls += "?" + c.urlParams_.Encode() 7228 req, err := http.NewRequest("GET", urls, body) 7229 if err != nil { 7230 return nil, err 7231 } 7232 req.Header = reqHeaders 7233 googleapi.Expand(req.URL, map[string]string{ 7234 "leaderboardId": c.leaderboardId, 7235 }) 7236 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7237} 7238 7239// Do executes the "games.leaderboards.get" call. 7240// Exactly one of *Leaderboard or error will be non-nil. Any non-2xx 7241// status code is an error. Response headers are in either 7242// *Leaderboard.ServerResponse.Header or (if a response was returned at 7243// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7244// to check whether the returned error was because 7245// http.StatusNotModified was returned. 7246func (c *LeaderboardsGetCall) Do(opts ...googleapi.CallOption) (*Leaderboard, error) { 7247 gensupport.SetOptions(c.urlParams_, opts...) 7248 res, err := c.doRequest("json") 7249 if res != nil && res.StatusCode == http.StatusNotModified { 7250 if res.Body != nil { 7251 res.Body.Close() 7252 } 7253 return nil, &googleapi.Error{ 7254 Code: res.StatusCode, 7255 Header: res.Header, 7256 } 7257 } 7258 if err != nil { 7259 return nil, err 7260 } 7261 defer googleapi.CloseBody(res) 7262 if err := googleapi.CheckResponse(res); err != nil { 7263 return nil, err 7264 } 7265 ret := &Leaderboard{ 7266 ServerResponse: googleapi.ServerResponse{ 7267 Header: res.Header, 7268 HTTPStatusCode: res.StatusCode, 7269 }, 7270 } 7271 target := &ret 7272 if err := gensupport.DecodeResponse(target, res); err != nil { 7273 return nil, err 7274 } 7275 return ret, nil 7276 // { 7277 // "description": "Retrieves the metadata of the leaderboard with the given ID.", 7278 // "httpMethod": "GET", 7279 // "id": "games.leaderboards.get", 7280 // "parameterOrder": [ 7281 // "leaderboardId" 7282 // ], 7283 // "parameters": { 7284 // "language": { 7285 // "description": "The preferred language to use for strings returned by this method.", 7286 // "location": "query", 7287 // "type": "string" 7288 // }, 7289 // "leaderboardId": { 7290 // "description": "The ID of the leaderboard.", 7291 // "location": "path", 7292 // "required": true, 7293 // "type": "string" 7294 // } 7295 // }, 7296 // "path": "leaderboards/{leaderboardId}", 7297 // "response": { 7298 // "$ref": "Leaderboard" 7299 // }, 7300 // "scopes": [ 7301 // "https://www.googleapis.com/auth/games" 7302 // ] 7303 // } 7304 7305} 7306 7307// method id "games.leaderboards.list": 7308 7309type LeaderboardsListCall struct { 7310 s *Service 7311 urlParams_ gensupport.URLParams 7312 ifNoneMatch_ string 7313 ctx_ context.Context 7314 header_ http.Header 7315} 7316 7317// List: Lists all the leaderboard metadata for your application. 7318func (r *LeaderboardsService) List() *LeaderboardsListCall { 7319 c := &LeaderboardsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7320 return c 7321} 7322 7323// Language sets the optional parameter "language": The preferred 7324// language to use for strings returned by this method. 7325func (c *LeaderboardsListCall) Language(language string) *LeaderboardsListCall { 7326 c.urlParams_.Set("language", language) 7327 return c 7328} 7329 7330// MaxResults sets the optional parameter "maxResults": The maximum 7331// number of leaderboards to return in the response. For any response, 7332// the actual number of leaderboards returned may be less than the 7333// specified maxResults. 7334func (c *LeaderboardsListCall) MaxResults(maxResults int64) *LeaderboardsListCall { 7335 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7336 return c 7337} 7338 7339// PageToken sets the optional parameter "pageToken": The token returned 7340// by the previous request. 7341func (c *LeaderboardsListCall) PageToken(pageToken string) *LeaderboardsListCall { 7342 c.urlParams_.Set("pageToken", pageToken) 7343 return c 7344} 7345 7346// Fields allows partial responses to be retrieved. See 7347// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7348// for more information. 7349func (c *LeaderboardsListCall) Fields(s ...googleapi.Field) *LeaderboardsListCall { 7350 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7351 return c 7352} 7353 7354// IfNoneMatch sets the optional parameter which makes the operation 7355// fail if the object's ETag matches the given value. This is useful for 7356// getting updates only after the object has changed since the last 7357// request. Use googleapi.IsNotModified to check whether the response 7358// error from Do is the result of In-None-Match. 7359func (c *LeaderboardsListCall) IfNoneMatch(entityTag string) *LeaderboardsListCall { 7360 c.ifNoneMatch_ = entityTag 7361 return c 7362} 7363 7364// Context sets the context to be used in this call's Do method. Any 7365// pending HTTP request will be aborted if the provided context is 7366// canceled. 7367func (c *LeaderboardsListCall) Context(ctx context.Context) *LeaderboardsListCall { 7368 c.ctx_ = ctx 7369 return c 7370} 7371 7372// Header returns an http.Header that can be modified by the caller to 7373// add HTTP headers to the request. 7374func (c *LeaderboardsListCall) Header() http.Header { 7375 if c.header_ == nil { 7376 c.header_ = make(http.Header) 7377 } 7378 return c.header_ 7379} 7380 7381func (c *LeaderboardsListCall) doRequest(alt string) (*http.Response, error) { 7382 reqHeaders := make(http.Header) 7383 for k, v := range c.header_ { 7384 reqHeaders[k] = v 7385 } 7386 reqHeaders.Set("User-Agent", c.s.userAgent()) 7387 if c.ifNoneMatch_ != "" { 7388 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7389 } 7390 var body io.Reader = nil 7391 c.urlParams_.Set("alt", alt) 7392 c.urlParams_.Set("prettyPrint", "false") 7393 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards") 7394 urls += "?" + c.urlParams_.Encode() 7395 req, err := http.NewRequest("GET", urls, body) 7396 if err != nil { 7397 return nil, err 7398 } 7399 req.Header = reqHeaders 7400 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7401} 7402 7403// Do executes the "games.leaderboards.list" call. 7404// Exactly one of *LeaderboardListResponse or error will be non-nil. Any 7405// non-2xx status code is an error. Response headers are in either 7406// *LeaderboardListResponse.ServerResponse.Header or (if a response was 7407// returned at all) in error.(*googleapi.Error).Header. Use 7408// googleapi.IsNotModified to check whether the returned error was 7409// because http.StatusNotModified was returned. 7410func (c *LeaderboardsListCall) Do(opts ...googleapi.CallOption) (*LeaderboardListResponse, error) { 7411 gensupport.SetOptions(c.urlParams_, opts...) 7412 res, err := c.doRequest("json") 7413 if res != nil && res.StatusCode == http.StatusNotModified { 7414 if res.Body != nil { 7415 res.Body.Close() 7416 } 7417 return nil, &googleapi.Error{ 7418 Code: res.StatusCode, 7419 Header: res.Header, 7420 } 7421 } 7422 if err != nil { 7423 return nil, err 7424 } 7425 defer googleapi.CloseBody(res) 7426 if err := googleapi.CheckResponse(res); err != nil { 7427 return nil, err 7428 } 7429 ret := &LeaderboardListResponse{ 7430 ServerResponse: googleapi.ServerResponse{ 7431 Header: res.Header, 7432 HTTPStatusCode: res.StatusCode, 7433 }, 7434 } 7435 target := &ret 7436 if err := gensupport.DecodeResponse(target, res); err != nil { 7437 return nil, err 7438 } 7439 return ret, nil 7440 // { 7441 // "description": "Lists all the leaderboard metadata for your application.", 7442 // "httpMethod": "GET", 7443 // "id": "games.leaderboards.list", 7444 // "parameters": { 7445 // "language": { 7446 // "description": "The preferred language to use for strings returned by this method.", 7447 // "location": "query", 7448 // "type": "string" 7449 // }, 7450 // "maxResults": { 7451 // "description": "The maximum number of leaderboards to return in the response. For any response, the actual number of leaderboards returned may be less than the specified maxResults.", 7452 // "format": "int32", 7453 // "location": "query", 7454 // "maximum": "200", 7455 // "minimum": "1", 7456 // "type": "integer" 7457 // }, 7458 // "pageToken": { 7459 // "description": "The token returned by the previous request.", 7460 // "location": "query", 7461 // "type": "string" 7462 // } 7463 // }, 7464 // "path": "leaderboards", 7465 // "response": { 7466 // "$ref": "LeaderboardListResponse" 7467 // }, 7468 // "scopes": [ 7469 // "https://www.googleapis.com/auth/games" 7470 // ] 7471 // } 7472 7473} 7474 7475// Pages invokes f for each page of results. 7476// A non-nil error returned from f will halt the iteration. 7477// The provided context supersedes any context provided to the Context method. 7478func (c *LeaderboardsListCall) Pages(ctx context.Context, f func(*LeaderboardListResponse) error) error { 7479 c.ctx_ = ctx 7480 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7481 for { 7482 x, err := c.Do() 7483 if err != nil { 7484 return err 7485 } 7486 if err := f(x); err != nil { 7487 return err 7488 } 7489 if x.NextPageToken == "" { 7490 return nil 7491 } 7492 c.PageToken(x.NextPageToken) 7493 } 7494} 7495 7496// method id "games.metagame.getMetagameConfig": 7497 7498type MetagameGetMetagameConfigCall struct { 7499 s *Service 7500 urlParams_ gensupport.URLParams 7501 ifNoneMatch_ string 7502 ctx_ context.Context 7503 header_ http.Header 7504} 7505 7506// GetMetagameConfig: Return the metagame configuration data for the 7507// calling application. 7508func (r *MetagameService) GetMetagameConfig() *MetagameGetMetagameConfigCall { 7509 c := &MetagameGetMetagameConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7510 return c 7511} 7512 7513// Fields allows partial responses to be retrieved. See 7514// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7515// for more information. 7516func (c *MetagameGetMetagameConfigCall) Fields(s ...googleapi.Field) *MetagameGetMetagameConfigCall { 7517 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7518 return c 7519} 7520 7521// IfNoneMatch sets the optional parameter which makes the operation 7522// fail if the object's ETag matches the given value. This is useful for 7523// getting updates only after the object has changed since the last 7524// request. Use googleapi.IsNotModified to check whether the response 7525// error from Do is the result of In-None-Match. 7526func (c *MetagameGetMetagameConfigCall) IfNoneMatch(entityTag string) *MetagameGetMetagameConfigCall { 7527 c.ifNoneMatch_ = entityTag 7528 return c 7529} 7530 7531// Context sets the context to be used in this call's Do method. Any 7532// pending HTTP request will be aborted if the provided context is 7533// canceled. 7534func (c *MetagameGetMetagameConfigCall) Context(ctx context.Context) *MetagameGetMetagameConfigCall { 7535 c.ctx_ = ctx 7536 return c 7537} 7538 7539// Header returns an http.Header that can be modified by the caller to 7540// add HTTP headers to the request. 7541func (c *MetagameGetMetagameConfigCall) Header() http.Header { 7542 if c.header_ == nil { 7543 c.header_ = make(http.Header) 7544 } 7545 return c.header_ 7546} 7547 7548func (c *MetagameGetMetagameConfigCall) doRequest(alt string) (*http.Response, error) { 7549 reqHeaders := make(http.Header) 7550 for k, v := range c.header_ { 7551 reqHeaders[k] = v 7552 } 7553 reqHeaders.Set("User-Agent", c.s.userAgent()) 7554 if c.ifNoneMatch_ != "" { 7555 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7556 } 7557 var body io.Reader = nil 7558 c.urlParams_.Set("alt", alt) 7559 c.urlParams_.Set("prettyPrint", "false") 7560 urls := googleapi.ResolveRelative(c.s.BasePath, "metagameConfig") 7561 urls += "?" + c.urlParams_.Encode() 7562 req, err := http.NewRequest("GET", urls, body) 7563 if err != nil { 7564 return nil, err 7565 } 7566 req.Header = reqHeaders 7567 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7568} 7569 7570// Do executes the "games.metagame.getMetagameConfig" call. 7571// Exactly one of *MetagameConfig or error will be non-nil. Any non-2xx 7572// status code is an error. Response headers are in either 7573// *MetagameConfig.ServerResponse.Header or (if a response was returned 7574// at all) in error.(*googleapi.Error).Header. Use 7575// googleapi.IsNotModified to check whether the returned error was 7576// because http.StatusNotModified was returned. 7577func (c *MetagameGetMetagameConfigCall) Do(opts ...googleapi.CallOption) (*MetagameConfig, error) { 7578 gensupport.SetOptions(c.urlParams_, opts...) 7579 res, err := c.doRequest("json") 7580 if res != nil && res.StatusCode == http.StatusNotModified { 7581 if res.Body != nil { 7582 res.Body.Close() 7583 } 7584 return nil, &googleapi.Error{ 7585 Code: res.StatusCode, 7586 Header: res.Header, 7587 } 7588 } 7589 if err != nil { 7590 return nil, err 7591 } 7592 defer googleapi.CloseBody(res) 7593 if err := googleapi.CheckResponse(res); err != nil { 7594 return nil, err 7595 } 7596 ret := &MetagameConfig{ 7597 ServerResponse: googleapi.ServerResponse{ 7598 Header: res.Header, 7599 HTTPStatusCode: res.StatusCode, 7600 }, 7601 } 7602 target := &ret 7603 if err := gensupport.DecodeResponse(target, res); err != nil { 7604 return nil, err 7605 } 7606 return ret, nil 7607 // { 7608 // "description": "Return the metagame configuration data for the calling application.", 7609 // "httpMethod": "GET", 7610 // "id": "games.metagame.getMetagameConfig", 7611 // "path": "metagameConfig", 7612 // "response": { 7613 // "$ref": "MetagameConfig" 7614 // }, 7615 // "scopes": [ 7616 // "https://www.googleapis.com/auth/games" 7617 // ] 7618 // } 7619 7620} 7621 7622// method id "games.metagame.listCategoriesByPlayer": 7623 7624type MetagameListCategoriesByPlayerCall struct { 7625 s *Service 7626 playerId string 7627 collection string 7628 urlParams_ gensupport.URLParams 7629 ifNoneMatch_ string 7630 ctx_ context.Context 7631 header_ http.Header 7632} 7633 7634// ListCategoriesByPlayer: List play data aggregated per category for 7635// the player corresponding to playerId. 7636func (r *MetagameService) ListCategoriesByPlayer(playerId string, collection string) *MetagameListCategoriesByPlayerCall { 7637 c := &MetagameListCategoriesByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7638 c.playerId = playerId 7639 c.collection = collection 7640 return c 7641} 7642 7643// Language sets the optional parameter "language": The preferred 7644// language to use for strings returned by this method. 7645func (c *MetagameListCategoriesByPlayerCall) Language(language string) *MetagameListCategoriesByPlayerCall { 7646 c.urlParams_.Set("language", language) 7647 return c 7648} 7649 7650// MaxResults sets the optional parameter "maxResults": The maximum 7651// number of category resources to return in the response, used for 7652// paging. For any response, the actual number of category resources 7653// returned may be less than the specified maxResults. 7654func (c *MetagameListCategoriesByPlayerCall) MaxResults(maxResults int64) *MetagameListCategoriesByPlayerCall { 7655 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7656 return c 7657} 7658 7659// PageToken sets the optional parameter "pageToken": The token returned 7660// by the previous request. 7661func (c *MetagameListCategoriesByPlayerCall) PageToken(pageToken string) *MetagameListCategoriesByPlayerCall { 7662 c.urlParams_.Set("pageToken", pageToken) 7663 return c 7664} 7665 7666// Fields allows partial responses to be retrieved. See 7667// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7668// for more information. 7669func (c *MetagameListCategoriesByPlayerCall) Fields(s ...googleapi.Field) *MetagameListCategoriesByPlayerCall { 7670 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7671 return c 7672} 7673 7674// IfNoneMatch sets the optional parameter which makes the operation 7675// fail if the object's ETag matches the given value. This is useful for 7676// getting updates only after the object has changed since the last 7677// request. Use googleapi.IsNotModified to check whether the response 7678// error from Do is the result of In-None-Match. 7679func (c *MetagameListCategoriesByPlayerCall) IfNoneMatch(entityTag string) *MetagameListCategoriesByPlayerCall { 7680 c.ifNoneMatch_ = entityTag 7681 return c 7682} 7683 7684// Context sets the context to be used in this call's Do method. Any 7685// pending HTTP request will be aborted if the provided context is 7686// canceled. 7687func (c *MetagameListCategoriesByPlayerCall) Context(ctx context.Context) *MetagameListCategoriesByPlayerCall { 7688 c.ctx_ = ctx 7689 return c 7690} 7691 7692// Header returns an http.Header that can be modified by the caller to 7693// add HTTP headers to the request. 7694func (c *MetagameListCategoriesByPlayerCall) Header() http.Header { 7695 if c.header_ == nil { 7696 c.header_ = make(http.Header) 7697 } 7698 return c.header_ 7699} 7700 7701func (c *MetagameListCategoriesByPlayerCall) doRequest(alt string) (*http.Response, error) { 7702 reqHeaders := make(http.Header) 7703 for k, v := range c.header_ { 7704 reqHeaders[k] = v 7705 } 7706 reqHeaders.Set("User-Agent", c.s.userAgent()) 7707 if c.ifNoneMatch_ != "" { 7708 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7709 } 7710 var body io.Reader = nil 7711 c.urlParams_.Set("alt", alt) 7712 c.urlParams_.Set("prettyPrint", "false") 7713 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/categories/{collection}") 7714 urls += "?" + c.urlParams_.Encode() 7715 req, err := http.NewRequest("GET", urls, body) 7716 if err != nil { 7717 return nil, err 7718 } 7719 req.Header = reqHeaders 7720 googleapi.Expand(req.URL, map[string]string{ 7721 "playerId": c.playerId, 7722 "collection": c.collection, 7723 }) 7724 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7725} 7726 7727// Do executes the "games.metagame.listCategoriesByPlayer" call. 7728// Exactly one of *CategoryListResponse or error will be non-nil. Any 7729// non-2xx status code is an error. Response headers are in either 7730// *CategoryListResponse.ServerResponse.Header or (if a response was 7731// returned at all) in error.(*googleapi.Error).Header. Use 7732// googleapi.IsNotModified to check whether the returned error was 7733// because http.StatusNotModified was returned. 7734func (c *MetagameListCategoriesByPlayerCall) Do(opts ...googleapi.CallOption) (*CategoryListResponse, error) { 7735 gensupport.SetOptions(c.urlParams_, opts...) 7736 res, err := c.doRequest("json") 7737 if res != nil && res.StatusCode == http.StatusNotModified { 7738 if res.Body != nil { 7739 res.Body.Close() 7740 } 7741 return nil, &googleapi.Error{ 7742 Code: res.StatusCode, 7743 Header: res.Header, 7744 } 7745 } 7746 if err != nil { 7747 return nil, err 7748 } 7749 defer googleapi.CloseBody(res) 7750 if err := googleapi.CheckResponse(res); err != nil { 7751 return nil, err 7752 } 7753 ret := &CategoryListResponse{ 7754 ServerResponse: googleapi.ServerResponse{ 7755 Header: res.Header, 7756 HTTPStatusCode: res.StatusCode, 7757 }, 7758 } 7759 target := &ret 7760 if err := gensupport.DecodeResponse(target, res); err != nil { 7761 return nil, err 7762 } 7763 return ret, nil 7764 // { 7765 // "description": "List play data aggregated per category for the player corresponding to playerId.", 7766 // "httpMethod": "GET", 7767 // "id": "games.metagame.listCategoriesByPlayer", 7768 // "parameterOrder": [ 7769 // "playerId", 7770 // "collection" 7771 // ], 7772 // "parameters": { 7773 // "collection": { 7774 // "description": "The collection of categories for which data will be returned.", 7775 // "enum": [ 7776 // "all" 7777 // ], 7778 // "enumDescriptions": [ 7779 // "Retrieve data for all categories. This is the default." 7780 // ], 7781 // "location": "path", 7782 // "required": true, 7783 // "type": "string" 7784 // }, 7785 // "language": { 7786 // "description": "The preferred language to use for strings returned by this method.", 7787 // "location": "query", 7788 // "type": "string" 7789 // }, 7790 // "maxResults": { 7791 // "description": "The maximum number of category resources to return in the response, used for paging. For any response, the actual number of category resources returned may be less than the specified maxResults.", 7792 // "format": "int32", 7793 // "location": "query", 7794 // "maximum": "100", 7795 // "minimum": "1", 7796 // "type": "integer" 7797 // }, 7798 // "pageToken": { 7799 // "description": "The token returned by the previous request.", 7800 // "location": "query", 7801 // "type": "string" 7802 // }, 7803 // "playerId": { 7804 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 7805 // "location": "path", 7806 // "required": true, 7807 // "type": "string" 7808 // } 7809 // }, 7810 // "path": "players/{playerId}/categories/{collection}", 7811 // "response": { 7812 // "$ref": "CategoryListResponse" 7813 // }, 7814 // "scopes": [ 7815 // "https://www.googleapis.com/auth/games" 7816 // ] 7817 // } 7818 7819} 7820 7821// Pages invokes f for each page of results. 7822// A non-nil error returned from f will halt the iteration. 7823// The provided context supersedes any context provided to the Context method. 7824func (c *MetagameListCategoriesByPlayerCall) Pages(ctx context.Context, f func(*CategoryListResponse) error) error { 7825 c.ctx_ = ctx 7826 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7827 for { 7828 x, err := c.Do() 7829 if err != nil { 7830 return err 7831 } 7832 if err := f(x); err != nil { 7833 return err 7834 } 7835 if x.NextPageToken == "" { 7836 return nil 7837 } 7838 c.PageToken(x.NextPageToken) 7839 } 7840} 7841 7842// method id "games.players.get": 7843 7844type PlayersGetCall struct { 7845 s *Service 7846 playerId string 7847 urlParams_ gensupport.URLParams 7848 ifNoneMatch_ string 7849 ctx_ context.Context 7850 header_ http.Header 7851} 7852 7853// Get: Retrieves the Player resource with the given ID. To retrieve the 7854// player for the currently authenticated user, set playerId to me. 7855func (r *PlayersService) Get(playerId string) *PlayersGetCall { 7856 c := &PlayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7857 c.playerId = playerId 7858 return c 7859} 7860 7861// Language sets the optional parameter "language": The preferred 7862// language to use for strings returned by this method. 7863func (c *PlayersGetCall) Language(language string) *PlayersGetCall { 7864 c.urlParams_.Set("language", language) 7865 return c 7866} 7867 7868// Fields allows partial responses to be retrieved. See 7869// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7870// for more information. 7871func (c *PlayersGetCall) Fields(s ...googleapi.Field) *PlayersGetCall { 7872 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7873 return c 7874} 7875 7876// IfNoneMatch sets the optional parameter which makes the operation 7877// fail if the object's ETag matches the given value. This is useful for 7878// getting updates only after the object has changed since the last 7879// request. Use googleapi.IsNotModified to check whether the response 7880// error from Do is the result of In-None-Match. 7881func (c *PlayersGetCall) IfNoneMatch(entityTag string) *PlayersGetCall { 7882 c.ifNoneMatch_ = entityTag 7883 return c 7884} 7885 7886// Context sets the context to be used in this call's Do method. Any 7887// pending HTTP request will be aborted if the provided context is 7888// canceled. 7889func (c *PlayersGetCall) Context(ctx context.Context) *PlayersGetCall { 7890 c.ctx_ = ctx 7891 return c 7892} 7893 7894// Header returns an http.Header that can be modified by the caller to 7895// add HTTP headers to the request. 7896func (c *PlayersGetCall) Header() http.Header { 7897 if c.header_ == nil { 7898 c.header_ = make(http.Header) 7899 } 7900 return c.header_ 7901} 7902 7903func (c *PlayersGetCall) doRequest(alt string) (*http.Response, error) { 7904 reqHeaders := make(http.Header) 7905 for k, v := range c.header_ { 7906 reqHeaders[k] = v 7907 } 7908 reqHeaders.Set("User-Agent", c.s.userAgent()) 7909 if c.ifNoneMatch_ != "" { 7910 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7911 } 7912 var body io.Reader = nil 7913 c.urlParams_.Set("alt", alt) 7914 c.urlParams_.Set("prettyPrint", "false") 7915 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}") 7916 urls += "?" + c.urlParams_.Encode() 7917 req, err := http.NewRequest("GET", urls, body) 7918 if err != nil { 7919 return nil, err 7920 } 7921 req.Header = reqHeaders 7922 googleapi.Expand(req.URL, map[string]string{ 7923 "playerId": c.playerId, 7924 }) 7925 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7926} 7927 7928// Do executes the "games.players.get" call. 7929// Exactly one of *Player or error will be non-nil. Any non-2xx status 7930// code is an error. Response headers are in either 7931// *Player.ServerResponse.Header or (if a response was returned at all) 7932// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7933// check whether the returned error was because http.StatusNotModified 7934// was returned. 7935func (c *PlayersGetCall) Do(opts ...googleapi.CallOption) (*Player, error) { 7936 gensupport.SetOptions(c.urlParams_, opts...) 7937 res, err := c.doRequest("json") 7938 if res != nil && res.StatusCode == http.StatusNotModified { 7939 if res.Body != nil { 7940 res.Body.Close() 7941 } 7942 return nil, &googleapi.Error{ 7943 Code: res.StatusCode, 7944 Header: res.Header, 7945 } 7946 } 7947 if err != nil { 7948 return nil, err 7949 } 7950 defer googleapi.CloseBody(res) 7951 if err := googleapi.CheckResponse(res); err != nil { 7952 return nil, err 7953 } 7954 ret := &Player{ 7955 ServerResponse: googleapi.ServerResponse{ 7956 Header: res.Header, 7957 HTTPStatusCode: res.StatusCode, 7958 }, 7959 } 7960 target := &ret 7961 if err := gensupport.DecodeResponse(target, res); err != nil { 7962 return nil, err 7963 } 7964 return ret, nil 7965 // { 7966 // "description": "Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.", 7967 // "httpMethod": "GET", 7968 // "id": "games.players.get", 7969 // "parameterOrder": [ 7970 // "playerId" 7971 // ], 7972 // "parameters": { 7973 // "language": { 7974 // "description": "The preferred language to use for strings returned by this method.", 7975 // "location": "query", 7976 // "type": "string" 7977 // }, 7978 // "playerId": { 7979 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 7980 // "location": "path", 7981 // "required": true, 7982 // "type": "string" 7983 // } 7984 // }, 7985 // "path": "players/{playerId}", 7986 // "response": { 7987 // "$ref": "Player" 7988 // }, 7989 // "scopes": [ 7990 // "https://www.googleapis.com/auth/games" 7991 // ] 7992 // } 7993 7994} 7995 7996// method id "games.players.list": 7997 7998type PlayersListCall struct { 7999 s *Service 8000 collection string 8001 urlParams_ gensupport.URLParams 8002 ifNoneMatch_ string 8003 ctx_ context.Context 8004 header_ http.Header 8005} 8006 8007// List: Get the collection of players for the currently authenticated 8008// user. 8009func (r *PlayersService) List(collection string) *PlayersListCall { 8010 c := &PlayersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8011 c.collection = collection 8012 return c 8013} 8014 8015// Language sets the optional parameter "language": The preferred 8016// language to use for strings returned by this method. 8017func (c *PlayersListCall) Language(language string) *PlayersListCall { 8018 c.urlParams_.Set("language", language) 8019 return c 8020} 8021 8022// MaxResults sets the optional parameter "maxResults": The maximum 8023// number of player resources to return in the response, used for 8024// paging. For any response, the actual number of player resources 8025// returned may be less than the specified maxResults. 8026func (c *PlayersListCall) MaxResults(maxResults int64) *PlayersListCall { 8027 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 8028 return c 8029} 8030 8031// PageToken sets the optional parameter "pageToken": The token returned 8032// by the previous request. 8033func (c *PlayersListCall) PageToken(pageToken string) *PlayersListCall { 8034 c.urlParams_.Set("pageToken", pageToken) 8035 return c 8036} 8037 8038// Fields allows partial responses to be retrieved. See 8039// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8040// for more information. 8041func (c *PlayersListCall) Fields(s ...googleapi.Field) *PlayersListCall { 8042 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8043 return c 8044} 8045 8046// IfNoneMatch sets the optional parameter which makes the operation 8047// fail if the object's ETag matches the given value. This is useful for 8048// getting updates only after the object has changed since the last 8049// request. Use googleapi.IsNotModified to check whether the response 8050// error from Do is the result of In-None-Match. 8051func (c *PlayersListCall) IfNoneMatch(entityTag string) *PlayersListCall { 8052 c.ifNoneMatch_ = entityTag 8053 return c 8054} 8055 8056// Context sets the context to be used in this call's Do method. Any 8057// pending HTTP request will be aborted if the provided context is 8058// canceled. 8059func (c *PlayersListCall) Context(ctx context.Context) *PlayersListCall { 8060 c.ctx_ = ctx 8061 return c 8062} 8063 8064// Header returns an http.Header that can be modified by the caller to 8065// add HTTP headers to the request. 8066func (c *PlayersListCall) Header() http.Header { 8067 if c.header_ == nil { 8068 c.header_ = make(http.Header) 8069 } 8070 return c.header_ 8071} 8072 8073func (c *PlayersListCall) doRequest(alt string) (*http.Response, error) { 8074 reqHeaders := make(http.Header) 8075 for k, v := range c.header_ { 8076 reqHeaders[k] = v 8077 } 8078 reqHeaders.Set("User-Agent", c.s.userAgent()) 8079 if c.ifNoneMatch_ != "" { 8080 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8081 } 8082 var body io.Reader = nil 8083 c.urlParams_.Set("alt", alt) 8084 c.urlParams_.Set("prettyPrint", "false") 8085 urls := googleapi.ResolveRelative(c.s.BasePath, "players/me/players/{collection}") 8086 urls += "?" + c.urlParams_.Encode() 8087 req, err := http.NewRequest("GET", urls, body) 8088 if err != nil { 8089 return nil, err 8090 } 8091 req.Header = reqHeaders 8092 googleapi.Expand(req.URL, map[string]string{ 8093 "collection": c.collection, 8094 }) 8095 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8096} 8097 8098// Do executes the "games.players.list" call. 8099// Exactly one of *PlayerListResponse or error will be non-nil. Any 8100// non-2xx status code is an error. Response headers are in either 8101// *PlayerListResponse.ServerResponse.Header or (if a response was 8102// returned at all) in error.(*googleapi.Error).Header. Use 8103// googleapi.IsNotModified to check whether the returned error was 8104// because http.StatusNotModified was returned. 8105func (c *PlayersListCall) Do(opts ...googleapi.CallOption) (*PlayerListResponse, error) { 8106 gensupport.SetOptions(c.urlParams_, opts...) 8107 res, err := c.doRequest("json") 8108 if res != nil && res.StatusCode == http.StatusNotModified { 8109 if res.Body != nil { 8110 res.Body.Close() 8111 } 8112 return nil, &googleapi.Error{ 8113 Code: res.StatusCode, 8114 Header: res.Header, 8115 } 8116 } 8117 if err != nil { 8118 return nil, err 8119 } 8120 defer googleapi.CloseBody(res) 8121 if err := googleapi.CheckResponse(res); err != nil { 8122 return nil, err 8123 } 8124 ret := &PlayerListResponse{ 8125 ServerResponse: googleapi.ServerResponse{ 8126 Header: res.Header, 8127 HTTPStatusCode: res.StatusCode, 8128 }, 8129 } 8130 target := &ret 8131 if err := gensupport.DecodeResponse(target, res); err != nil { 8132 return nil, err 8133 } 8134 return ret, nil 8135 // { 8136 // "description": "Get the collection of players for the currently authenticated user.", 8137 // "httpMethod": "GET", 8138 // "id": "games.players.list", 8139 // "parameterOrder": [ 8140 // "collection" 8141 // ], 8142 // "parameters": { 8143 // "collection": { 8144 // "description": "Collection of players being retrieved", 8145 // "enum": [ 8146 // "connected", 8147 // "playedWith", 8148 // "played_with", 8149 // "visible" 8150 // ], 8151 // "enumDescriptions": [ 8152 // "Retrieve a list of players that are also playing this game in reverse chronological order.", 8153 // "(DEPRECATED: please use played_with!) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.", 8154 // "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.", 8155 // "Retrieve a list of players in the user's social graph that are visible to this game." 8156 // ], 8157 // "location": "path", 8158 // "required": true, 8159 // "type": "string" 8160 // }, 8161 // "language": { 8162 // "description": "The preferred language to use for strings returned by this method.", 8163 // "location": "query", 8164 // "type": "string" 8165 // }, 8166 // "maxResults": { 8167 // "description": "The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults.", 8168 // "format": "int32", 8169 // "location": "query", 8170 // "maximum": "50", 8171 // "minimum": "1", 8172 // "type": "integer" 8173 // }, 8174 // "pageToken": { 8175 // "description": "The token returned by the previous request.", 8176 // "location": "query", 8177 // "type": "string" 8178 // } 8179 // }, 8180 // "path": "players/me/players/{collection}", 8181 // "response": { 8182 // "$ref": "PlayerListResponse" 8183 // }, 8184 // "scopes": [ 8185 // "https://www.googleapis.com/auth/games" 8186 // ] 8187 // } 8188 8189} 8190 8191// Pages invokes f for each page of results. 8192// A non-nil error returned from f will halt the iteration. 8193// The provided context supersedes any context provided to the Context method. 8194func (c *PlayersListCall) Pages(ctx context.Context, f func(*PlayerListResponse) error) error { 8195 c.ctx_ = ctx 8196 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8197 for { 8198 x, err := c.Do() 8199 if err != nil { 8200 return err 8201 } 8202 if err := f(x); err != nil { 8203 return err 8204 } 8205 if x.NextPageToken == "" { 8206 return nil 8207 } 8208 c.PageToken(x.NextPageToken) 8209 } 8210} 8211 8212// method id "games.pushtokens.remove": 8213 8214type PushtokensRemoveCall struct { 8215 s *Service 8216 pushtokenid *PushTokenId 8217 urlParams_ gensupport.URLParams 8218 ctx_ context.Context 8219 header_ http.Header 8220} 8221 8222// Remove: Removes a push token for the current user and application. 8223// Removing a non-existent push token will report success. 8224func (r *PushtokensService) Remove(pushtokenid *PushTokenId) *PushtokensRemoveCall { 8225 c := &PushtokensRemoveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8226 c.pushtokenid = pushtokenid 8227 return c 8228} 8229 8230// Fields allows partial responses to be retrieved. See 8231// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8232// for more information. 8233func (c *PushtokensRemoveCall) Fields(s ...googleapi.Field) *PushtokensRemoveCall { 8234 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8235 return c 8236} 8237 8238// Context sets the context to be used in this call's Do method. Any 8239// pending HTTP request will be aborted if the provided context is 8240// canceled. 8241func (c *PushtokensRemoveCall) Context(ctx context.Context) *PushtokensRemoveCall { 8242 c.ctx_ = ctx 8243 return c 8244} 8245 8246// Header returns an http.Header that can be modified by the caller to 8247// add HTTP headers to the request. 8248func (c *PushtokensRemoveCall) Header() http.Header { 8249 if c.header_ == nil { 8250 c.header_ = make(http.Header) 8251 } 8252 return c.header_ 8253} 8254 8255func (c *PushtokensRemoveCall) doRequest(alt string) (*http.Response, error) { 8256 reqHeaders := make(http.Header) 8257 for k, v := range c.header_ { 8258 reqHeaders[k] = v 8259 } 8260 reqHeaders.Set("User-Agent", c.s.userAgent()) 8261 var body io.Reader = nil 8262 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtokenid) 8263 if err != nil { 8264 return nil, err 8265 } 8266 reqHeaders.Set("Content-Type", "application/json") 8267 c.urlParams_.Set("alt", alt) 8268 c.urlParams_.Set("prettyPrint", "false") 8269 urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens/remove") 8270 urls += "?" + c.urlParams_.Encode() 8271 req, err := http.NewRequest("POST", urls, body) 8272 if err != nil { 8273 return nil, err 8274 } 8275 req.Header = reqHeaders 8276 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8277} 8278 8279// Do executes the "games.pushtokens.remove" call. 8280func (c *PushtokensRemoveCall) Do(opts ...googleapi.CallOption) error { 8281 gensupport.SetOptions(c.urlParams_, opts...) 8282 res, err := c.doRequest("json") 8283 if err != nil { 8284 return err 8285 } 8286 defer googleapi.CloseBody(res) 8287 if err := googleapi.CheckResponse(res); err != nil { 8288 return err 8289 } 8290 return nil 8291 // { 8292 // "description": "Removes a push token for the current user and application. Removing a non-existent push token will report success.", 8293 // "httpMethod": "POST", 8294 // "id": "games.pushtokens.remove", 8295 // "path": "pushtokens/remove", 8296 // "request": { 8297 // "$ref": "PushTokenId" 8298 // }, 8299 // "scopes": [ 8300 // "https://www.googleapis.com/auth/games" 8301 // ] 8302 // } 8303 8304} 8305 8306// method id "games.pushtokens.update": 8307 8308type PushtokensUpdateCall struct { 8309 s *Service 8310 pushtoken *PushToken 8311 urlParams_ gensupport.URLParams 8312 ctx_ context.Context 8313 header_ http.Header 8314} 8315 8316// Update: Registers a push token for the current user and application. 8317func (r *PushtokensService) Update(pushtoken *PushToken) *PushtokensUpdateCall { 8318 c := &PushtokensUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8319 c.pushtoken = pushtoken 8320 return c 8321} 8322 8323// Fields allows partial responses to be retrieved. See 8324// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8325// for more information. 8326func (c *PushtokensUpdateCall) Fields(s ...googleapi.Field) *PushtokensUpdateCall { 8327 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8328 return c 8329} 8330 8331// Context sets the context to be used in this call's Do method. Any 8332// pending HTTP request will be aborted if the provided context is 8333// canceled. 8334func (c *PushtokensUpdateCall) Context(ctx context.Context) *PushtokensUpdateCall { 8335 c.ctx_ = ctx 8336 return c 8337} 8338 8339// Header returns an http.Header that can be modified by the caller to 8340// add HTTP headers to the request. 8341func (c *PushtokensUpdateCall) Header() http.Header { 8342 if c.header_ == nil { 8343 c.header_ = make(http.Header) 8344 } 8345 return c.header_ 8346} 8347 8348func (c *PushtokensUpdateCall) doRequest(alt string) (*http.Response, error) { 8349 reqHeaders := make(http.Header) 8350 for k, v := range c.header_ { 8351 reqHeaders[k] = v 8352 } 8353 reqHeaders.Set("User-Agent", c.s.userAgent()) 8354 var body io.Reader = nil 8355 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtoken) 8356 if err != nil { 8357 return nil, err 8358 } 8359 reqHeaders.Set("Content-Type", "application/json") 8360 c.urlParams_.Set("alt", alt) 8361 c.urlParams_.Set("prettyPrint", "false") 8362 urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens") 8363 urls += "?" + c.urlParams_.Encode() 8364 req, err := http.NewRequest("PUT", urls, body) 8365 if err != nil { 8366 return nil, err 8367 } 8368 req.Header = reqHeaders 8369 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8370} 8371 8372// Do executes the "games.pushtokens.update" call. 8373func (c *PushtokensUpdateCall) Do(opts ...googleapi.CallOption) error { 8374 gensupport.SetOptions(c.urlParams_, opts...) 8375 res, err := c.doRequest("json") 8376 if err != nil { 8377 return err 8378 } 8379 defer googleapi.CloseBody(res) 8380 if err := googleapi.CheckResponse(res); err != nil { 8381 return err 8382 } 8383 return nil 8384 // { 8385 // "description": "Registers a push token for the current user and application.", 8386 // "httpMethod": "PUT", 8387 // "id": "games.pushtokens.update", 8388 // "path": "pushtokens", 8389 // "request": { 8390 // "$ref": "PushToken" 8391 // }, 8392 // "scopes": [ 8393 // "https://www.googleapis.com/auth/games" 8394 // ] 8395 // } 8396 8397} 8398 8399// method id "games.questMilestones.claim": 8400 8401type QuestMilestonesClaimCall struct { 8402 s *Service 8403 questId string 8404 milestoneId string 8405 urlParams_ gensupport.URLParams 8406 ctx_ context.Context 8407 header_ http.Header 8408} 8409 8410// Claim: Report that a reward for the milestone corresponding to 8411// milestoneId for the quest corresponding to questId has been claimed 8412// by the currently authorized user. 8413func (r *QuestMilestonesService) Claim(questId string, milestoneId string, requestId int64) *QuestMilestonesClaimCall { 8414 c := &QuestMilestonesClaimCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8415 c.questId = questId 8416 c.milestoneId = milestoneId 8417 c.urlParams_.Set("requestId", fmt.Sprint(requestId)) 8418 return c 8419} 8420 8421// Fields allows partial responses to be retrieved. See 8422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8423// for more information. 8424func (c *QuestMilestonesClaimCall) Fields(s ...googleapi.Field) *QuestMilestonesClaimCall { 8425 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8426 return c 8427} 8428 8429// Context sets the context to be used in this call's Do method. Any 8430// pending HTTP request will be aborted if the provided context is 8431// canceled. 8432func (c *QuestMilestonesClaimCall) Context(ctx context.Context) *QuestMilestonesClaimCall { 8433 c.ctx_ = ctx 8434 return c 8435} 8436 8437// Header returns an http.Header that can be modified by the caller to 8438// add HTTP headers to the request. 8439func (c *QuestMilestonesClaimCall) Header() http.Header { 8440 if c.header_ == nil { 8441 c.header_ = make(http.Header) 8442 } 8443 return c.header_ 8444} 8445 8446func (c *QuestMilestonesClaimCall) doRequest(alt string) (*http.Response, error) { 8447 reqHeaders := make(http.Header) 8448 for k, v := range c.header_ { 8449 reqHeaders[k] = v 8450 } 8451 reqHeaders.Set("User-Agent", c.s.userAgent()) 8452 var body io.Reader = nil 8453 c.urlParams_.Set("alt", alt) 8454 c.urlParams_.Set("prettyPrint", "false") 8455 urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/milestones/{milestoneId}/claim") 8456 urls += "?" + c.urlParams_.Encode() 8457 req, err := http.NewRequest("PUT", urls, body) 8458 if err != nil { 8459 return nil, err 8460 } 8461 req.Header = reqHeaders 8462 googleapi.Expand(req.URL, map[string]string{ 8463 "questId": c.questId, 8464 "milestoneId": c.milestoneId, 8465 }) 8466 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8467} 8468 8469// Do executes the "games.questMilestones.claim" call. 8470func (c *QuestMilestonesClaimCall) Do(opts ...googleapi.CallOption) error { 8471 gensupport.SetOptions(c.urlParams_, opts...) 8472 res, err := c.doRequest("json") 8473 if err != nil { 8474 return err 8475 } 8476 defer googleapi.CloseBody(res) 8477 if err := googleapi.CheckResponse(res); err != nil { 8478 return err 8479 } 8480 return nil 8481 // { 8482 // "description": "Report that a reward for the milestone corresponding to milestoneId for the quest corresponding to questId has been claimed by the currently authorized user.", 8483 // "httpMethod": "PUT", 8484 // "id": "games.questMilestones.claim", 8485 // "parameterOrder": [ 8486 // "questId", 8487 // "milestoneId", 8488 // "requestId" 8489 // ], 8490 // "parameters": { 8491 // "milestoneId": { 8492 // "description": "The ID of the milestone.", 8493 // "location": "path", 8494 // "required": true, 8495 // "type": "string" 8496 // }, 8497 // "questId": { 8498 // "description": "The ID of the quest.", 8499 // "location": "path", 8500 // "required": true, 8501 // "type": "string" 8502 // }, 8503 // "requestId": { 8504 // "description": "A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly.", 8505 // "format": "int64", 8506 // "location": "query", 8507 // "required": true, 8508 // "type": "string" 8509 // } 8510 // }, 8511 // "path": "quests/{questId}/milestones/{milestoneId}/claim", 8512 // "scopes": [ 8513 // "https://www.googleapis.com/auth/games" 8514 // ] 8515 // } 8516 8517} 8518 8519// method id "games.quests.accept": 8520 8521type QuestsAcceptCall struct { 8522 s *Service 8523 questId string 8524 urlParams_ gensupport.URLParams 8525 ctx_ context.Context 8526 header_ http.Header 8527} 8528 8529// Accept: Indicates that the currently authorized user will participate 8530// in the quest. 8531func (r *QuestsService) Accept(questId string) *QuestsAcceptCall { 8532 c := &QuestsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8533 c.questId = questId 8534 return c 8535} 8536 8537// Language sets the optional parameter "language": The preferred 8538// language to use for strings returned by this method. 8539func (c *QuestsAcceptCall) Language(language string) *QuestsAcceptCall { 8540 c.urlParams_.Set("language", language) 8541 return c 8542} 8543 8544// Fields allows partial responses to be retrieved. See 8545// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8546// for more information. 8547func (c *QuestsAcceptCall) Fields(s ...googleapi.Field) *QuestsAcceptCall { 8548 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8549 return c 8550} 8551 8552// Context sets the context to be used in this call's Do method. Any 8553// pending HTTP request will be aborted if the provided context is 8554// canceled. 8555func (c *QuestsAcceptCall) Context(ctx context.Context) *QuestsAcceptCall { 8556 c.ctx_ = ctx 8557 return c 8558} 8559 8560// Header returns an http.Header that can be modified by the caller to 8561// add HTTP headers to the request. 8562func (c *QuestsAcceptCall) Header() http.Header { 8563 if c.header_ == nil { 8564 c.header_ = make(http.Header) 8565 } 8566 return c.header_ 8567} 8568 8569func (c *QuestsAcceptCall) doRequest(alt string) (*http.Response, error) { 8570 reqHeaders := make(http.Header) 8571 for k, v := range c.header_ { 8572 reqHeaders[k] = v 8573 } 8574 reqHeaders.Set("User-Agent", c.s.userAgent()) 8575 var body io.Reader = nil 8576 c.urlParams_.Set("alt", alt) 8577 c.urlParams_.Set("prettyPrint", "false") 8578 urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/accept") 8579 urls += "?" + c.urlParams_.Encode() 8580 req, err := http.NewRequest("POST", urls, body) 8581 if err != nil { 8582 return nil, err 8583 } 8584 req.Header = reqHeaders 8585 googleapi.Expand(req.URL, map[string]string{ 8586 "questId": c.questId, 8587 }) 8588 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8589} 8590 8591// Do executes the "games.quests.accept" call. 8592// Exactly one of *Quest or error will be non-nil. Any non-2xx status 8593// code is an error. Response headers are in either 8594// *Quest.ServerResponse.Header or (if a response was returned at all) 8595// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8596// check whether the returned error was because http.StatusNotModified 8597// was returned. 8598func (c *QuestsAcceptCall) Do(opts ...googleapi.CallOption) (*Quest, error) { 8599 gensupport.SetOptions(c.urlParams_, opts...) 8600 res, err := c.doRequest("json") 8601 if res != nil && res.StatusCode == http.StatusNotModified { 8602 if res.Body != nil { 8603 res.Body.Close() 8604 } 8605 return nil, &googleapi.Error{ 8606 Code: res.StatusCode, 8607 Header: res.Header, 8608 } 8609 } 8610 if err != nil { 8611 return nil, err 8612 } 8613 defer googleapi.CloseBody(res) 8614 if err := googleapi.CheckResponse(res); err != nil { 8615 return nil, err 8616 } 8617 ret := &Quest{ 8618 ServerResponse: googleapi.ServerResponse{ 8619 Header: res.Header, 8620 HTTPStatusCode: res.StatusCode, 8621 }, 8622 } 8623 target := &ret 8624 if err := gensupport.DecodeResponse(target, res); err != nil { 8625 return nil, err 8626 } 8627 return ret, nil 8628 // { 8629 // "description": "Indicates that the currently authorized user will participate in the quest.", 8630 // "httpMethod": "POST", 8631 // "id": "games.quests.accept", 8632 // "parameterOrder": [ 8633 // "questId" 8634 // ], 8635 // "parameters": { 8636 // "language": { 8637 // "description": "The preferred language to use for strings returned by this method.", 8638 // "location": "query", 8639 // "type": "string" 8640 // }, 8641 // "questId": { 8642 // "description": "The ID of the quest.", 8643 // "location": "path", 8644 // "required": true, 8645 // "type": "string" 8646 // } 8647 // }, 8648 // "path": "quests/{questId}/accept", 8649 // "response": { 8650 // "$ref": "Quest" 8651 // }, 8652 // "scopes": [ 8653 // "https://www.googleapis.com/auth/games" 8654 // ] 8655 // } 8656 8657} 8658 8659// method id "games.quests.list": 8660 8661type QuestsListCall struct { 8662 s *Service 8663 playerId string 8664 urlParams_ gensupport.URLParams 8665 ifNoneMatch_ string 8666 ctx_ context.Context 8667 header_ http.Header 8668} 8669 8670// List: Get a list of quests for your application and the currently 8671// authenticated player. 8672func (r *QuestsService) List(playerId string) *QuestsListCall { 8673 c := &QuestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8674 c.playerId = playerId 8675 return c 8676} 8677 8678// Language sets the optional parameter "language": The preferred 8679// language to use for strings returned by this method. 8680func (c *QuestsListCall) Language(language string) *QuestsListCall { 8681 c.urlParams_.Set("language", language) 8682 return c 8683} 8684 8685// MaxResults sets the optional parameter "maxResults": The maximum 8686// number of quest resources to return in the response, used for paging. 8687// For any response, the actual number of quest resources returned may 8688// be less than the specified maxResults. Acceptable values are 1 to 50, 8689// inclusive. (Default: 50). 8690func (c *QuestsListCall) MaxResults(maxResults int64) *QuestsListCall { 8691 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 8692 return c 8693} 8694 8695// PageToken sets the optional parameter "pageToken": The token returned 8696// by the previous request. 8697func (c *QuestsListCall) PageToken(pageToken string) *QuestsListCall { 8698 c.urlParams_.Set("pageToken", pageToken) 8699 return c 8700} 8701 8702// Fields allows partial responses to be retrieved. See 8703// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8704// for more information. 8705func (c *QuestsListCall) Fields(s ...googleapi.Field) *QuestsListCall { 8706 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8707 return c 8708} 8709 8710// IfNoneMatch sets the optional parameter which makes the operation 8711// fail if the object's ETag matches the given value. This is useful for 8712// getting updates only after the object has changed since the last 8713// request. Use googleapi.IsNotModified to check whether the response 8714// error from Do is the result of In-None-Match. 8715func (c *QuestsListCall) IfNoneMatch(entityTag string) *QuestsListCall { 8716 c.ifNoneMatch_ = entityTag 8717 return c 8718} 8719 8720// Context sets the context to be used in this call's Do method. Any 8721// pending HTTP request will be aborted if the provided context is 8722// canceled. 8723func (c *QuestsListCall) Context(ctx context.Context) *QuestsListCall { 8724 c.ctx_ = ctx 8725 return c 8726} 8727 8728// Header returns an http.Header that can be modified by the caller to 8729// add HTTP headers to the request. 8730func (c *QuestsListCall) Header() http.Header { 8731 if c.header_ == nil { 8732 c.header_ = make(http.Header) 8733 } 8734 return c.header_ 8735} 8736 8737func (c *QuestsListCall) doRequest(alt string) (*http.Response, error) { 8738 reqHeaders := make(http.Header) 8739 for k, v := range c.header_ { 8740 reqHeaders[k] = v 8741 } 8742 reqHeaders.Set("User-Agent", c.s.userAgent()) 8743 if c.ifNoneMatch_ != "" { 8744 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8745 } 8746 var body io.Reader = nil 8747 c.urlParams_.Set("alt", alt) 8748 c.urlParams_.Set("prettyPrint", "false") 8749 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/quests") 8750 urls += "?" + c.urlParams_.Encode() 8751 req, err := http.NewRequest("GET", urls, body) 8752 if err != nil { 8753 return nil, err 8754 } 8755 req.Header = reqHeaders 8756 googleapi.Expand(req.URL, map[string]string{ 8757 "playerId": c.playerId, 8758 }) 8759 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8760} 8761 8762// Do executes the "games.quests.list" call. 8763// Exactly one of *QuestListResponse or error will be non-nil. Any 8764// non-2xx status code is an error. Response headers are in either 8765// *QuestListResponse.ServerResponse.Header or (if a response was 8766// returned at all) in error.(*googleapi.Error).Header. Use 8767// googleapi.IsNotModified to check whether the returned error was 8768// because http.StatusNotModified was returned. 8769func (c *QuestsListCall) Do(opts ...googleapi.CallOption) (*QuestListResponse, error) { 8770 gensupport.SetOptions(c.urlParams_, opts...) 8771 res, err := c.doRequest("json") 8772 if res != nil && res.StatusCode == http.StatusNotModified { 8773 if res.Body != nil { 8774 res.Body.Close() 8775 } 8776 return nil, &googleapi.Error{ 8777 Code: res.StatusCode, 8778 Header: res.Header, 8779 } 8780 } 8781 if err != nil { 8782 return nil, err 8783 } 8784 defer googleapi.CloseBody(res) 8785 if err := googleapi.CheckResponse(res); err != nil { 8786 return nil, err 8787 } 8788 ret := &QuestListResponse{ 8789 ServerResponse: googleapi.ServerResponse{ 8790 Header: res.Header, 8791 HTTPStatusCode: res.StatusCode, 8792 }, 8793 } 8794 target := &ret 8795 if err := gensupport.DecodeResponse(target, res); err != nil { 8796 return nil, err 8797 } 8798 return ret, nil 8799 // { 8800 // "description": "Get a list of quests for your application and the currently authenticated player.", 8801 // "httpMethod": "GET", 8802 // "id": "games.quests.list", 8803 // "parameterOrder": [ 8804 // "playerId" 8805 // ], 8806 // "parameters": { 8807 // "language": { 8808 // "description": "The preferred language to use for strings returned by this method.", 8809 // "location": "query", 8810 // "type": "string" 8811 // }, 8812 // "maxResults": { 8813 // "description": "The maximum number of quest resources to return in the response, used for paging. For any response, the actual number of quest resources returned may be less than the specified maxResults. Acceptable values are 1 to 50, inclusive. (Default: 50).", 8814 // "format": "int32", 8815 // "location": "query", 8816 // "maximum": "50", 8817 // "minimum": "1", 8818 // "type": "integer" 8819 // }, 8820 // "pageToken": { 8821 // "description": "The token returned by the previous request.", 8822 // "location": "query", 8823 // "type": "string" 8824 // }, 8825 // "playerId": { 8826 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 8827 // "location": "path", 8828 // "required": true, 8829 // "type": "string" 8830 // } 8831 // }, 8832 // "path": "players/{playerId}/quests", 8833 // "response": { 8834 // "$ref": "QuestListResponse" 8835 // }, 8836 // "scopes": [ 8837 // "https://www.googleapis.com/auth/games" 8838 // ] 8839 // } 8840 8841} 8842 8843// Pages invokes f for each page of results. 8844// A non-nil error returned from f will halt the iteration. 8845// The provided context supersedes any context provided to the Context method. 8846func (c *QuestsListCall) Pages(ctx context.Context, f func(*QuestListResponse) error) error { 8847 c.ctx_ = ctx 8848 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8849 for { 8850 x, err := c.Do() 8851 if err != nil { 8852 return err 8853 } 8854 if err := f(x); err != nil { 8855 return err 8856 } 8857 if x.NextPageToken == "" { 8858 return nil 8859 } 8860 c.PageToken(x.NextPageToken) 8861 } 8862} 8863 8864// method id "games.revisions.check": 8865 8866type RevisionsCheckCall struct { 8867 s *Service 8868 urlParams_ gensupport.URLParams 8869 ifNoneMatch_ string 8870 ctx_ context.Context 8871 header_ http.Header 8872} 8873 8874// Check: Checks whether the games client is out of date. 8875func (r *RevisionsService) Check(clientRevision string) *RevisionsCheckCall { 8876 c := &RevisionsCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8877 c.urlParams_.Set("clientRevision", clientRevision) 8878 return c 8879} 8880 8881// Fields allows partial responses to be retrieved. See 8882// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8883// for more information. 8884func (c *RevisionsCheckCall) Fields(s ...googleapi.Field) *RevisionsCheckCall { 8885 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8886 return c 8887} 8888 8889// IfNoneMatch sets the optional parameter which makes the operation 8890// fail if the object's ETag matches the given value. This is useful for 8891// getting updates only after the object has changed since the last 8892// request. Use googleapi.IsNotModified to check whether the response 8893// error from Do is the result of In-None-Match. 8894func (c *RevisionsCheckCall) IfNoneMatch(entityTag string) *RevisionsCheckCall { 8895 c.ifNoneMatch_ = entityTag 8896 return c 8897} 8898 8899// Context sets the context to be used in this call's Do method. Any 8900// pending HTTP request will be aborted if the provided context is 8901// canceled. 8902func (c *RevisionsCheckCall) Context(ctx context.Context) *RevisionsCheckCall { 8903 c.ctx_ = ctx 8904 return c 8905} 8906 8907// Header returns an http.Header that can be modified by the caller to 8908// add HTTP headers to the request. 8909func (c *RevisionsCheckCall) Header() http.Header { 8910 if c.header_ == nil { 8911 c.header_ = make(http.Header) 8912 } 8913 return c.header_ 8914} 8915 8916func (c *RevisionsCheckCall) doRequest(alt string) (*http.Response, error) { 8917 reqHeaders := make(http.Header) 8918 for k, v := range c.header_ { 8919 reqHeaders[k] = v 8920 } 8921 reqHeaders.Set("User-Agent", c.s.userAgent()) 8922 if c.ifNoneMatch_ != "" { 8923 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8924 } 8925 var body io.Reader = nil 8926 c.urlParams_.Set("alt", alt) 8927 c.urlParams_.Set("prettyPrint", "false") 8928 urls := googleapi.ResolveRelative(c.s.BasePath, "revisions/check") 8929 urls += "?" + c.urlParams_.Encode() 8930 req, err := http.NewRequest("GET", urls, body) 8931 if err != nil { 8932 return nil, err 8933 } 8934 req.Header = reqHeaders 8935 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8936} 8937 8938// Do executes the "games.revisions.check" call. 8939// Exactly one of *RevisionCheckResponse or error will be non-nil. Any 8940// non-2xx status code is an error. Response headers are in either 8941// *RevisionCheckResponse.ServerResponse.Header or (if a response was 8942// returned at all) in error.(*googleapi.Error).Header. Use 8943// googleapi.IsNotModified to check whether the returned error was 8944// because http.StatusNotModified was returned. 8945func (c *RevisionsCheckCall) Do(opts ...googleapi.CallOption) (*RevisionCheckResponse, error) { 8946 gensupport.SetOptions(c.urlParams_, opts...) 8947 res, err := c.doRequest("json") 8948 if res != nil && res.StatusCode == http.StatusNotModified { 8949 if res.Body != nil { 8950 res.Body.Close() 8951 } 8952 return nil, &googleapi.Error{ 8953 Code: res.StatusCode, 8954 Header: res.Header, 8955 } 8956 } 8957 if err != nil { 8958 return nil, err 8959 } 8960 defer googleapi.CloseBody(res) 8961 if err := googleapi.CheckResponse(res); err != nil { 8962 return nil, err 8963 } 8964 ret := &RevisionCheckResponse{ 8965 ServerResponse: googleapi.ServerResponse{ 8966 Header: res.Header, 8967 HTTPStatusCode: res.StatusCode, 8968 }, 8969 } 8970 target := &ret 8971 if err := gensupport.DecodeResponse(target, res); err != nil { 8972 return nil, err 8973 } 8974 return ret, nil 8975 // { 8976 // "description": "Checks whether the games client is out of date.", 8977 // "httpMethod": "GET", 8978 // "id": "games.revisions.check", 8979 // "parameterOrder": [ 8980 // "clientRevision" 8981 // ], 8982 // "parameters": { 8983 // "clientRevision": { 8984 // "description": "The revision of the client SDK used by your application. Format:\n[PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are:\n \n- \"ANDROID\" - Client is running the Android SDK. \n- \"IOS\" - Client is running the iOS SDK. \n- \"WEB_APP\" - Client is running as a Web App.", 8985 // "location": "query", 8986 // "required": true, 8987 // "type": "string" 8988 // } 8989 // }, 8990 // "path": "revisions/check", 8991 // "response": { 8992 // "$ref": "RevisionCheckResponse" 8993 // }, 8994 // "scopes": [ 8995 // "https://www.googleapis.com/auth/games" 8996 // ] 8997 // } 8998 8999} 9000 9001// method id "games.rooms.create": 9002 9003type RoomsCreateCall struct { 9004 s *Service 9005 roomcreaterequest *RoomCreateRequest 9006 urlParams_ gensupport.URLParams 9007 ctx_ context.Context 9008 header_ http.Header 9009} 9010 9011// Create: Create a room. For internal use by the Games SDK only. 9012// Calling this method directly is unsupported. 9013func (r *RoomsService) Create(roomcreaterequest *RoomCreateRequest) *RoomsCreateCall { 9014 c := &RoomsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9015 c.roomcreaterequest = roomcreaterequest 9016 return c 9017} 9018 9019// Language sets the optional parameter "language": The preferred 9020// language to use for strings returned by this method. 9021func (c *RoomsCreateCall) Language(language string) *RoomsCreateCall { 9022 c.urlParams_.Set("language", language) 9023 return c 9024} 9025 9026// Fields allows partial responses to be retrieved. See 9027// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9028// for more information. 9029func (c *RoomsCreateCall) Fields(s ...googleapi.Field) *RoomsCreateCall { 9030 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9031 return c 9032} 9033 9034// Context sets the context to be used in this call's Do method. Any 9035// pending HTTP request will be aborted if the provided context is 9036// canceled. 9037func (c *RoomsCreateCall) Context(ctx context.Context) *RoomsCreateCall { 9038 c.ctx_ = ctx 9039 return c 9040} 9041 9042// Header returns an http.Header that can be modified by the caller to 9043// add HTTP headers to the request. 9044func (c *RoomsCreateCall) Header() http.Header { 9045 if c.header_ == nil { 9046 c.header_ = make(http.Header) 9047 } 9048 return c.header_ 9049} 9050 9051func (c *RoomsCreateCall) doRequest(alt string) (*http.Response, error) { 9052 reqHeaders := make(http.Header) 9053 for k, v := range c.header_ { 9054 reqHeaders[k] = v 9055 } 9056 reqHeaders.Set("User-Agent", c.s.userAgent()) 9057 var body io.Reader = nil 9058 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomcreaterequest) 9059 if err != nil { 9060 return nil, err 9061 } 9062 reqHeaders.Set("Content-Type", "application/json") 9063 c.urlParams_.Set("alt", alt) 9064 c.urlParams_.Set("prettyPrint", "false") 9065 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/create") 9066 urls += "?" + c.urlParams_.Encode() 9067 req, err := http.NewRequest("POST", urls, body) 9068 if err != nil { 9069 return nil, err 9070 } 9071 req.Header = reqHeaders 9072 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9073} 9074 9075// Do executes the "games.rooms.create" call. 9076// Exactly one of *Room or error will be non-nil. Any non-2xx status 9077// code is an error. Response headers are in either 9078// *Room.ServerResponse.Header or (if a response was returned at all) in 9079// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9080// whether the returned error was because http.StatusNotModified was 9081// returned. 9082func (c *RoomsCreateCall) Do(opts ...googleapi.CallOption) (*Room, error) { 9083 gensupport.SetOptions(c.urlParams_, opts...) 9084 res, err := c.doRequest("json") 9085 if res != nil && res.StatusCode == http.StatusNotModified { 9086 if res.Body != nil { 9087 res.Body.Close() 9088 } 9089 return nil, &googleapi.Error{ 9090 Code: res.StatusCode, 9091 Header: res.Header, 9092 } 9093 } 9094 if err != nil { 9095 return nil, err 9096 } 9097 defer googleapi.CloseBody(res) 9098 if err := googleapi.CheckResponse(res); err != nil { 9099 return nil, err 9100 } 9101 ret := &Room{ 9102 ServerResponse: googleapi.ServerResponse{ 9103 Header: res.Header, 9104 HTTPStatusCode: res.StatusCode, 9105 }, 9106 } 9107 target := &ret 9108 if err := gensupport.DecodeResponse(target, res); err != nil { 9109 return nil, err 9110 } 9111 return ret, nil 9112 // { 9113 // "description": "Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 9114 // "httpMethod": "POST", 9115 // "id": "games.rooms.create", 9116 // "parameters": { 9117 // "language": { 9118 // "description": "The preferred language to use for strings returned by this method.", 9119 // "location": "query", 9120 // "type": "string" 9121 // } 9122 // }, 9123 // "path": "rooms/create", 9124 // "request": { 9125 // "$ref": "RoomCreateRequest" 9126 // }, 9127 // "response": { 9128 // "$ref": "Room" 9129 // }, 9130 // "scopes": [ 9131 // "https://www.googleapis.com/auth/games" 9132 // ] 9133 // } 9134 9135} 9136 9137// method id "games.rooms.decline": 9138 9139type RoomsDeclineCall struct { 9140 s *Service 9141 roomId string 9142 urlParams_ gensupport.URLParams 9143 ctx_ context.Context 9144 header_ http.Header 9145} 9146 9147// Decline: Decline an invitation to join a room. For internal use by 9148// the Games SDK only. Calling this method directly is unsupported. 9149func (r *RoomsService) Decline(roomId string) *RoomsDeclineCall { 9150 c := &RoomsDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9151 c.roomId = roomId 9152 return c 9153} 9154 9155// Language sets the optional parameter "language": The preferred 9156// language to use for strings returned by this method. 9157func (c *RoomsDeclineCall) Language(language string) *RoomsDeclineCall { 9158 c.urlParams_.Set("language", language) 9159 return c 9160} 9161 9162// Fields allows partial responses to be retrieved. See 9163// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9164// for more information. 9165func (c *RoomsDeclineCall) Fields(s ...googleapi.Field) *RoomsDeclineCall { 9166 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9167 return c 9168} 9169 9170// Context sets the context to be used in this call's Do method. Any 9171// pending HTTP request will be aborted if the provided context is 9172// canceled. 9173func (c *RoomsDeclineCall) Context(ctx context.Context) *RoomsDeclineCall { 9174 c.ctx_ = ctx 9175 return c 9176} 9177 9178// Header returns an http.Header that can be modified by the caller to 9179// add HTTP headers to the request. 9180func (c *RoomsDeclineCall) Header() http.Header { 9181 if c.header_ == nil { 9182 c.header_ = make(http.Header) 9183 } 9184 return c.header_ 9185} 9186 9187func (c *RoomsDeclineCall) doRequest(alt string) (*http.Response, error) { 9188 reqHeaders := make(http.Header) 9189 for k, v := range c.header_ { 9190 reqHeaders[k] = v 9191 } 9192 reqHeaders.Set("User-Agent", c.s.userAgent()) 9193 var body io.Reader = nil 9194 c.urlParams_.Set("alt", alt) 9195 c.urlParams_.Set("prettyPrint", "false") 9196 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/decline") 9197 urls += "?" + c.urlParams_.Encode() 9198 req, err := http.NewRequest("POST", urls, body) 9199 if err != nil { 9200 return nil, err 9201 } 9202 req.Header = reqHeaders 9203 googleapi.Expand(req.URL, map[string]string{ 9204 "roomId": c.roomId, 9205 }) 9206 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9207} 9208 9209// Do executes the "games.rooms.decline" call. 9210// Exactly one of *Room or error will be non-nil. Any non-2xx status 9211// code is an error. Response headers are in either 9212// *Room.ServerResponse.Header or (if a response was returned at all) in 9213// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9214// whether the returned error was because http.StatusNotModified was 9215// returned. 9216func (c *RoomsDeclineCall) Do(opts ...googleapi.CallOption) (*Room, error) { 9217 gensupport.SetOptions(c.urlParams_, opts...) 9218 res, err := c.doRequest("json") 9219 if res != nil && res.StatusCode == http.StatusNotModified { 9220 if res.Body != nil { 9221 res.Body.Close() 9222 } 9223 return nil, &googleapi.Error{ 9224 Code: res.StatusCode, 9225 Header: res.Header, 9226 } 9227 } 9228 if err != nil { 9229 return nil, err 9230 } 9231 defer googleapi.CloseBody(res) 9232 if err := googleapi.CheckResponse(res); err != nil { 9233 return nil, err 9234 } 9235 ret := &Room{ 9236 ServerResponse: googleapi.ServerResponse{ 9237 Header: res.Header, 9238 HTTPStatusCode: res.StatusCode, 9239 }, 9240 } 9241 target := &ret 9242 if err := gensupport.DecodeResponse(target, res); err != nil { 9243 return nil, err 9244 } 9245 return ret, nil 9246 // { 9247 // "description": "Decline an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 9248 // "httpMethod": "POST", 9249 // "id": "games.rooms.decline", 9250 // "parameterOrder": [ 9251 // "roomId" 9252 // ], 9253 // "parameters": { 9254 // "language": { 9255 // "description": "The preferred language to use for strings returned by this method.", 9256 // "location": "query", 9257 // "type": "string" 9258 // }, 9259 // "roomId": { 9260 // "description": "The ID of the room.", 9261 // "location": "path", 9262 // "required": true, 9263 // "type": "string" 9264 // } 9265 // }, 9266 // "path": "rooms/{roomId}/decline", 9267 // "response": { 9268 // "$ref": "Room" 9269 // }, 9270 // "scopes": [ 9271 // "https://www.googleapis.com/auth/games" 9272 // ] 9273 // } 9274 9275} 9276 9277// method id "games.rooms.dismiss": 9278 9279type RoomsDismissCall struct { 9280 s *Service 9281 roomId string 9282 urlParams_ gensupport.URLParams 9283 ctx_ context.Context 9284 header_ http.Header 9285} 9286 9287// Dismiss: Dismiss an invitation to join a room. For internal use by 9288// the Games SDK only. Calling this method directly is unsupported. 9289func (r *RoomsService) Dismiss(roomId string) *RoomsDismissCall { 9290 c := &RoomsDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9291 c.roomId = roomId 9292 return c 9293} 9294 9295// Fields allows partial responses to be retrieved. See 9296// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9297// for more information. 9298func (c *RoomsDismissCall) Fields(s ...googleapi.Field) *RoomsDismissCall { 9299 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9300 return c 9301} 9302 9303// Context sets the context to be used in this call's Do method. Any 9304// pending HTTP request will be aborted if the provided context is 9305// canceled. 9306func (c *RoomsDismissCall) Context(ctx context.Context) *RoomsDismissCall { 9307 c.ctx_ = ctx 9308 return c 9309} 9310 9311// Header returns an http.Header that can be modified by the caller to 9312// add HTTP headers to the request. 9313func (c *RoomsDismissCall) Header() http.Header { 9314 if c.header_ == nil { 9315 c.header_ = make(http.Header) 9316 } 9317 return c.header_ 9318} 9319 9320func (c *RoomsDismissCall) doRequest(alt string) (*http.Response, error) { 9321 reqHeaders := make(http.Header) 9322 for k, v := range c.header_ { 9323 reqHeaders[k] = v 9324 } 9325 reqHeaders.Set("User-Agent", c.s.userAgent()) 9326 var body io.Reader = nil 9327 c.urlParams_.Set("alt", alt) 9328 c.urlParams_.Set("prettyPrint", "false") 9329 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/dismiss") 9330 urls += "?" + c.urlParams_.Encode() 9331 req, err := http.NewRequest("POST", urls, body) 9332 if err != nil { 9333 return nil, err 9334 } 9335 req.Header = reqHeaders 9336 googleapi.Expand(req.URL, map[string]string{ 9337 "roomId": c.roomId, 9338 }) 9339 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9340} 9341 9342// Do executes the "games.rooms.dismiss" call. 9343func (c *RoomsDismissCall) Do(opts ...googleapi.CallOption) error { 9344 gensupport.SetOptions(c.urlParams_, opts...) 9345 res, err := c.doRequest("json") 9346 if err != nil { 9347 return err 9348 } 9349 defer googleapi.CloseBody(res) 9350 if err := googleapi.CheckResponse(res); err != nil { 9351 return err 9352 } 9353 return nil 9354 // { 9355 // "description": "Dismiss an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 9356 // "httpMethod": "POST", 9357 // "id": "games.rooms.dismiss", 9358 // "parameterOrder": [ 9359 // "roomId" 9360 // ], 9361 // "parameters": { 9362 // "roomId": { 9363 // "description": "The ID of the room.", 9364 // "location": "path", 9365 // "required": true, 9366 // "type": "string" 9367 // } 9368 // }, 9369 // "path": "rooms/{roomId}/dismiss", 9370 // "scopes": [ 9371 // "https://www.googleapis.com/auth/games" 9372 // ] 9373 // } 9374 9375} 9376 9377// method id "games.rooms.get": 9378 9379type RoomsGetCall struct { 9380 s *Service 9381 roomId string 9382 urlParams_ gensupport.URLParams 9383 ifNoneMatch_ string 9384 ctx_ context.Context 9385 header_ http.Header 9386} 9387 9388// Get: Get the data for a room. 9389func (r *RoomsService) Get(roomId string) *RoomsGetCall { 9390 c := &RoomsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9391 c.roomId = roomId 9392 return c 9393} 9394 9395// Language sets the optional parameter "language": The preferred 9396// language to use for strings returned by this method. 9397func (c *RoomsGetCall) Language(language string) *RoomsGetCall { 9398 c.urlParams_.Set("language", language) 9399 return c 9400} 9401 9402// Fields allows partial responses to be retrieved. See 9403// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9404// for more information. 9405func (c *RoomsGetCall) Fields(s ...googleapi.Field) *RoomsGetCall { 9406 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9407 return c 9408} 9409 9410// IfNoneMatch sets the optional parameter which makes the operation 9411// fail if the object's ETag matches the given value. This is useful for 9412// getting updates only after the object has changed since the last 9413// request. Use googleapi.IsNotModified to check whether the response 9414// error from Do is the result of In-None-Match. 9415func (c *RoomsGetCall) IfNoneMatch(entityTag string) *RoomsGetCall { 9416 c.ifNoneMatch_ = entityTag 9417 return c 9418} 9419 9420// Context sets the context to be used in this call's Do method. Any 9421// pending HTTP request will be aborted if the provided context is 9422// canceled. 9423func (c *RoomsGetCall) Context(ctx context.Context) *RoomsGetCall { 9424 c.ctx_ = ctx 9425 return c 9426} 9427 9428// Header returns an http.Header that can be modified by the caller to 9429// add HTTP headers to the request. 9430func (c *RoomsGetCall) Header() http.Header { 9431 if c.header_ == nil { 9432 c.header_ = make(http.Header) 9433 } 9434 return c.header_ 9435} 9436 9437func (c *RoomsGetCall) doRequest(alt string) (*http.Response, error) { 9438 reqHeaders := make(http.Header) 9439 for k, v := range c.header_ { 9440 reqHeaders[k] = v 9441 } 9442 reqHeaders.Set("User-Agent", c.s.userAgent()) 9443 if c.ifNoneMatch_ != "" { 9444 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9445 } 9446 var body io.Reader = nil 9447 c.urlParams_.Set("alt", alt) 9448 c.urlParams_.Set("prettyPrint", "false") 9449 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}") 9450 urls += "?" + c.urlParams_.Encode() 9451 req, err := http.NewRequest("GET", urls, body) 9452 if err != nil { 9453 return nil, err 9454 } 9455 req.Header = reqHeaders 9456 googleapi.Expand(req.URL, map[string]string{ 9457 "roomId": c.roomId, 9458 }) 9459 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9460} 9461 9462// Do executes the "games.rooms.get" call. 9463// Exactly one of *Room or error will be non-nil. Any non-2xx status 9464// code is an error. Response headers are in either 9465// *Room.ServerResponse.Header or (if a response was returned at all) in 9466// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9467// whether the returned error was because http.StatusNotModified was 9468// returned. 9469func (c *RoomsGetCall) Do(opts ...googleapi.CallOption) (*Room, error) { 9470 gensupport.SetOptions(c.urlParams_, opts...) 9471 res, err := c.doRequest("json") 9472 if res != nil && res.StatusCode == http.StatusNotModified { 9473 if res.Body != nil { 9474 res.Body.Close() 9475 } 9476 return nil, &googleapi.Error{ 9477 Code: res.StatusCode, 9478 Header: res.Header, 9479 } 9480 } 9481 if err != nil { 9482 return nil, err 9483 } 9484 defer googleapi.CloseBody(res) 9485 if err := googleapi.CheckResponse(res); err != nil { 9486 return nil, err 9487 } 9488 ret := &Room{ 9489 ServerResponse: googleapi.ServerResponse{ 9490 Header: res.Header, 9491 HTTPStatusCode: res.StatusCode, 9492 }, 9493 } 9494 target := &ret 9495 if err := gensupport.DecodeResponse(target, res); err != nil { 9496 return nil, err 9497 } 9498 return ret, nil 9499 // { 9500 // "description": "Get the data for a room.", 9501 // "httpMethod": "GET", 9502 // "id": "games.rooms.get", 9503 // "parameterOrder": [ 9504 // "roomId" 9505 // ], 9506 // "parameters": { 9507 // "language": { 9508 // "description": "The preferred language to use for strings returned by this method.", 9509 // "location": "query", 9510 // "type": "string" 9511 // }, 9512 // "roomId": { 9513 // "description": "The ID of the room.", 9514 // "location": "path", 9515 // "required": true, 9516 // "type": "string" 9517 // } 9518 // }, 9519 // "path": "rooms/{roomId}", 9520 // "response": { 9521 // "$ref": "Room" 9522 // }, 9523 // "scopes": [ 9524 // "https://www.googleapis.com/auth/games" 9525 // ] 9526 // } 9527 9528} 9529 9530// method id "games.rooms.join": 9531 9532type RoomsJoinCall struct { 9533 s *Service 9534 roomId string 9535 roomjoinrequest *RoomJoinRequest 9536 urlParams_ gensupport.URLParams 9537 ctx_ context.Context 9538 header_ http.Header 9539} 9540 9541// Join: Join a room. For internal use by the Games SDK only. Calling 9542// this method directly is unsupported. 9543func (r *RoomsService) Join(roomId string, roomjoinrequest *RoomJoinRequest) *RoomsJoinCall { 9544 c := &RoomsJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9545 c.roomId = roomId 9546 c.roomjoinrequest = roomjoinrequest 9547 return c 9548} 9549 9550// Language sets the optional parameter "language": The preferred 9551// language to use for strings returned by this method. 9552func (c *RoomsJoinCall) Language(language string) *RoomsJoinCall { 9553 c.urlParams_.Set("language", language) 9554 return c 9555} 9556 9557// Fields allows partial responses to be retrieved. See 9558// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9559// for more information. 9560func (c *RoomsJoinCall) Fields(s ...googleapi.Field) *RoomsJoinCall { 9561 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9562 return c 9563} 9564 9565// Context sets the context to be used in this call's Do method. Any 9566// pending HTTP request will be aborted if the provided context is 9567// canceled. 9568func (c *RoomsJoinCall) Context(ctx context.Context) *RoomsJoinCall { 9569 c.ctx_ = ctx 9570 return c 9571} 9572 9573// Header returns an http.Header that can be modified by the caller to 9574// add HTTP headers to the request. 9575func (c *RoomsJoinCall) Header() http.Header { 9576 if c.header_ == nil { 9577 c.header_ = make(http.Header) 9578 } 9579 return c.header_ 9580} 9581 9582func (c *RoomsJoinCall) doRequest(alt string) (*http.Response, error) { 9583 reqHeaders := make(http.Header) 9584 for k, v := range c.header_ { 9585 reqHeaders[k] = v 9586 } 9587 reqHeaders.Set("User-Agent", c.s.userAgent()) 9588 var body io.Reader = nil 9589 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomjoinrequest) 9590 if err != nil { 9591 return nil, err 9592 } 9593 reqHeaders.Set("Content-Type", "application/json") 9594 c.urlParams_.Set("alt", alt) 9595 c.urlParams_.Set("prettyPrint", "false") 9596 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/join") 9597 urls += "?" + c.urlParams_.Encode() 9598 req, err := http.NewRequest("POST", urls, body) 9599 if err != nil { 9600 return nil, err 9601 } 9602 req.Header = reqHeaders 9603 googleapi.Expand(req.URL, map[string]string{ 9604 "roomId": c.roomId, 9605 }) 9606 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9607} 9608 9609// Do executes the "games.rooms.join" call. 9610// Exactly one of *Room or error will be non-nil. Any non-2xx status 9611// code is an error. Response headers are in either 9612// *Room.ServerResponse.Header or (if a response was returned at all) in 9613// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9614// whether the returned error was because http.StatusNotModified was 9615// returned. 9616func (c *RoomsJoinCall) Do(opts ...googleapi.CallOption) (*Room, error) { 9617 gensupport.SetOptions(c.urlParams_, opts...) 9618 res, err := c.doRequest("json") 9619 if res != nil && res.StatusCode == http.StatusNotModified { 9620 if res.Body != nil { 9621 res.Body.Close() 9622 } 9623 return nil, &googleapi.Error{ 9624 Code: res.StatusCode, 9625 Header: res.Header, 9626 } 9627 } 9628 if err != nil { 9629 return nil, err 9630 } 9631 defer googleapi.CloseBody(res) 9632 if err := googleapi.CheckResponse(res); err != nil { 9633 return nil, err 9634 } 9635 ret := &Room{ 9636 ServerResponse: googleapi.ServerResponse{ 9637 Header: res.Header, 9638 HTTPStatusCode: res.StatusCode, 9639 }, 9640 } 9641 target := &ret 9642 if err := gensupport.DecodeResponse(target, res); err != nil { 9643 return nil, err 9644 } 9645 return ret, nil 9646 // { 9647 // "description": "Join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 9648 // "httpMethod": "POST", 9649 // "id": "games.rooms.join", 9650 // "parameterOrder": [ 9651 // "roomId" 9652 // ], 9653 // "parameters": { 9654 // "language": { 9655 // "description": "The preferred language to use for strings returned by this method.", 9656 // "location": "query", 9657 // "type": "string" 9658 // }, 9659 // "roomId": { 9660 // "description": "The ID of the room.", 9661 // "location": "path", 9662 // "required": true, 9663 // "type": "string" 9664 // } 9665 // }, 9666 // "path": "rooms/{roomId}/join", 9667 // "request": { 9668 // "$ref": "RoomJoinRequest" 9669 // }, 9670 // "response": { 9671 // "$ref": "Room" 9672 // }, 9673 // "scopes": [ 9674 // "https://www.googleapis.com/auth/games" 9675 // ] 9676 // } 9677 9678} 9679 9680// method id "games.rooms.leave": 9681 9682type RoomsLeaveCall struct { 9683 s *Service 9684 roomId string 9685 roomleaverequest *RoomLeaveRequest 9686 urlParams_ gensupport.URLParams 9687 ctx_ context.Context 9688 header_ http.Header 9689} 9690 9691// Leave: Leave a room. For internal use by the Games SDK only. Calling 9692// this method directly is unsupported. 9693func (r *RoomsService) Leave(roomId string, roomleaverequest *RoomLeaveRequest) *RoomsLeaveCall { 9694 c := &RoomsLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9695 c.roomId = roomId 9696 c.roomleaverequest = roomleaverequest 9697 return c 9698} 9699 9700// Language sets the optional parameter "language": The preferred 9701// language to use for strings returned by this method. 9702func (c *RoomsLeaveCall) Language(language string) *RoomsLeaveCall { 9703 c.urlParams_.Set("language", language) 9704 return c 9705} 9706 9707// Fields allows partial responses to be retrieved. See 9708// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9709// for more information. 9710func (c *RoomsLeaveCall) Fields(s ...googleapi.Field) *RoomsLeaveCall { 9711 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9712 return c 9713} 9714 9715// Context sets the context to be used in this call's Do method. Any 9716// pending HTTP request will be aborted if the provided context is 9717// canceled. 9718func (c *RoomsLeaveCall) Context(ctx context.Context) *RoomsLeaveCall { 9719 c.ctx_ = ctx 9720 return c 9721} 9722 9723// Header returns an http.Header that can be modified by the caller to 9724// add HTTP headers to the request. 9725func (c *RoomsLeaveCall) Header() http.Header { 9726 if c.header_ == nil { 9727 c.header_ = make(http.Header) 9728 } 9729 return c.header_ 9730} 9731 9732func (c *RoomsLeaveCall) doRequest(alt string) (*http.Response, error) { 9733 reqHeaders := make(http.Header) 9734 for k, v := range c.header_ { 9735 reqHeaders[k] = v 9736 } 9737 reqHeaders.Set("User-Agent", c.s.userAgent()) 9738 var body io.Reader = nil 9739 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomleaverequest) 9740 if err != nil { 9741 return nil, err 9742 } 9743 reqHeaders.Set("Content-Type", "application/json") 9744 c.urlParams_.Set("alt", alt) 9745 c.urlParams_.Set("prettyPrint", "false") 9746 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/leave") 9747 urls += "?" + c.urlParams_.Encode() 9748 req, err := http.NewRequest("POST", urls, body) 9749 if err != nil { 9750 return nil, err 9751 } 9752 req.Header = reqHeaders 9753 googleapi.Expand(req.URL, map[string]string{ 9754 "roomId": c.roomId, 9755 }) 9756 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9757} 9758 9759// Do executes the "games.rooms.leave" call. 9760// Exactly one of *Room or error will be non-nil. Any non-2xx status 9761// code is an error. Response headers are in either 9762// *Room.ServerResponse.Header or (if a response was returned at all) in 9763// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9764// whether the returned error was because http.StatusNotModified was 9765// returned. 9766func (c *RoomsLeaveCall) Do(opts ...googleapi.CallOption) (*Room, error) { 9767 gensupport.SetOptions(c.urlParams_, opts...) 9768 res, err := c.doRequest("json") 9769 if res != nil && res.StatusCode == http.StatusNotModified { 9770 if res.Body != nil { 9771 res.Body.Close() 9772 } 9773 return nil, &googleapi.Error{ 9774 Code: res.StatusCode, 9775 Header: res.Header, 9776 } 9777 } 9778 if err != nil { 9779 return nil, err 9780 } 9781 defer googleapi.CloseBody(res) 9782 if err := googleapi.CheckResponse(res); err != nil { 9783 return nil, err 9784 } 9785 ret := &Room{ 9786 ServerResponse: googleapi.ServerResponse{ 9787 Header: res.Header, 9788 HTTPStatusCode: res.StatusCode, 9789 }, 9790 } 9791 target := &ret 9792 if err := gensupport.DecodeResponse(target, res); err != nil { 9793 return nil, err 9794 } 9795 return ret, nil 9796 // { 9797 // "description": "Leave a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 9798 // "httpMethod": "POST", 9799 // "id": "games.rooms.leave", 9800 // "parameterOrder": [ 9801 // "roomId" 9802 // ], 9803 // "parameters": { 9804 // "language": { 9805 // "description": "The preferred language to use for strings returned by this method.", 9806 // "location": "query", 9807 // "type": "string" 9808 // }, 9809 // "roomId": { 9810 // "description": "The ID of the room.", 9811 // "location": "path", 9812 // "required": true, 9813 // "type": "string" 9814 // } 9815 // }, 9816 // "path": "rooms/{roomId}/leave", 9817 // "request": { 9818 // "$ref": "RoomLeaveRequest" 9819 // }, 9820 // "response": { 9821 // "$ref": "Room" 9822 // }, 9823 // "scopes": [ 9824 // "https://www.googleapis.com/auth/games" 9825 // ] 9826 // } 9827 9828} 9829 9830// method id "games.rooms.list": 9831 9832type RoomsListCall struct { 9833 s *Service 9834 urlParams_ gensupport.URLParams 9835 ifNoneMatch_ string 9836 ctx_ context.Context 9837 header_ http.Header 9838} 9839 9840// List: Returns invitations to join rooms. 9841func (r *RoomsService) List() *RoomsListCall { 9842 c := &RoomsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9843 return c 9844} 9845 9846// Language sets the optional parameter "language": The preferred 9847// language to use for strings returned by this method. 9848func (c *RoomsListCall) Language(language string) *RoomsListCall { 9849 c.urlParams_.Set("language", language) 9850 return c 9851} 9852 9853// MaxResults sets the optional parameter "maxResults": The maximum 9854// number of rooms to return in the response, used for paging. For any 9855// response, the actual number of rooms to return may be less than the 9856// specified maxResults. 9857func (c *RoomsListCall) MaxResults(maxResults int64) *RoomsListCall { 9858 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9859 return c 9860} 9861 9862// PageToken sets the optional parameter "pageToken": The token returned 9863// by the previous request. 9864func (c *RoomsListCall) PageToken(pageToken string) *RoomsListCall { 9865 c.urlParams_.Set("pageToken", pageToken) 9866 return c 9867} 9868 9869// Fields allows partial responses to be retrieved. See 9870// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9871// for more information. 9872func (c *RoomsListCall) Fields(s ...googleapi.Field) *RoomsListCall { 9873 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9874 return c 9875} 9876 9877// IfNoneMatch sets the optional parameter which makes the operation 9878// fail if the object's ETag matches the given value. This is useful for 9879// getting updates only after the object has changed since the last 9880// request. Use googleapi.IsNotModified to check whether the response 9881// error from Do is the result of In-None-Match. 9882func (c *RoomsListCall) IfNoneMatch(entityTag string) *RoomsListCall { 9883 c.ifNoneMatch_ = entityTag 9884 return c 9885} 9886 9887// Context sets the context to be used in this call's Do method. Any 9888// pending HTTP request will be aborted if the provided context is 9889// canceled. 9890func (c *RoomsListCall) Context(ctx context.Context) *RoomsListCall { 9891 c.ctx_ = ctx 9892 return c 9893} 9894 9895// Header returns an http.Header that can be modified by the caller to 9896// add HTTP headers to the request. 9897func (c *RoomsListCall) Header() http.Header { 9898 if c.header_ == nil { 9899 c.header_ = make(http.Header) 9900 } 9901 return c.header_ 9902} 9903 9904func (c *RoomsListCall) doRequest(alt string) (*http.Response, error) { 9905 reqHeaders := make(http.Header) 9906 for k, v := range c.header_ { 9907 reqHeaders[k] = v 9908 } 9909 reqHeaders.Set("User-Agent", c.s.userAgent()) 9910 if c.ifNoneMatch_ != "" { 9911 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9912 } 9913 var body io.Reader = nil 9914 c.urlParams_.Set("alt", alt) 9915 c.urlParams_.Set("prettyPrint", "false") 9916 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms") 9917 urls += "?" + c.urlParams_.Encode() 9918 req, err := http.NewRequest("GET", urls, body) 9919 if err != nil { 9920 return nil, err 9921 } 9922 req.Header = reqHeaders 9923 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9924} 9925 9926// Do executes the "games.rooms.list" call. 9927// Exactly one of *RoomList or error will be non-nil. Any non-2xx status 9928// code is an error. Response headers are in either 9929// *RoomList.ServerResponse.Header or (if a response was returned at 9930// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9931// to check whether the returned error was because 9932// http.StatusNotModified was returned. 9933func (c *RoomsListCall) Do(opts ...googleapi.CallOption) (*RoomList, error) { 9934 gensupport.SetOptions(c.urlParams_, opts...) 9935 res, err := c.doRequest("json") 9936 if res != nil && res.StatusCode == http.StatusNotModified { 9937 if res.Body != nil { 9938 res.Body.Close() 9939 } 9940 return nil, &googleapi.Error{ 9941 Code: res.StatusCode, 9942 Header: res.Header, 9943 } 9944 } 9945 if err != nil { 9946 return nil, err 9947 } 9948 defer googleapi.CloseBody(res) 9949 if err := googleapi.CheckResponse(res); err != nil { 9950 return nil, err 9951 } 9952 ret := &RoomList{ 9953 ServerResponse: googleapi.ServerResponse{ 9954 Header: res.Header, 9955 HTTPStatusCode: res.StatusCode, 9956 }, 9957 } 9958 target := &ret 9959 if err := gensupport.DecodeResponse(target, res); err != nil { 9960 return nil, err 9961 } 9962 return ret, nil 9963 // { 9964 // "description": "Returns invitations to join rooms.", 9965 // "httpMethod": "GET", 9966 // "id": "games.rooms.list", 9967 // "parameters": { 9968 // "language": { 9969 // "description": "The preferred language to use for strings returned by this method.", 9970 // "location": "query", 9971 // "type": "string" 9972 // }, 9973 // "maxResults": { 9974 // "description": "The maximum number of rooms to return in the response, used for paging. For any response, the actual number of rooms to return may be less than the specified maxResults.", 9975 // "format": "int32", 9976 // "location": "query", 9977 // "maximum": "500", 9978 // "minimum": "1", 9979 // "type": "integer" 9980 // }, 9981 // "pageToken": { 9982 // "description": "The token returned by the previous request.", 9983 // "location": "query", 9984 // "type": "string" 9985 // } 9986 // }, 9987 // "path": "rooms", 9988 // "response": { 9989 // "$ref": "RoomList" 9990 // }, 9991 // "scopes": [ 9992 // "https://www.googleapis.com/auth/games" 9993 // ] 9994 // } 9995 9996} 9997 9998// Pages invokes f for each page of results. 9999// A non-nil error returned from f will halt the iteration. 10000// The provided context supersedes any context provided to the Context method. 10001func (c *RoomsListCall) Pages(ctx context.Context, f func(*RoomList) error) error { 10002 c.ctx_ = ctx 10003 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10004 for { 10005 x, err := c.Do() 10006 if err != nil { 10007 return err 10008 } 10009 if err := f(x); err != nil { 10010 return err 10011 } 10012 if x.NextPageToken == "" { 10013 return nil 10014 } 10015 c.PageToken(x.NextPageToken) 10016 } 10017} 10018 10019// method id "games.rooms.reportStatus": 10020 10021type RoomsReportStatusCall struct { 10022 s *Service 10023 roomId string 10024 roomp2pstatuses *RoomP2PStatuses 10025 urlParams_ gensupport.URLParams 10026 ctx_ context.Context 10027 header_ http.Header 10028} 10029 10030// ReportStatus: Updates sent by a client reporting the status of peers 10031// in a room. For internal use by the Games SDK only. Calling this 10032// method directly is unsupported. 10033func (r *RoomsService) ReportStatus(roomId string, roomp2pstatuses *RoomP2PStatuses) *RoomsReportStatusCall { 10034 c := &RoomsReportStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10035 c.roomId = roomId 10036 c.roomp2pstatuses = roomp2pstatuses 10037 return c 10038} 10039 10040// Language sets the optional parameter "language": The preferred 10041// language to use for strings returned by this method. 10042func (c *RoomsReportStatusCall) Language(language string) *RoomsReportStatusCall { 10043 c.urlParams_.Set("language", language) 10044 return c 10045} 10046 10047// Fields allows partial responses to be retrieved. See 10048// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10049// for more information. 10050func (c *RoomsReportStatusCall) Fields(s ...googleapi.Field) *RoomsReportStatusCall { 10051 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10052 return c 10053} 10054 10055// Context sets the context to be used in this call's Do method. Any 10056// pending HTTP request will be aborted if the provided context is 10057// canceled. 10058func (c *RoomsReportStatusCall) Context(ctx context.Context) *RoomsReportStatusCall { 10059 c.ctx_ = ctx 10060 return c 10061} 10062 10063// Header returns an http.Header that can be modified by the caller to 10064// add HTTP headers to the request. 10065func (c *RoomsReportStatusCall) Header() http.Header { 10066 if c.header_ == nil { 10067 c.header_ = make(http.Header) 10068 } 10069 return c.header_ 10070} 10071 10072func (c *RoomsReportStatusCall) doRequest(alt string) (*http.Response, error) { 10073 reqHeaders := make(http.Header) 10074 for k, v := range c.header_ { 10075 reqHeaders[k] = v 10076 } 10077 reqHeaders.Set("User-Agent", c.s.userAgent()) 10078 var body io.Reader = nil 10079 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomp2pstatuses) 10080 if err != nil { 10081 return nil, err 10082 } 10083 reqHeaders.Set("Content-Type", "application/json") 10084 c.urlParams_.Set("alt", alt) 10085 c.urlParams_.Set("prettyPrint", "false") 10086 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/reportstatus") 10087 urls += "?" + c.urlParams_.Encode() 10088 req, err := http.NewRequest("POST", urls, body) 10089 if err != nil { 10090 return nil, err 10091 } 10092 req.Header = reqHeaders 10093 googleapi.Expand(req.URL, map[string]string{ 10094 "roomId": c.roomId, 10095 }) 10096 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10097} 10098 10099// Do executes the "games.rooms.reportStatus" call. 10100// Exactly one of *RoomStatus or error will be non-nil. Any non-2xx 10101// status code is an error. Response headers are in either 10102// *RoomStatus.ServerResponse.Header or (if a response was returned at 10103// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10104// to check whether the returned error was because 10105// http.StatusNotModified was returned. 10106func (c *RoomsReportStatusCall) Do(opts ...googleapi.CallOption) (*RoomStatus, error) { 10107 gensupport.SetOptions(c.urlParams_, opts...) 10108 res, err := c.doRequest("json") 10109 if res != nil && res.StatusCode == http.StatusNotModified { 10110 if res.Body != nil { 10111 res.Body.Close() 10112 } 10113 return nil, &googleapi.Error{ 10114 Code: res.StatusCode, 10115 Header: res.Header, 10116 } 10117 } 10118 if err != nil { 10119 return nil, err 10120 } 10121 defer googleapi.CloseBody(res) 10122 if err := googleapi.CheckResponse(res); err != nil { 10123 return nil, err 10124 } 10125 ret := &RoomStatus{ 10126 ServerResponse: googleapi.ServerResponse{ 10127 Header: res.Header, 10128 HTTPStatusCode: res.StatusCode, 10129 }, 10130 } 10131 target := &ret 10132 if err := gensupport.DecodeResponse(target, res); err != nil { 10133 return nil, err 10134 } 10135 return ret, nil 10136 // { 10137 // "description": "Updates sent by a client reporting the status of peers in a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 10138 // "httpMethod": "POST", 10139 // "id": "games.rooms.reportStatus", 10140 // "parameterOrder": [ 10141 // "roomId" 10142 // ], 10143 // "parameters": { 10144 // "language": { 10145 // "description": "The preferred language to use for strings returned by this method.", 10146 // "location": "query", 10147 // "type": "string" 10148 // }, 10149 // "roomId": { 10150 // "description": "The ID of the room.", 10151 // "location": "path", 10152 // "required": true, 10153 // "type": "string" 10154 // } 10155 // }, 10156 // "path": "rooms/{roomId}/reportstatus", 10157 // "request": { 10158 // "$ref": "RoomP2PStatuses" 10159 // }, 10160 // "response": { 10161 // "$ref": "RoomStatus" 10162 // }, 10163 // "scopes": [ 10164 // "https://www.googleapis.com/auth/games" 10165 // ] 10166 // } 10167 10168} 10169 10170// method id "games.scores.get": 10171 10172type ScoresGetCall struct { 10173 s *Service 10174 playerId string 10175 leaderboardId string 10176 timeSpan string 10177 urlParams_ gensupport.URLParams 10178 ifNoneMatch_ string 10179 ctx_ context.Context 10180 header_ http.Header 10181} 10182 10183// Get: Get high scores, and optionally ranks, in leaderboards for the 10184// currently authenticated player. For a specific time span, 10185// leaderboardId can be set to ALL to retrieve data for all leaderboards 10186// in a given time span. 10187// NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in 10188// the same request; only one parameter may be set to 'ALL'. 10189func (r *ScoresService) Get(playerId string, leaderboardId string, timeSpan string) *ScoresGetCall { 10190 c := &ScoresGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10191 c.playerId = playerId 10192 c.leaderboardId = leaderboardId 10193 c.timeSpan = timeSpan 10194 return c 10195} 10196 10197// IncludeRankType sets the optional parameter "includeRankType": The 10198// types of ranks to return. If the parameter is omitted, no ranks will 10199// be returned. 10200// 10201// Possible values: 10202// "ALL" - Retrieve public and social ranks. 10203// "PUBLIC" - Retrieve public ranks, if the player is sharing their 10204// gameplay activity publicly. 10205// "SOCIAL" - Retrieve the social rank. 10206func (c *ScoresGetCall) IncludeRankType(includeRankType string) *ScoresGetCall { 10207 c.urlParams_.Set("includeRankType", includeRankType) 10208 return c 10209} 10210 10211// Language sets the optional parameter "language": The preferred 10212// language to use for strings returned by this method. 10213func (c *ScoresGetCall) Language(language string) *ScoresGetCall { 10214 c.urlParams_.Set("language", language) 10215 return c 10216} 10217 10218// MaxResults sets the optional parameter "maxResults": The maximum 10219// number of leaderboard scores to return in the response. For any 10220// response, the actual number of leaderboard scores returned may be 10221// less than the specified maxResults. 10222func (c *ScoresGetCall) MaxResults(maxResults int64) *ScoresGetCall { 10223 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10224 return c 10225} 10226 10227// PageToken sets the optional parameter "pageToken": The token returned 10228// by the previous request. 10229func (c *ScoresGetCall) PageToken(pageToken string) *ScoresGetCall { 10230 c.urlParams_.Set("pageToken", pageToken) 10231 return c 10232} 10233 10234// Fields allows partial responses to be retrieved. See 10235// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10236// for more information. 10237func (c *ScoresGetCall) Fields(s ...googleapi.Field) *ScoresGetCall { 10238 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10239 return c 10240} 10241 10242// IfNoneMatch sets the optional parameter which makes the operation 10243// fail if the object's ETag matches the given value. This is useful for 10244// getting updates only after the object has changed since the last 10245// request. Use googleapi.IsNotModified to check whether the response 10246// error from Do is the result of In-None-Match. 10247func (c *ScoresGetCall) IfNoneMatch(entityTag string) *ScoresGetCall { 10248 c.ifNoneMatch_ = entityTag 10249 return c 10250} 10251 10252// Context sets the context to be used in this call's Do method. Any 10253// pending HTTP request will be aborted if the provided context is 10254// canceled. 10255func (c *ScoresGetCall) Context(ctx context.Context) *ScoresGetCall { 10256 c.ctx_ = ctx 10257 return c 10258} 10259 10260// Header returns an http.Header that can be modified by the caller to 10261// add HTTP headers to the request. 10262func (c *ScoresGetCall) Header() http.Header { 10263 if c.header_ == nil { 10264 c.header_ = make(http.Header) 10265 } 10266 return c.header_ 10267} 10268 10269func (c *ScoresGetCall) doRequest(alt string) (*http.Response, error) { 10270 reqHeaders := make(http.Header) 10271 for k, v := range c.header_ { 10272 reqHeaders[k] = v 10273 } 10274 reqHeaders.Set("User-Agent", c.s.userAgent()) 10275 if c.ifNoneMatch_ != "" { 10276 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10277 } 10278 var body io.Reader = nil 10279 c.urlParams_.Set("alt", alt) 10280 c.urlParams_.Set("prettyPrint", "false") 10281 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}") 10282 urls += "?" + c.urlParams_.Encode() 10283 req, err := http.NewRequest("GET", urls, body) 10284 if err != nil { 10285 return nil, err 10286 } 10287 req.Header = reqHeaders 10288 googleapi.Expand(req.URL, map[string]string{ 10289 "playerId": c.playerId, 10290 "leaderboardId": c.leaderboardId, 10291 "timeSpan": c.timeSpan, 10292 }) 10293 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10294} 10295 10296// Do executes the "games.scores.get" call. 10297// Exactly one of *PlayerLeaderboardScoreListResponse or error will be 10298// non-nil. Any non-2xx status code is an error. Response headers are in 10299// either *PlayerLeaderboardScoreListResponse.ServerResponse.Header or 10300// (if a response was returned at all) in 10301// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10302// whether the returned error was because http.StatusNotModified was 10303// returned. 10304func (c *ScoresGetCall) Do(opts ...googleapi.CallOption) (*PlayerLeaderboardScoreListResponse, error) { 10305 gensupport.SetOptions(c.urlParams_, opts...) 10306 res, err := c.doRequest("json") 10307 if res != nil && res.StatusCode == http.StatusNotModified { 10308 if res.Body != nil { 10309 res.Body.Close() 10310 } 10311 return nil, &googleapi.Error{ 10312 Code: res.StatusCode, 10313 Header: res.Header, 10314 } 10315 } 10316 if err != nil { 10317 return nil, err 10318 } 10319 defer googleapi.CloseBody(res) 10320 if err := googleapi.CheckResponse(res); err != nil { 10321 return nil, err 10322 } 10323 ret := &PlayerLeaderboardScoreListResponse{ 10324 ServerResponse: googleapi.ServerResponse{ 10325 Header: res.Header, 10326 HTTPStatusCode: res.StatusCode, 10327 }, 10328 } 10329 target := &ret 10330 if err := gensupport.DecodeResponse(target, res); err != nil { 10331 return nil, err 10332 } 10333 return ret, nil 10334 // { 10335 // "description": "Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span.\nNOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'.", 10336 // "httpMethod": "GET", 10337 // "id": "games.scores.get", 10338 // "parameterOrder": [ 10339 // "playerId", 10340 // "leaderboardId", 10341 // "timeSpan" 10342 // ], 10343 // "parameters": { 10344 // "includeRankType": { 10345 // "description": "The types of ranks to return. If the parameter is omitted, no ranks will be returned.", 10346 // "enum": [ 10347 // "ALL", 10348 // "PUBLIC", 10349 // "SOCIAL" 10350 // ], 10351 // "enumDescriptions": [ 10352 // "Retrieve public and social ranks.", 10353 // "Retrieve public ranks, if the player is sharing their gameplay activity publicly.", 10354 // "Retrieve the social rank." 10355 // ], 10356 // "location": "query", 10357 // "type": "string" 10358 // }, 10359 // "language": { 10360 // "description": "The preferred language to use for strings returned by this method.", 10361 // "location": "query", 10362 // "type": "string" 10363 // }, 10364 // "leaderboardId": { 10365 // "description": "The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.", 10366 // "location": "path", 10367 // "required": true, 10368 // "type": "string" 10369 // }, 10370 // "maxResults": { 10371 // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", 10372 // "format": "int32", 10373 // "location": "query", 10374 // "maximum": "30", 10375 // "minimum": "1", 10376 // "type": "integer" 10377 // }, 10378 // "pageToken": { 10379 // "description": "The token returned by the previous request.", 10380 // "location": "query", 10381 // "type": "string" 10382 // }, 10383 // "playerId": { 10384 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 10385 // "location": "path", 10386 // "required": true, 10387 // "type": "string" 10388 // }, 10389 // "timeSpan": { 10390 // "description": "The time span for the scores and ranks you're requesting.", 10391 // "enum": [ 10392 // "ALL", 10393 // "ALL_TIME", 10394 // "DAILY", 10395 // "WEEKLY" 10396 // ], 10397 // "enumDescriptions": [ 10398 // "Get the high scores for all time spans. If this is used, maxResults values will be ignored.", 10399 // "Get the all time high score.", 10400 // "List the top scores for the current day.", 10401 // "List the top scores for the current week." 10402 // ], 10403 // "location": "path", 10404 // "required": true, 10405 // "type": "string" 10406 // } 10407 // }, 10408 // "path": "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}", 10409 // "response": { 10410 // "$ref": "PlayerLeaderboardScoreListResponse" 10411 // }, 10412 // "scopes": [ 10413 // "https://www.googleapis.com/auth/games" 10414 // ] 10415 // } 10416 10417} 10418 10419// Pages invokes f for each page of results. 10420// A non-nil error returned from f will halt the iteration. 10421// The provided context supersedes any context provided to the Context method. 10422func (c *ScoresGetCall) Pages(ctx context.Context, f func(*PlayerLeaderboardScoreListResponse) error) error { 10423 c.ctx_ = ctx 10424 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10425 for { 10426 x, err := c.Do() 10427 if err != nil { 10428 return err 10429 } 10430 if err := f(x); err != nil { 10431 return err 10432 } 10433 if x.NextPageToken == "" { 10434 return nil 10435 } 10436 c.PageToken(x.NextPageToken) 10437 } 10438} 10439 10440// method id "games.scores.list": 10441 10442type ScoresListCall struct { 10443 s *Service 10444 leaderboardId string 10445 collection string 10446 urlParams_ gensupport.URLParams 10447 ifNoneMatch_ string 10448 ctx_ context.Context 10449 header_ http.Header 10450} 10451 10452// List: Lists the scores in a leaderboard, starting from the top. 10453func (r *ScoresService) List(leaderboardId string, collection string, timeSpan string) *ScoresListCall { 10454 c := &ScoresListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10455 c.leaderboardId = leaderboardId 10456 c.collection = collection 10457 c.urlParams_.Set("timeSpan", timeSpan) 10458 return c 10459} 10460 10461// Language sets the optional parameter "language": The preferred 10462// language to use for strings returned by this method. 10463func (c *ScoresListCall) Language(language string) *ScoresListCall { 10464 c.urlParams_.Set("language", language) 10465 return c 10466} 10467 10468// MaxResults sets the optional parameter "maxResults": The maximum 10469// number of leaderboard scores to return in the response. For any 10470// response, the actual number of leaderboard scores returned may be 10471// less than the specified maxResults. 10472func (c *ScoresListCall) MaxResults(maxResults int64) *ScoresListCall { 10473 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10474 return c 10475} 10476 10477// PageToken sets the optional parameter "pageToken": The token returned 10478// by the previous request. 10479func (c *ScoresListCall) PageToken(pageToken string) *ScoresListCall { 10480 c.urlParams_.Set("pageToken", pageToken) 10481 return c 10482} 10483 10484// Fields allows partial responses to be retrieved. See 10485// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10486// for more information. 10487func (c *ScoresListCall) Fields(s ...googleapi.Field) *ScoresListCall { 10488 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10489 return c 10490} 10491 10492// IfNoneMatch sets the optional parameter which makes the operation 10493// fail if the object's ETag matches the given value. This is useful for 10494// getting updates only after the object has changed since the last 10495// request. Use googleapi.IsNotModified to check whether the response 10496// error from Do is the result of In-None-Match. 10497func (c *ScoresListCall) IfNoneMatch(entityTag string) *ScoresListCall { 10498 c.ifNoneMatch_ = entityTag 10499 return c 10500} 10501 10502// Context sets the context to be used in this call's Do method. Any 10503// pending HTTP request will be aborted if the provided context is 10504// canceled. 10505func (c *ScoresListCall) Context(ctx context.Context) *ScoresListCall { 10506 c.ctx_ = ctx 10507 return c 10508} 10509 10510// Header returns an http.Header that can be modified by the caller to 10511// add HTTP headers to the request. 10512func (c *ScoresListCall) Header() http.Header { 10513 if c.header_ == nil { 10514 c.header_ = make(http.Header) 10515 } 10516 return c.header_ 10517} 10518 10519func (c *ScoresListCall) doRequest(alt string) (*http.Response, error) { 10520 reqHeaders := make(http.Header) 10521 for k, v := range c.header_ { 10522 reqHeaders[k] = v 10523 } 10524 reqHeaders.Set("User-Agent", c.s.userAgent()) 10525 if c.ifNoneMatch_ != "" { 10526 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10527 } 10528 var body io.Reader = nil 10529 c.urlParams_.Set("alt", alt) 10530 c.urlParams_.Set("prettyPrint", "false") 10531 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/{collection}") 10532 urls += "?" + c.urlParams_.Encode() 10533 req, err := http.NewRequest("GET", urls, body) 10534 if err != nil { 10535 return nil, err 10536 } 10537 req.Header = reqHeaders 10538 googleapi.Expand(req.URL, map[string]string{ 10539 "leaderboardId": c.leaderboardId, 10540 "collection": c.collection, 10541 }) 10542 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10543} 10544 10545// Do executes the "games.scores.list" call. 10546// Exactly one of *LeaderboardScores or error will be non-nil. Any 10547// non-2xx status code is an error. Response headers are in either 10548// *LeaderboardScores.ServerResponse.Header or (if a response was 10549// returned at all) in error.(*googleapi.Error).Header. Use 10550// googleapi.IsNotModified to check whether the returned error was 10551// because http.StatusNotModified was returned. 10552func (c *ScoresListCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) { 10553 gensupport.SetOptions(c.urlParams_, opts...) 10554 res, err := c.doRequest("json") 10555 if res != nil && res.StatusCode == http.StatusNotModified { 10556 if res.Body != nil { 10557 res.Body.Close() 10558 } 10559 return nil, &googleapi.Error{ 10560 Code: res.StatusCode, 10561 Header: res.Header, 10562 } 10563 } 10564 if err != nil { 10565 return nil, err 10566 } 10567 defer googleapi.CloseBody(res) 10568 if err := googleapi.CheckResponse(res); err != nil { 10569 return nil, err 10570 } 10571 ret := &LeaderboardScores{ 10572 ServerResponse: googleapi.ServerResponse{ 10573 Header: res.Header, 10574 HTTPStatusCode: res.StatusCode, 10575 }, 10576 } 10577 target := &ret 10578 if err := gensupport.DecodeResponse(target, res); err != nil { 10579 return nil, err 10580 } 10581 return ret, nil 10582 // { 10583 // "description": "Lists the scores in a leaderboard, starting from the top.", 10584 // "httpMethod": "GET", 10585 // "id": "games.scores.list", 10586 // "parameterOrder": [ 10587 // "leaderboardId", 10588 // "collection", 10589 // "timeSpan" 10590 // ], 10591 // "parameters": { 10592 // "collection": { 10593 // "description": "The collection of scores you're requesting.", 10594 // "enum": [ 10595 // "PUBLIC", 10596 // "SOCIAL", 10597 // "SOCIAL_1P" 10598 // ], 10599 // "enumDescriptions": [ 10600 // "List all scores in the public leaderboard.", 10601 // "List only social scores.", 10602 // "List only social scores, not respecting the fACL." 10603 // ], 10604 // "location": "path", 10605 // "required": true, 10606 // "type": "string" 10607 // }, 10608 // "language": { 10609 // "description": "The preferred language to use for strings returned by this method.", 10610 // "location": "query", 10611 // "type": "string" 10612 // }, 10613 // "leaderboardId": { 10614 // "description": "The ID of the leaderboard.", 10615 // "location": "path", 10616 // "required": true, 10617 // "type": "string" 10618 // }, 10619 // "maxResults": { 10620 // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", 10621 // "format": "int32", 10622 // "location": "query", 10623 // "maximum": "30", 10624 // "minimum": "1", 10625 // "type": "integer" 10626 // }, 10627 // "pageToken": { 10628 // "description": "The token returned by the previous request.", 10629 // "location": "query", 10630 // "type": "string" 10631 // }, 10632 // "timeSpan": { 10633 // "description": "The time span for the scores and ranks you're requesting.", 10634 // "enum": [ 10635 // "ALL_TIME", 10636 // "DAILY", 10637 // "WEEKLY" 10638 // ], 10639 // "enumDescriptions": [ 10640 // "List the all-time top scores.", 10641 // "List the top scores for the current day.", 10642 // "List the top scores for the current week." 10643 // ], 10644 // "location": "query", 10645 // "required": true, 10646 // "type": "string" 10647 // } 10648 // }, 10649 // "path": "leaderboards/{leaderboardId}/scores/{collection}", 10650 // "response": { 10651 // "$ref": "LeaderboardScores" 10652 // }, 10653 // "scopes": [ 10654 // "https://www.googleapis.com/auth/games" 10655 // ] 10656 // } 10657 10658} 10659 10660// Pages invokes f for each page of results. 10661// A non-nil error returned from f will halt the iteration. 10662// The provided context supersedes any context provided to the Context method. 10663func (c *ScoresListCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error { 10664 c.ctx_ = ctx 10665 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10666 for { 10667 x, err := c.Do() 10668 if err != nil { 10669 return err 10670 } 10671 if err := f(x); err != nil { 10672 return err 10673 } 10674 if x.NextPageToken == "" { 10675 return nil 10676 } 10677 c.PageToken(x.NextPageToken) 10678 } 10679} 10680 10681// method id "games.scores.listWindow": 10682 10683type ScoresListWindowCall struct { 10684 s *Service 10685 leaderboardId string 10686 collection string 10687 urlParams_ gensupport.URLParams 10688 ifNoneMatch_ string 10689 ctx_ context.Context 10690 header_ http.Header 10691} 10692 10693// ListWindow: Lists the scores in a leaderboard around (and including) 10694// a player's score. 10695func (r *ScoresService) ListWindow(leaderboardId string, collection string, timeSpan string) *ScoresListWindowCall { 10696 c := &ScoresListWindowCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10697 c.leaderboardId = leaderboardId 10698 c.collection = collection 10699 c.urlParams_.Set("timeSpan", timeSpan) 10700 return c 10701} 10702 10703// Language sets the optional parameter "language": The preferred 10704// language to use for strings returned by this method. 10705func (c *ScoresListWindowCall) Language(language string) *ScoresListWindowCall { 10706 c.urlParams_.Set("language", language) 10707 return c 10708} 10709 10710// MaxResults sets the optional parameter "maxResults": The maximum 10711// number of leaderboard scores to return in the response. For any 10712// response, the actual number of leaderboard scores returned may be 10713// less than the specified maxResults. 10714func (c *ScoresListWindowCall) MaxResults(maxResults int64) *ScoresListWindowCall { 10715 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10716 return c 10717} 10718 10719// PageToken sets the optional parameter "pageToken": The token returned 10720// by the previous request. 10721func (c *ScoresListWindowCall) PageToken(pageToken string) *ScoresListWindowCall { 10722 c.urlParams_.Set("pageToken", pageToken) 10723 return c 10724} 10725 10726// ResultsAbove sets the optional parameter "resultsAbove": The 10727// preferred number of scores to return above the player's score. More 10728// scores may be returned if the player is at the bottom of the 10729// leaderboard; fewer may be returned if the player is at the top. Must 10730// be less than or equal to maxResults. 10731func (c *ScoresListWindowCall) ResultsAbove(resultsAbove int64) *ScoresListWindowCall { 10732 c.urlParams_.Set("resultsAbove", fmt.Sprint(resultsAbove)) 10733 return c 10734} 10735 10736// ReturnTopIfAbsent sets the optional parameter "returnTopIfAbsent": 10737// True if the top scores should be returned when the player is not in 10738// the leaderboard. Defaults to true. 10739func (c *ScoresListWindowCall) ReturnTopIfAbsent(returnTopIfAbsent bool) *ScoresListWindowCall { 10740 c.urlParams_.Set("returnTopIfAbsent", fmt.Sprint(returnTopIfAbsent)) 10741 return c 10742} 10743 10744// Fields allows partial responses to be retrieved. See 10745// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10746// for more information. 10747func (c *ScoresListWindowCall) Fields(s ...googleapi.Field) *ScoresListWindowCall { 10748 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10749 return c 10750} 10751 10752// IfNoneMatch sets the optional parameter which makes the operation 10753// fail if the object's ETag matches the given value. This is useful for 10754// getting updates only after the object has changed since the last 10755// request. Use googleapi.IsNotModified to check whether the response 10756// error from Do is the result of In-None-Match. 10757func (c *ScoresListWindowCall) IfNoneMatch(entityTag string) *ScoresListWindowCall { 10758 c.ifNoneMatch_ = entityTag 10759 return c 10760} 10761 10762// Context sets the context to be used in this call's Do method. Any 10763// pending HTTP request will be aborted if the provided context is 10764// canceled. 10765func (c *ScoresListWindowCall) Context(ctx context.Context) *ScoresListWindowCall { 10766 c.ctx_ = ctx 10767 return c 10768} 10769 10770// Header returns an http.Header that can be modified by the caller to 10771// add HTTP headers to the request. 10772func (c *ScoresListWindowCall) Header() http.Header { 10773 if c.header_ == nil { 10774 c.header_ = make(http.Header) 10775 } 10776 return c.header_ 10777} 10778 10779func (c *ScoresListWindowCall) doRequest(alt string) (*http.Response, error) { 10780 reqHeaders := make(http.Header) 10781 for k, v := range c.header_ { 10782 reqHeaders[k] = v 10783 } 10784 reqHeaders.Set("User-Agent", c.s.userAgent()) 10785 if c.ifNoneMatch_ != "" { 10786 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10787 } 10788 var body io.Reader = nil 10789 c.urlParams_.Set("alt", alt) 10790 c.urlParams_.Set("prettyPrint", "false") 10791 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/window/{collection}") 10792 urls += "?" + c.urlParams_.Encode() 10793 req, err := http.NewRequest("GET", urls, body) 10794 if err != nil { 10795 return nil, err 10796 } 10797 req.Header = reqHeaders 10798 googleapi.Expand(req.URL, map[string]string{ 10799 "leaderboardId": c.leaderboardId, 10800 "collection": c.collection, 10801 }) 10802 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10803} 10804 10805// Do executes the "games.scores.listWindow" call. 10806// Exactly one of *LeaderboardScores or error will be non-nil. Any 10807// non-2xx status code is an error. Response headers are in either 10808// *LeaderboardScores.ServerResponse.Header or (if a response was 10809// returned at all) in error.(*googleapi.Error).Header. Use 10810// googleapi.IsNotModified to check whether the returned error was 10811// because http.StatusNotModified was returned. 10812func (c *ScoresListWindowCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) { 10813 gensupport.SetOptions(c.urlParams_, opts...) 10814 res, err := c.doRequest("json") 10815 if res != nil && res.StatusCode == http.StatusNotModified { 10816 if res.Body != nil { 10817 res.Body.Close() 10818 } 10819 return nil, &googleapi.Error{ 10820 Code: res.StatusCode, 10821 Header: res.Header, 10822 } 10823 } 10824 if err != nil { 10825 return nil, err 10826 } 10827 defer googleapi.CloseBody(res) 10828 if err := googleapi.CheckResponse(res); err != nil { 10829 return nil, err 10830 } 10831 ret := &LeaderboardScores{ 10832 ServerResponse: googleapi.ServerResponse{ 10833 Header: res.Header, 10834 HTTPStatusCode: res.StatusCode, 10835 }, 10836 } 10837 target := &ret 10838 if err := gensupport.DecodeResponse(target, res); err != nil { 10839 return nil, err 10840 } 10841 return ret, nil 10842 // { 10843 // "description": "Lists the scores in a leaderboard around (and including) a player's score.", 10844 // "httpMethod": "GET", 10845 // "id": "games.scores.listWindow", 10846 // "parameterOrder": [ 10847 // "leaderboardId", 10848 // "collection", 10849 // "timeSpan" 10850 // ], 10851 // "parameters": { 10852 // "collection": { 10853 // "description": "The collection of scores you're requesting.", 10854 // "enum": [ 10855 // "PUBLIC", 10856 // "SOCIAL", 10857 // "SOCIAL_1P" 10858 // ], 10859 // "enumDescriptions": [ 10860 // "List all scores in the public leaderboard.", 10861 // "List only social scores.", 10862 // "List only social scores, not respecting the fACL." 10863 // ], 10864 // "location": "path", 10865 // "required": true, 10866 // "type": "string" 10867 // }, 10868 // "language": { 10869 // "description": "The preferred language to use for strings returned by this method.", 10870 // "location": "query", 10871 // "type": "string" 10872 // }, 10873 // "leaderboardId": { 10874 // "description": "The ID of the leaderboard.", 10875 // "location": "path", 10876 // "required": true, 10877 // "type": "string" 10878 // }, 10879 // "maxResults": { 10880 // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.", 10881 // "format": "int32", 10882 // "location": "query", 10883 // "maximum": "30", 10884 // "minimum": "1", 10885 // "type": "integer" 10886 // }, 10887 // "pageToken": { 10888 // "description": "The token returned by the previous request.", 10889 // "location": "query", 10890 // "type": "string" 10891 // }, 10892 // "resultsAbove": { 10893 // "description": "The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults.", 10894 // "format": "int32", 10895 // "location": "query", 10896 // "type": "integer" 10897 // }, 10898 // "returnTopIfAbsent": { 10899 // "description": "True if the top scores should be returned when the player is not in the leaderboard. Defaults to true.", 10900 // "location": "query", 10901 // "type": "boolean" 10902 // }, 10903 // "timeSpan": { 10904 // "description": "The time span for the scores and ranks you're requesting.", 10905 // "enum": [ 10906 // "ALL_TIME", 10907 // "DAILY", 10908 // "WEEKLY" 10909 // ], 10910 // "enumDescriptions": [ 10911 // "List the all-time top scores.", 10912 // "List the top scores for the current day.", 10913 // "List the top scores for the current week." 10914 // ], 10915 // "location": "query", 10916 // "required": true, 10917 // "type": "string" 10918 // } 10919 // }, 10920 // "path": "leaderboards/{leaderboardId}/window/{collection}", 10921 // "response": { 10922 // "$ref": "LeaderboardScores" 10923 // }, 10924 // "scopes": [ 10925 // "https://www.googleapis.com/auth/games" 10926 // ] 10927 // } 10928 10929} 10930 10931// Pages invokes f for each page of results. 10932// A non-nil error returned from f will halt the iteration. 10933// The provided context supersedes any context provided to the Context method. 10934func (c *ScoresListWindowCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error { 10935 c.ctx_ = ctx 10936 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10937 for { 10938 x, err := c.Do() 10939 if err != nil { 10940 return err 10941 } 10942 if err := f(x); err != nil { 10943 return err 10944 } 10945 if x.NextPageToken == "" { 10946 return nil 10947 } 10948 c.PageToken(x.NextPageToken) 10949 } 10950} 10951 10952// method id "games.scores.submit": 10953 10954type ScoresSubmitCall struct { 10955 s *Service 10956 leaderboardId string 10957 urlParams_ gensupport.URLParams 10958 ctx_ context.Context 10959 header_ http.Header 10960} 10961 10962// Submit: Submits a score to the specified leaderboard. 10963func (r *ScoresService) Submit(leaderboardId string, score int64) *ScoresSubmitCall { 10964 c := &ScoresSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10965 c.leaderboardId = leaderboardId 10966 c.urlParams_.Set("score", fmt.Sprint(score)) 10967 return c 10968} 10969 10970// Language sets the optional parameter "language": The preferred 10971// language to use for strings returned by this method. 10972func (c *ScoresSubmitCall) Language(language string) *ScoresSubmitCall { 10973 c.urlParams_.Set("language", language) 10974 return c 10975} 10976 10977// ScoreTag sets the optional parameter "scoreTag": Additional 10978// information about the score you're submitting. Values must contain no 10979// more than 64 URI-safe characters as defined by section 2.3 of RFC 10980// 3986. 10981func (c *ScoresSubmitCall) ScoreTag(scoreTag string) *ScoresSubmitCall { 10982 c.urlParams_.Set("scoreTag", scoreTag) 10983 return c 10984} 10985 10986// Fields allows partial responses to be retrieved. See 10987// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10988// for more information. 10989func (c *ScoresSubmitCall) Fields(s ...googleapi.Field) *ScoresSubmitCall { 10990 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10991 return c 10992} 10993 10994// Context sets the context to be used in this call's Do method. Any 10995// pending HTTP request will be aborted if the provided context is 10996// canceled. 10997func (c *ScoresSubmitCall) Context(ctx context.Context) *ScoresSubmitCall { 10998 c.ctx_ = ctx 10999 return c 11000} 11001 11002// Header returns an http.Header that can be modified by the caller to 11003// add HTTP headers to the request. 11004func (c *ScoresSubmitCall) Header() http.Header { 11005 if c.header_ == nil { 11006 c.header_ = make(http.Header) 11007 } 11008 return c.header_ 11009} 11010 11011func (c *ScoresSubmitCall) doRequest(alt string) (*http.Response, error) { 11012 reqHeaders := make(http.Header) 11013 for k, v := range c.header_ { 11014 reqHeaders[k] = v 11015 } 11016 reqHeaders.Set("User-Agent", c.s.userAgent()) 11017 var body io.Reader = nil 11018 c.urlParams_.Set("alt", alt) 11019 c.urlParams_.Set("prettyPrint", "false") 11020 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores") 11021 urls += "?" + c.urlParams_.Encode() 11022 req, err := http.NewRequest("POST", urls, body) 11023 if err != nil { 11024 return nil, err 11025 } 11026 req.Header = reqHeaders 11027 googleapi.Expand(req.URL, map[string]string{ 11028 "leaderboardId": c.leaderboardId, 11029 }) 11030 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11031} 11032 11033// Do executes the "games.scores.submit" call. 11034// Exactly one of *PlayerScoreResponse or error will be non-nil. Any 11035// non-2xx status code is an error. Response headers are in either 11036// *PlayerScoreResponse.ServerResponse.Header or (if a response was 11037// returned at all) in error.(*googleapi.Error).Header. Use 11038// googleapi.IsNotModified to check whether the returned error was 11039// because http.StatusNotModified was returned. 11040func (c *ScoresSubmitCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResponse, error) { 11041 gensupport.SetOptions(c.urlParams_, opts...) 11042 res, err := c.doRequest("json") 11043 if res != nil && res.StatusCode == http.StatusNotModified { 11044 if res.Body != nil { 11045 res.Body.Close() 11046 } 11047 return nil, &googleapi.Error{ 11048 Code: res.StatusCode, 11049 Header: res.Header, 11050 } 11051 } 11052 if err != nil { 11053 return nil, err 11054 } 11055 defer googleapi.CloseBody(res) 11056 if err := googleapi.CheckResponse(res); err != nil { 11057 return nil, err 11058 } 11059 ret := &PlayerScoreResponse{ 11060 ServerResponse: googleapi.ServerResponse{ 11061 Header: res.Header, 11062 HTTPStatusCode: res.StatusCode, 11063 }, 11064 } 11065 target := &ret 11066 if err := gensupport.DecodeResponse(target, res); err != nil { 11067 return nil, err 11068 } 11069 return ret, nil 11070 // { 11071 // "description": "Submits a score to the specified leaderboard.", 11072 // "httpMethod": "POST", 11073 // "id": "games.scores.submit", 11074 // "parameterOrder": [ 11075 // "leaderboardId", 11076 // "score" 11077 // ], 11078 // "parameters": { 11079 // "language": { 11080 // "description": "The preferred language to use for strings returned by this method.", 11081 // "location": "query", 11082 // "type": "string" 11083 // }, 11084 // "leaderboardId": { 11085 // "description": "The ID of the leaderboard.", 11086 // "location": "path", 11087 // "required": true, 11088 // "type": "string" 11089 // }, 11090 // "score": { 11091 // "description": "The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units.", 11092 // "format": "int64", 11093 // "location": "query", 11094 // "required": true, 11095 // "type": "string" 11096 // }, 11097 // "scoreTag": { 11098 // "description": "Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.", 11099 // "location": "query", 11100 // "pattern": "[a-zA-Z0-9-._~]{0,64}", 11101 // "type": "string" 11102 // } 11103 // }, 11104 // "path": "leaderboards/{leaderboardId}/scores", 11105 // "response": { 11106 // "$ref": "PlayerScoreResponse" 11107 // }, 11108 // "scopes": [ 11109 // "https://www.googleapis.com/auth/games" 11110 // ] 11111 // } 11112 11113} 11114 11115// method id "games.scores.submitMultiple": 11116 11117type ScoresSubmitMultipleCall struct { 11118 s *Service 11119 playerscoresubmissionlist *PlayerScoreSubmissionList 11120 urlParams_ gensupport.URLParams 11121 ctx_ context.Context 11122 header_ http.Header 11123} 11124 11125// SubmitMultiple: Submits multiple scores to leaderboards. 11126func (r *ScoresService) SubmitMultiple(playerscoresubmissionlist *PlayerScoreSubmissionList) *ScoresSubmitMultipleCall { 11127 c := &ScoresSubmitMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11128 c.playerscoresubmissionlist = playerscoresubmissionlist 11129 return c 11130} 11131 11132// Language sets the optional parameter "language": The preferred 11133// language to use for strings returned by this method. 11134func (c *ScoresSubmitMultipleCall) Language(language string) *ScoresSubmitMultipleCall { 11135 c.urlParams_.Set("language", language) 11136 return c 11137} 11138 11139// Fields allows partial responses to be retrieved. See 11140// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11141// for more information. 11142func (c *ScoresSubmitMultipleCall) Fields(s ...googleapi.Field) *ScoresSubmitMultipleCall { 11143 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11144 return c 11145} 11146 11147// Context sets the context to be used in this call's Do method. Any 11148// pending HTTP request will be aborted if the provided context is 11149// canceled. 11150func (c *ScoresSubmitMultipleCall) Context(ctx context.Context) *ScoresSubmitMultipleCall { 11151 c.ctx_ = ctx 11152 return c 11153} 11154 11155// Header returns an http.Header that can be modified by the caller to 11156// add HTTP headers to the request. 11157func (c *ScoresSubmitMultipleCall) Header() http.Header { 11158 if c.header_ == nil { 11159 c.header_ = make(http.Header) 11160 } 11161 return c.header_ 11162} 11163 11164func (c *ScoresSubmitMultipleCall) doRequest(alt string) (*http.Response, error) { 11165 reqHeaders := make(http.Header) 11166 for k, v := range c.header_ { 11167 reqHeaders[k] = v 11168 } 11169 reqHeaders.Set("User-Agent", c.s.userAgent()) 11170 var body io.Reader = nil 11171 body, err := googleapi.WithoutDataWrapper.JSONReader(c.playerscoresubmissionlist) 11172 if err != nil { 11173 return nil, err 11174 } 11175 reqHeaders.Set("Content-Type", "application/json") 11176 c.urlParams_.Set("alt", alt) 11177 c.urlParams_.Set("prettyPrint", "false") 11178 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/scores") 11179 urls += "?" + c.urlParams_.Encode() 11180 req, err := http.NewRequest("POST", urls, body) 11181 if err != nil { 11182 return nil, err 11183 } 11184 req.Header = reqHeaders 11185 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11186} 11187 11188// Do executes the "games.scores.submitMultiple" call. 11189// Exactly one of *PlayerScoreListResponse or error will be non-nil. Any 11190// non-2xx status code is an error. Response headers are in either 11191// *PlayerScoreListResponse.ServerResponse.Header or (if a response was 11192// returned at all) in error.(*googleapi.Error).Header. Use 11193// googleapi.IsNotModified to check whether the returned error was 11194// because http.StatusNotModified was returned. 11195func (c *ScoresSubmitMultipleCall) Do(opts ...googleapi.CallOption) (*PlayerScoreListResponse, error) { 11196 gensupport.SetOptions(c.urlParams_, opts...) 11197 res, err := c.doRequest("json") 11198 if res != nil && res.StatusCode == http.StatusNotModified { 11199 if res.Body != nil { 11200 res.Body.Close() 11201 } 11202 return nil, &googleapi.Error{ 11203 Code: res.StatusCode, 11204 Header: res.Header, 11205 } 11206 } 11207 if err != nil { 11208 return nil, err 11209 } 11210 defer googleapi.CloseBody(res) 11211 if err := googleapi.CheckResponse(res); err != nil { 11212 return nil, err 11213 } 11214 ret := &PlayerScoreListResponse{ 11215 ServerResponse: googleapi.ServerResponse{ 11216 Header: res.Header, 11217 HTTPStatusCode: res.StatusCode, 11218 }, 11219 } 11220 target := &ret 11221 if err := gensupport.DecodeResponse(target, res); err != nil { 11222 return nil, err 11223 } 11224 return ret, nil 11225 // { 11226 // "description": "Submits multiple scores to leaderboards.", 11227 // "httpMethod": "POST", 11228 // "id": "games.scores.submitMultiple", 11229 // "parameters": { 11230 // "language": { 11231 // "description": "The preferred language to use for strings returned by this method.", 11232 // "location": "query", 11233 // "type": "string" 11234 // } 11235 // }, 11236 // "path": "leaderboards/scores", 11237 // "request": { 11238 // "$ref": "PlayerScoreSubmissionList" 11239 // }, 11240 // "response": { 11241 // "$ref": "PlayerScoreListResponse" 11242 // }, 11243 // "scopes": [ 11244 // "https://www.googleapis.com/auth/games" 11245 // ] 11246 // } 11247 11248} 11249 11250// method id "games.snapshots.get": 11251 11252type SnapshotsGetCall struct { 11253 s *Service 11254 snapshotId string 11255 urlParams_ gensupport.URLParams 11256 ifNoneMatch_ string 11257 ctx_ context.Context 11258 header_ http.Header 11259} 11260 11261// Get: Retrieves the metadata for a given snapshot ID. 11262func (r *SnapshotsService) Get(snapshotId string) *SnapshotsGetCall { 11263 c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11264 c.snapshotId = snapshotId 11265 return c 11266} 11267 11268// Language sets the optional parameter "language": The preferred 11269// language to use for strings returned by this method. 11270func (c *SnapshotsGetCall) Language(language string) *SnapshotsGetCall { 11271 c.urlParams_.Set("language", language) 11272 return c 11273} 11274 11275// Fields allows partial responses to be retrieved. See 11276// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11277// for more information. 11278func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall { 11279 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11280 return c 11281} 11282 11283// IfNoneMatch sets the optional parameter which makes the operation 11284// fail if the object's ETag matches the given value. This is useful for 11285// getting updates only after the object has changed since the last 11286// request. Use googleapi.IsNotModified to check whether the response 11287// error from Do is the result of In-None-Match. 11288func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall { 11289 c.ifNoneMatch_ = entityTag 11290 return c 11291} 11292 11293// Context sets the context to be used in this call's Do method. Any 11294// pending HTTP request will be aborted if the provided context is 11295// canceled. 11296func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall { 11297 c.ctx_ = ctx 11298 return c 11299} 11300 11301// Header returns an http.Header that can be modified by the caller to 11302// add HTTP headers to the request. 11303func (c *SnapshotsGetCall) Header() http.Header { 11304 if c.header_ == nil { 11305 c.header_ = make(http.Header) 11306 } 11307 return c.header_ 11308} 11309 11310func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { 11311 reqHeaders := make(http.Header) 11312 for k, v := range c.header_ { 11313 reqHeaders[k] = v 11314 } 11315 reqHeaders.Set("User-Agent", c.s.userAgent()) 11316 if c.ifNoneMatch_ != "" { 11317 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11318 } 11319 var body io.Reader = nil 11320 c.urlParams_.Set("alt", alt) 11321 c.urlParams_.Set("prettyPrint", "false") 11322 urls := googleapi.ResolveRelative(c.s.BasePath, "snapshots/{snapshotId}") 11323 urls += "?" + c.urlParams_.Encode() 11324 req, err := http.NewRequest("GET", urls, body) 11325 if err != nil { 11326 return nil, err 11327 } 11328 req.Header = reqHeaders 11329 googleapi.Expand(req.URL, map[string]string{ 11330 "snapshotId": c.snapshotId, 11331 }) 11332 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11333} 11334 11335// Do executes the "games.snapshots.get" call. 11336// Exactly one of *Snapshot or error will be non-nil. Any non-2xx status 11337// code is an error. Response headers are in either 11338// *Snapshot.ServerResponse.Header or (if a response was returned at 11339// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11340// to check whether the returned error was because 11341// http.StatusNotModified was returned. 11342func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) { 11343 gensupport.SetOptions(c.urlParams_, opts...) 11344 res, err := c.doRequest("json") 11345 if res != nil && res.StatusCode == http.StatusNotModified { 11346 if res.Body != nil { 11347 res.Body.Close() 11348 } 11349 return nil, &googleapi.Error{ 11350 Code: res.StatusCode, 11351 Header: res.Header, 11352 } 11353 } 11354 if err != nil { 11355 return nil, err 11356 } 11357 defer googleapi.CloseBody(res) 11358 if err := googleapi.CheckResponse(res); err != nil { 11359 return nil, err 11360 } 11361 ret := &Snapshot{ 11362 ServerResponse: googleapi.ServerResponse{ 11363 Header: res.Header, 11364 HTTPStatusCode: res.StatusCode, 11365 }, 11366 } 11367 target := &ret 11368 if err := gensupport.DecodeResponse(target, res); err != nil { 11369 return nil, err 11370 } 11371 return ret, nil 11372 // { 11373 // "description": "Retrieves the metadata for a given snapshot ID.", 11374 // "httpMethod": "GET", 11375 // "id": "games.snapshots.get", 11376 // "parameterOrder": [ 11377 // "snapshotId" 11378 // ], 11379 // "parameters": { 11380 // "language": { 11381 // "description": "The preferred language to use for strings returned by this method.", 11382 // "location": "query", 11383 // "type": "string" 11384 // }, 11385 // "snapshotId": { 11386 // "description": "The ID of the snapshot.", 11387 // "location": "path", 11388 // "required": true, 11389 // "type": "string" 11390 // } 11391 // }, 11392 // "path": "snapshots/{snapshotId}", 11393 // "response": { 11394 // "$ref": "Snapshot" 11395 // }, 11396 // "scopes": [ 11397 // "https://www.googleapis.com/auth/drive.appdata", 11398 // "https://www.googleapis.com/auth/games" 11399 // ] 11400 // } 11401 11402} 11403 11404// method id "games.snapshots.list": 11405 11406type SnapshotsListCall struct { 11407 s *Service 11408 playerId string 11409 urlParams_ gensupport.URLParams 11410 ifNoneMatch_ string 11411 ctx_ context.Context 11412 header_ http.Header 11413} 11414 11415// List: Retrieves a list of snapshots created by your application for 11416// the player corresponding to the player ID. 11417func (r *SnapshotsService) List(playerId string) *SnapshotsListCall { 11418 c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11419 c.playerId = playerId 11420 return c 11421} 11422 11423// Language sets the optional parameter "language": The preferred 11424// language to use for strings returned by this method. 11425func (c *SnapshotsListCall) Language(language string) *SnapshotsListCall { 11426 c.urlParams_.Set("language", language) 11427 return c 11428} 11429 11430// MaxResults sets the optional parameter "maxResults": The maximum 11431// number of snapshot resources to return in the response, used for 11432// paging. For any response, the actual number of snapshot resources 11433// returned may be less than the specified maxResults. 11434func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { 11435 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 11436 return c 11437} 11438 11439// PageToken sets the optional parameter "pageToken": The token returned 11440// by the previous request. 11441func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { 11442 c.urlParams_.Set("pageToken", pageToken) 11443 return c 11444} 11445 11446// Fields allows partial responses to be retrieved. See 11447// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11448// for more information. 11449func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall { 11450 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11451 return c 11452} 11453 11454// IfNoneMatch sets the optional parameter which makes the operation 11455// fail if the object's ETag matches the given value. This is useful for 11456// getting updates only after the object has changed since the last 11457// request. Use googleapi.IsNotModified to check whether the response 11458// error from Do is the result of In-None-Match. 11459func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall { 11460 c.ifNoneMatch_ = entityTag 11461 return c 11462} 11463 11464// Context sets the context to be used in this call's Do method. Any 11465// pending HTTP request will be aborted if the provided context is 11466// canceled. 11467func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall { 11468 c.ctx_ = ctx 11469 return c 11470} 11471 11472// Header returns an http.Header that can be modified by the caller to 11473// add HTTP headers to the request. 11474func (c *SnapshotsListCall) Header() http.Header { 11475 if c.header_ == nil { 11476 c.header_ = make(http.Header) 11477 } 11478 return c.header_ 11479} 11480 11481func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { 11482 reqHeaders := make(http.Header) 11483 for k, v := range c.header_ { 11484 reqHeaders[k] = v 11485 } 11486 reqHeaders.Set("User-Agent", c.s.userAgent()) 11487 if c.ifNoneMatch_ != "" { 11488 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11489 } 11490 var body io.Reader = nil 11491 c.urlParams_.Set("alt", alt) 11492 c.urlParams_.Set("prettyPrint", "false") 11493 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/snapshots") 11494 urls += "?" + c.urlParams_.Encode() 11495 req, err := http.NewRequest("GET", urls, body) 11496 if err != nil { 11497 return nil, err 11498 } 11499 req.Header = reqHeaders 11500 googleapi.Expand(req.URL, map[string]string{ 11501 "playerId": c.playerId, 11502 }) 11503 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11504} 11505 11506// Do executes the "games.snapshots.list" call. 11507// Exactly one of *SnapshotListResponse or error will be non-nil. Any 11508// non-2xx status code is an error. Response headers are in either 11509// *SnapshotListResponse.ServerResponse.Header or (if a response was 11510// returned at all) in error.(*googleapi.Error).Header. Use 11511// googleapi.IsNotModified to check whether the returned error was 11512// because http.StatusNotModified was returned. 11513func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotListResponse, error) { 11514 gensupport.SetOptions(c.urlParams_, opts...) 11515 res, err := c.doRequest("json") 11516 if res != nil && res.StatusCode == http.StatusNotModified { 11517 if res.Body != nil { 11518 res.Body.Close() 11519 } 11520 return nil, &googleapi.Error{ 11521 Code: res.StatusCode, 11522 Header: res.Header, 11523 } 11524 } 11525 if err != nil { 11526 return nil, err 11527 } 11528 defer googleapi.CloseBody(res) 11529 if err := googleapi.CheckResponse(res); err != nil { 11530 return nil, err 11531 } 11532 ret := &SnapshotListResponse{ 11533 ServerResponse: googleapi.ServerResponse{ 11534 Header: res.Header, 11535 HTTPStatusCode: res.StatusCode, 11536 }, 11537 } 11538 target := &ret 11539 if err := gensupport.DecodeResponse(target, res); err != nil { 11540 return nil, err 11541 } 11542 return ret, nil 11543 // { 11544 // "description": "Retrieves a list of snapshots created by your application for the player corresponding to the player ID.", 11545 // "httpMethod": "GET", 11546 // "id": "games.snapshots.list", 11547 // "parameterOrder": [ 11548 // "playerId" 11549 // ], 11550 // "parameters": { 11551 // "language": { 11552 // "description": "The preferred language to use for strings returned by this method.", 11553 // "location": "query", 11554 // "type": "string" 11555 // }, 11556 // "maxResults": { 11557 // "description": "The maximum number of snapshot resources to return in the response, used for paging. For any response, the actual number of snapshot resources returned may be less than the specified maxResults.", 11558 // "format": "int32", 11559 // "location": "query", 11560 // "maximum": "25", 11561 // "minimum": "1", 11562 // "type": "integer" 11563 // }, 11564 // "pageToken": { 11565 // "description": "The token returned by the previous request.", 11566 // "location": "query", 11567 // "type": "string" 11568 // }, 11569 // "playerId": { 11570 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 11571 // "location": "path", 11572 // "required": true, 11573 // "type": "string" 11574 // } 11575 // }, 11576 // "path": "players/{playerId}/snapshots", 11577 // "response": { 11578 // "$ref": "SnapshotListResponse" 11579 // }, 11580 // "scopes": [ 11581 // "https://www.googleapis.com/auth/drive.appdata", 11582 // "https://www.googleapis.com/auth/games" 11583 // ] 11584 // } 11585 11586} 11587 11588// Pages invokes f for each page of results. 11589// A non-nil error returned from f will halt the iteration. 11590// The provided context supersedes any context provided to the Context method. 11591func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotListResponse) error) error { 11592 c.ctx_ = ctx 11593 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11594 for { 11595 x, err := c.Do() 11596 if err != nil { 11597 return err 11598 } 11599 if err := f(x); err != nil { 11600 return err 11601 } 11602 if x.NextPageToken == "" { 11603 return nil 11604 } 11605 c.PageToken(x.NextPageToken) 11606 } 11607} 11608 11609// method id "games.turnBasedMatches.cancel": 11610 11611type TurnBasedMatchesCancelCall struct { 11612 s *Service 11613 matchId string 11614 urlParams_ gensupport.URLParams 11615 ctx_ context.Context 11616 header_ http.Header 11617} 11618 11619// Cancel: Cancel a turn-based match. 11620func (r *TurnBasedMatchesService) Cancel(matchId string) *TurnBasedMatchesCancelCall { 11621 c := &TurnBasedMatchesCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11622 c.matchId = matchId 11623 return c 11624} 11625 11626// Fields allows partial responses to be retrieved. See 11627// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11628// for more information. 11629func (c *TurnBasedMatchesCancelCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCancelCall { 11630 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11631 return c 11632} 11633 11634// Context sets the context to be used in this call's Do method. Any 11635// pending HTTP request will be aborted if the provided context is 11636// canceled. 11637func (c *TurnBasedMatchesCancelCall) Context(ctx context.Context) *TurnBasedMatchesCancelCall { 11638 c.ctx_ = ctx 11639 return c 11640} 11641 11642// Header returns an http.Header that can be modified by the caller to 11643// add HTTP headers to the request. 11644func (c *TurnBasedMatchesCancelCall) Header() http.Header { 11645 if c.header_ == nil { 11646 c.header_ = make(http.Header) 11647 } 11648 return c.header_ 11649} 11650 11651func (c *TurnBasedMatchesCancelCall) doRequest(alt string) (*http.Response, error) { 11652 reqHeaders := make(http.Header) 11653 for k, v := range c.header_ { 11654 reqHeaders[k] = v 11655 } 11656 reqHeaders.Set("User-Agent", c.s.userAgent()) 11657 var body io.Reader = nil 11658 c.urlParams_.Set("alt", alt) 11659 c.urlParams_.Set("prettyPrint", "false") 11660 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/cancel") 11661 urls += "?" + c.urlParams_.Encode() 11662 req, err := http.NewRequest("PUT", urls, body) 11663 if err != nil { 11664 return nil, err 11665 } 11666 req.Header = reqHeaders 11667 googleapi.Expand(req.URL, map[string]string{ 11668 "matchId": c.matchId, 11669 }) 11670 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11671} 11672 11673// Do executes the "games.turnBasedMatches.cancel" call. 11674func (c *TurnBasedMatchesCancelCall) Do(opts ...googleapi.CallOption) error { 11675 gensupport.SetOptions(c.urlParams_, opts...) 11676 res, err := c.doRequest("json") 11677 if err != nil { 11678 return err 11679 } 11680 defer googleapi.CloseBody(res) 11681 if err := googleapi.CheckResponse(res); err != nil { 11682 return err 11683 } 11684 return nil 11685 // { 11686 // "description": "Cancel a turn-based match.", 11687 // "httpMethod": "PUT", 11688 // "id": "games.turnBasedMatches.cancel", 11689 // "parameterOrder": [ 11690 // "matchId" 11691 // ], 11692 // "parameters": { 11693 // "matchId": { 11694 // "description": "The ID of the match.", 11695 // "location": "path", 11696 // "required": true, 11697 // "type": "string" 11698 // } 11699 // }, 11700 // "path": "turnbasedmatches/{matchId}/cancel", 11701 // "scopes": [ 11702 // "https://www.googleapis.com/auth/games" 11703 // ] 11704 // } 11705 11706} 11707 11708// method id "games.turnBasedMatches.create": 11709 11710type TurnBasedMatchesCreateCall struct { 11711 s *Service 11712 turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest 11713 urlParams_ gensupport.URLParams 11714 ctx_ context.Context 11715 header_ http.Header 11716} 11717 11718// Create: Create a turn-based match. 11719func (r *TurnBasedMatchesService) Create(turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest) *TurnBasedMatchesCreateCall { 11720 c := &TurnBasedMatchesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11721 c.turnbasedmatchcreaterequest = turnbasedmatchcreaterequest 11722 return c 11723} 11724 11725// Language sets the optional parameter "language": The preferred 11726// language to use for strings returned by this method. 11727func (c *TurnBasedMatchesCreateCall) Language(language string) *TurnBasedMatchesCreateCall { 11728 c.urlParams_.Set("language", language) 11729 return c 11730} 11731 11732// Fields allows partial responses to be retrieved. See 11733// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11734// for more information. 11735func (c *TurnBasedMatchesCreateCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCreateCall { 11736 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11737 return c 11738} 11739 11740// Context sets the context to be used in this call's Do method. Any 11741// pending HTTP request will be aborted if the provided context is 11742// canceled. 11743func (c *TurnBasedMatchesCreateCall) Context(ctx context.Context) *TurnBasedMatchesCreateCall { 11744 c.ctx_ = ctx 11745 return c 11746} 11747 11748// Header returns an http.Header that can be modified by the caller to 11749// add HTTP headers to the request. 11750func (c *TurnBasedMatchesCreateCall) Header() http.Header { 11751 if c.header_ == nil { 11752 c.header_ = make(http.Header) 11753 } 11754 return c.header_ 11755} 11756 11757func (c *TurnBasedMatchesCreateCall) doRequest(alt string) (*http.Response, error) { 11758 reqHeaders := make(http.Header) 11759 for k, v := range c.header_ { 11760 reqHeaders[k] = v 11761 } 11762 reqHeaders.Set("User-Agent", c.s.userAgent()) 11763 var body io.Reader = nil 11764 body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchcreaterequest) 11765 if err != nil { 11766 return nil, err 11767 } 11768 reqHeaders.Set("Content-Type", "application/json") 11769 c.urlParams_.Set("alt", alt) 11770 c.urlParams_.Set("prettyPrint", "false") 11771 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/create") 11772 urls += "?" + c.urlParams_.Encode() 11773 req, err := http.NewRequest("POST", urls, body) 11774 if err != nil { 11775 return nil, err 11776 } 11777 req.Header = reqHeaders 11778 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11779} 11780 11781// Do executes the "games.turnBasedMatches.create" call. 11782// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 11783// status code is an error. Response headers are in either 11784// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 11785// at all) in error.(*googleapi.Error).Header. Use 11786// googleapi.IsNotModified to check whether the returned error was 11787// because http.StatusNotModified was returned. 11788func (c *TurnBasedMatchesCreateCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 11789 gensupport.SetOptions(c.urlParams_, opts...) 11790 res, err := c.doRequest("json") 11791 if res != nil && res.StatusCode == http.StatusNotModified { 11792 if res.Body != nil { 11793 res.Body.Close() 11794 } 11795 return nil, &googleapi.Error{ 11796 Code: res.StatusCode, 11797 Header: res.Header, 11798 } 11799 } 11800 if err != nil { 11801 return nil, err 11802 } 11803 defer googleapi.CloseBody(res) 11804 if err := googleapi.CheckResponse(res); err != nil { 11805 return nil, err 11806 } 11807 ret := &TurnBasedMatch{ 11808 ServerResponse: googleapi.ServerResponse{ 11809 Header: res.Header, 11810 HTTPStatusCode: res.StatusCode, 11811 }, 11812 } 11813 target := &ret 11814 if err := gensupport.DecodeResponse(target, res); err != nil { 11815 return nil, err 11816 } 11817 return ret, nil 11818 // { 11819 // "description": "Create a turn-based match.", 11820 // "httpMethod": "POST", 11821 // "id": "games.turnBasedMatches.create", 11822 // "parameters": { 11823 // "language": { 11824 // "description": "The preferred language to use for strings returned by this method.", 11825 // "location": "query", 11826 // "type": "string" 11827 // } 11828 // }, 11829 // "path": "turnbasedmatches/create", 11830 // "request": { 11831 // "$ref": "TurnBasedMatchCreateRequest" 11832 // }, 11833 // "response": { 11834 // "$ref": "TurnBasedMatch" 11835 // }, 11836 // "scopes": [ 11837 // "https://www.googleapis.com/auth/games" 11838 // ] 11839 // } 11840 11841} 11842 11843// method id "games.turnBasedMatches.decline": 11844 11845type TurnBasedMatchesDeclineCall struct { 11846 s *Service 11847 matchId string 11848 urlParams_ gensupport.URLParams 11849 ctx_ context.Context 11850 header_ http.Header 11851} 11852 11853// Decline: Decline an invitation to play a turn-based match. 11854func (r *TurnBasedMatchesService) Decline(matchId string) *TurnBasedMatchesDeclineCall { 11855 c := &TurnBasedMatchesDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11856 c.matchId = matchId 11857 return c 11858} 11859 11860// Language sets the optional parameter "language": The preferred 11861// language to use for strings returned by this method. 11862func (c *TurnBasedMatchesDeclineCall) Language(language string) *TurnBasedMatchesDeclineCall { 11863 c.urlParams_.Set("language", language) 11864 return c 11865} 11866 11867// Fields allows partial responses to be retrieved. See 11868// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11869// for more information. 11870func (c *TurnBasedMatchesDeclineCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDeclineCall { 11871 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11872 return c 11873} 11874 11875// Context sets the context to be used in this call's Do method. Any 11876// pending HTTP request will be aborted if the provided context is 11877// canceled. 11878func (c *TurnBasedMatchesDeclineCall) Context(ctx context.Context) *TurnBasedMatchesDeclineCall { 11879 c.ctx_ = ctx 11880 return c 11881} 11882 11883// Header returns an http.Header that can be modified by the caller to 11884// add HTTP headers to the request. 11885func (c *TurnBasedMatchesDeclineCall) Header() http.Header { 11886 if c.header_ == nil { 11887 c.header_ = make(http.Header) 11888 } 11889 return c.header_ 11890} 11891 11892func (c *TurnBasedMatchesDeclineCall) doRequest(alt string) (*http.Response, error) { 11893 reqHeaders := make(http.Header) 11894 for k, v := range c.header_ { 11895 reqHeaders[k] = v 11896 } 11897 reqHeaders.Set("User-Agent", c.s.userAgent()) 11898 var body io.Reader = nil 11899 c.urlParams_.Set("alt", alt) 11900 c.urlParams_.Set("prettyPrint", "false") 11901 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/decline") 11902 urls += "?" + c.urlParams_.Encode() 11903 req, err := http.NewRequest("PUT", urls, body) 11904 if err != nil { 11905 return nil, err 11906 } 11907 req.Header = reqHeaders 11908 googleapi.Expand(req.URL, map[string]string{ 11909 "matchId": c.matchId, 11910 }) 11911 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11912} 11913 11914// Do executes the "games.turnBasedMatches.decline" call. 11915// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 11916// status code is an error. Response headers are in either 11917// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 11918// at all) in error.(*googleapi.Error).Header. Use 11919// googleapi.IsNotModified to check whether the returned error was 11920// because http.StatusNotModified was returned. 11921func (c *TurnBasedMatchesDeclineCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 11922 gensupport.SetOptions(c.urlParams_, opts...) 11923 res, err := c.doRequest("json") 11924 if res != nil && res.StatusCode == http.StatusNotModified { 11925 if res.Body != nil { 11926 res.Body.Close() 11927 } 11928 return nil, &googleapi.Error{ 11929 Code: res.StatusCode, 11930 Header: res.Header, 11931 } 11932 } 11933 if err != nil { 11934 return nil, err 11935 } 11936 defer googleapi.CloseBody(res) 11937 if err := googleapi.CheckResponse(res); err != nil { 11938 return nil, err 11939 } 11940 ret := &TurnBasedMatch{ 11941 ServerResponse: googleapi.ServerResponse{ 11942 Header: res.Header, 11943 HTTPStatusCode: res.StatusCode, 11944 }, 11945 } 11946 target := &ret 11947 if err := gensupport.DecodeResponse(target, res); err != nil { 11948 return nil, err 11949 } 11950 return ret, nil 11951 // { 11952 // "description": "Decline an invitation to play a turn-based match.", 11953 // "httpMethod": "PUT", 11954 // "id": "games.turnBasedMatches.decline", 11955 // "parameterOrder": [ 11956 // "matchId" 11957 // ], 11958 // "parameters": { 11959 // "language": { 11960 // "description": "The preferred language to use for strings returned by this method.", 11961 // "location": "query", 11962 // "type": "string" 11963 // }, 11964 // "matchId": { 11965 // "description": "The ID of the match.", 11966 // "location": "path", 11967 // "required": true, 11968 // "type": "string" 11969 // } 11970 // }, 11971 // "path": "turnbasedmatches/{matchId}/decline", 11972 // "response": { 11973 // "$ref": "TurnBasedMatch" 11974 // }, 11975 // "scopes": [ 11976 // "https://www.googleapis.com/auth/games" 11977 // ] 11978 // } 11979 11980} 11981 11982// method id "games.turnBasedMatches.dismiss": 11983 11984type TurnBasedMatchesDismissCall struct { 11985 s *Service 11986 matchId string 11987 urlParams_ gensupport.URLParams 11988 ctx_ context.Context 11989 header_ http.Header 11990} 11991 11992// Dismiss: Dismiss a turn-based match from the match list. The match 11993// will no longer show up in the list and will not generate 11994// notifications. 11995func (r *TurnBasedMatchesService) Dismiss(matchId string) *TurnBasedMatchesDismissCall { 11996 c := &TurnBasedMatchesDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11997 c.matchId = matchId 11998 return c 11999} 12000 12001// Fields allows partial responses to be retrieved. See 12002// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12003// for more information. 12004func (c *TurnBasedMatchesDismissCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDismissCall { 12005 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12006 return c 12007} 12008 12009// Context sets the context to be used in this call's Do method. Any 12010// pending HTTP request will be aborted if the provided context is 12011// canceled. 12012func (c *TurnBasedMatchesDismissCall) Context(ctx context.Context) *TurnBasedMatchesDismissCall { 12013 c.ctx_ = ctx 12014 return c 12015} 12016 12017// Header returns an http.Header that can be modified by the caller to 12018// add HTTP headers to the request. 12019func (c *TurnBasedMatchesDismissCall) Header() http.Header { 12020 if c.header_ == nil { 12021 c.header_ = make(http.Header) 12022 } 12023 return c.header_ 12024} 12025 12026func (c *TurnBasedMatchesDismissCall) doRequest(alt string) (*http.Response, error) { 12027 reqHeaders := make(http.Header) 12028 for k, v := range c.header_ { 12029 reqHeaders[k] = v 12030 } 12031 reqHeaders.Set("User-Agent", c.s.userAgent()) 12032 var body io.Reader = nil 12033 c.urlParams_.Set("alt", alt) 12034 c.urlParams_.Set("prettyPrint", "false") 12035 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/dismiss") 12036 urls += "?" + c.urlParams_.Encode() 12037 req, err := http.NewRequest("PUT", urls, body) 12038 if err != nil { 12039 return nil, err 12040 } 12041 req.Header = reqHeaders 12042 googleapi.Expand(req.URL, map[string]string{ 12043 "matchId": c.matchId, 12044 }) 12045 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12046} 12047 12048// Do executes the "games.turnBasedMatches.dismiss" call. 12049func (c *TurnBasedMatchesDismissCall) Do(opts ...googleapi.CallOption) error { 12050 gensupport.SetOptions(c.urlParams_, opts...) 12051 res, err := c.doRequest("json") 12052 if err != nil { 12053 return err 12054 } 12055 defer googleapi.CloseBody(res) 12056 if err := googleapi.CheckResponse(res); err != nil { 12057 return err 12058 } 12059 return nil 12060 // { 12061 // "description": "Dismiss a turn-based match from the match list. The match will no longer show up in the list and will not generate notifications.", 12062 // "httpMethod": "PUT", 12063 // "id": "games.turnBasedMatches.dismiss", 12064 // "parameterOrder": [ 12065 // "matchId" 12066 // ], 12067 // "parameters": { 12068 // "matchId": { 12069 // "description": "The ID of the match.", 12070 // "location": "path", 12071 // "required": true, 12072 // "type": "string" 12073 // } 12074 // }, 12075 // "path": "turnbasedmatches/{matchId}/dismiss", 12076 // "scopes": [ 12077 // "https://www.googleapis.com/auth/games" 12078 // ] 12079 // } 12080 12081} 12082 12083// method id "games.turnBasedMatches.finish": 12084 12085type TurnBasedMatchesFinishCall struct { 12086 s *Service 12087 matchId string 12088 turnbasedmatchresults *TurnBasedMatchResults 12089 urlParams_ gensupport.URLParams 12090 ctx_ context.Context 12091 header_ http.Header 12092} 12093 12094// Finish: Finish a turn-based match. Each player should make this call 12095// once, after all results are in. Only the player whose turn it is may 12096// make the first call to Finish, and can pass in the final match state. 12097func (r *TurnBasedMatchesService) Finish(matchId string, turnbasedmatchresults *TurnBasedMatchResults) *TurnBasedMatchesFinishCall { 12098 c := &TurnBasedMatchesFinishCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12099 c.matchId = matchId 12100 c.turnbasedmatchresults = turnbasedmatchresults 12101 return c 12102} 12103 12104// Language sets the optional parameter "language": The preferred 12105// language to use for strings returned by this method. 12106func (c *TurnBasedMatchesFinishCall) Language(language string) *TurnBasedMatchesFinishCall { 12107 c.urlParams_.Set("language", language) 12108 return c 12109} 12110 12111// Fields allows partial responses to be retrieved. See 12112// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12113// for more information. 12114func (c *TurnBasedMatchesFinishCall) Fields(s ...googleapi.Field) *TurnBasedMatchesFinishCall { 12115 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12116 return c 12117} 12118 12119// Context sets the context to be used in this call's Do method. Any 12120// pending HTTP request will be aborted if the provided context is 12121// canceled. 12122func (c *TurnBasedMatchesFinishCall) Context(ctx context.Context) *TurnBasedMatchesFinishCall { 12123 c.ctx_ = ctx 12124 return c 12125} 12126 12127// Header returns an http.Header that can be modified by the caller to 12128// add HTTP headers to the request. 12129func (c *TurnBasedMatchesFinishCall) Header() http.Header { 12130 if c.header_ == nil { 12131 c.header_ = make(http.Header) 12132 } 12133 return c.header_ 12134} 12135 12136func (c *TurnBasedMatchesFinishCall) doRequest(alt string) (*http.Response, error) { 12137 reqHeaders := make(http.Header) 12138 for k, v := range c.header_ { 12139 reqHeaders[k] = v 12140 } 12141 reqHeaders.Set("User-Agent", c.s.userAgent()) 12142 var body io.Reader = nil 12143 body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchresults) 12144 if err != nil { 12145 return nil, err 12146 } 12147 reqHeaders.Set("Content-Type", "application/json") 12148 c.urlParams_.Set("alt", alt) 12149 c.urlParams_.Set("prettyPrint", "false") 12150 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/finish") 12151 urls += "?" + c.urlParams_.Encode() 12152 req, err := http.NewRequest("PUT", urls, body) 12153 if err != nil { 12154 return nil, err 12155 } 12156 req.Header = reqHeaders 12157 googleapi.Expand(req.URL, map[string]string{ 12158 "matchId": c.matchId, 12159 }) 12160 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12161} 12162 12163// Do executes the "games.turnBasedMatches.finish" call. 12164// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 12165// status code is an error. Response headers are in either 12166// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 12167// at all) in error.(*googleapi.Error).Header. Use 12168// googleapi.IsNotModified to check whether the returned error was 12169// because http.StatusNotModified was returned. 12170func (c *TurnBasedMatchesFinishCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 12171 gensupport.SetOptions(c.urlParams_, opts...) 12172 res, err := c.doRequest("json") 12173 if res != nil && res.StatusCode == http.StatusNotModified { 12174 if res.Body != nil { 12175 res.Body.Close() 12176 } 12177 return nil, &googleapi.Error{ 12178 Code: res.StatusCode, 12179 Header: res.Header, 12180 } 12181 } 12182 if err != nil { 12183 return nil, err 12184 } 12185 defer googleapi.CloseBody(res) 12186 if err := googleapi.CheckResponse(res); err != nil { 12187 return nil, err 12188 } 12189 ret := &TurnBasedMatch{ 12190 ServerResponse: googleapi.ServerResponse{ 12191 Header: res.Header, 12192 HTTPStatusCode: res.StatusCode, 12193 }, 12194 } 12195 target := &ret 12196 if err := gensupport.DecodeResponse(target, res); err != nil { 12197 return nil, err 12198 } 12199 return ret, nil 12200 // { 12201 // "description": "Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state.", 12202 // "httpMethod": "PUT", 12203 // "id": "games.turnBasedMatches.finish", 12204 // "parameterOrder": [ 12205 // "matchId" 12206 // ], 12207 // "parameters": { 12208 // "language": { 12209 // "description": "The preferred language to use for strings returned by this method.", 12210 // "location": "query", 12211 // "type": "string" 12212 // }, 12213 // "matchId": { 12214 // "description": "The ID of the match.", 12215 // "location": "path", 12216 // "required": true, 12217 // "type": "string" 12218 // } 12219 // }, 12220 // "path": "turnbasedmatches/{matchId}/finish", 12221 // "request": { 12222 // "$ref": "TurnBasedMatchResults" 12223 // }, 12224 // "response": { 12225 // "$ref": "TurnBasedMatch" 12226 // }, 12227 // "scopes": [ 12228 // "https://www.googleapis.com/auth/games" 12229 // ] 12230 // } 12231 12232} 12233 12234// method id "games.turnBasedMatches.get": 12235 12236type TurnBasedMatchesGetCall struct { 12237 s *Service 12238 matchId string 12239 urlParams_ gensupport.URLParams 12240 ifNoneMatch_ string 12241 ctx_ context.Context 12242 header_ http.Header 12243} 12244 12245// Get: Get the data for a turn-based match. 12246func (r *TurnBasedMatchesService) Get(matchId string) *TurnBasedMatchesGetCall { 12247 c := &TurnBasedMatchesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12248 c.matchId = matchId 12249 return c 12250} 12251 12252// IncludeMatchData sets the optional parameter "includeMatchData": Get 12253// match data along with metadata. 12254func (c *TurnBasedMatchesGetCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesGetCall { 12255 c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData)) 12256 return c 12257} 12258 12259// Language sets the optional parameter "language": The preferred 12260// language to use for strings returned by this method. 12261func (c *TurnBasedMatchesGetCall) Language(language string) *TurnBasedMatchesGetCall { 12262 c.urlParams_.Set("language", language) 12263 return c 12264} 12265 12266// Fields allows partial responses to be retrieved. See 12267// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12268// for more information. 12269func (c *TurnBasedMatchesGetCall) Fields(s ...googleapi.Field) *TurnBasedMatchesGetCall { 12270 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12271 return c 12272} 12273 12274// IfNoneMatch sets the optional parameter which makes the operation 12275// fail if the object's ETag matches the given value. This is useful for 12276// getting updates only after the object has changed since the last 12277// request. Use googleapi.IsNotModified to check whether the response 12278// error from Do is the result of In-None-Match. 12279func (c *TurnBasedMatchesGetCall) IfNoneMatch(entityTag string) *TurnBasedMatchesGetCall { 12280 c.ifNoneMatch_ = entityTag 12281 return c 12282} 12283 12284// Context sets the context to be used in this call's Do method. Any 12285// pending HTTP request will be aborted if the provided context is 12286// canceled. 12287func (c *TurnBasedMatchesGetCall) Context(ctx context.Context) *TurnBasedMatchesGetCall { 12288 c.ctx_ = ctx 12289 return c 12290} 12291 12292// Header returns an http.Header that can be modified by the caller to 12293// add HTTP headers to the request. 12294func (c *TurnBasedMatchesGetCall) Header() http.Header { 12295 if c.header_ == nil { 12296 c.header_ = make(http.Header) 12297 } 12298 return c.header_ 12299} 12300 12301func (c *TurnBasedMatchesGetCall) doRequest(alt string) (*http.Response, error) { 12302 reqHeaders := make(http.Header) 12303 for k, v := range c.header_ { 12304 reqHeaders[k] = v 12305 } 12306 reqHeaders.Set("User-Agent", c.s.userAgent()) 12307 if c.ifNoneMatch_ != "" { 12308 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12309 } 12310 var body io.Reader = nil 12311 c.urlParams_.Set("alt", alt) 12312 c.urlParams_.Set("prettyPrint", "false") 12313 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}") 12314 urls += "?" + c.urlParams_.Encode() 12315 req, err := http.NewRequest("GET", urls, body) 12316 if err != nil { 12317 return nil, err 12318 } 12319 req.Header = reqHeaders 12320 googleapi.Expand(req.URL, map[string]string{ 12321 "matchId": c.matchId, 12322 }) 12323 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12324} 12325 12326// Do executes the "games.turnBasedMatches.get" call. 12327// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 12328// status code is an error. Response headers are in either 12329// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 12330// at all) in error.(*googleapi.Error).Header. Use 12331// googleapi.IsNotModified to check whether the returned error was 12332// because http.StatusNotModified was returned. 12333func (c *TurnBasedMatchesGetCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 12334 gensupport.SetOptions(c.urlParams_, opts...) 12335 res, err := c.doRequest("json") 12336 if res != nil && res.StatusCode == http.StatusNotModified { 12337 if res.Body != nil { 12338 res.Body.Close() 12339 } 12340 return nil, &googleapi.Error{ 12341 Code: res.StatusCode, 12342 Header: res.Header, 12343 } 12344 } 12345 if err != nil { 12346 return nil, err 12347 } 12348 defer googleapi.CloseBody(res) 12349 if err := googleapi.CheckResponse(res); err != nil { 12350 return nil, err 12351 } 12352 ret := &TurnBasedMatch{ 12353 ServerResponse: googleapi.ServerResponse{ 12354 Header: res.Header, 12355 HTTPStatusCode: res.StatusCode, 12356 }, 12357 } 12358 target := &ret 12359 if err := gensupport.DecodeResponse(target, res); err != nil { 12360 return nil, err 12361 } 12362 return ret, nil 12363 // { 12364 // "description": "Get the data for a turn-based match.", 12365 // "httpMethod": "GET", 12366 // "id": "games.turnBasedMatches.get", 12367 // "parameterOrder": [ 12368 // "matchId" 12369 // ], 12370 // "parameters": { 12371 // "includeMatchData": { 12372 // "description": "Get match data along with metadata.", 12373 // "location": "query", 12374 // "type": "boolean" 12375 // }, 12376 // "language": { 12377 // "description": "The preferred language to use for strings returned by this method.", 12378 // "location": "query", 12379 // "type": "string" 12380 // }, 12381 // "matchId": { 12382 // "description": "The ID of the match.", 12383 // "location": "path", 12384 // "required": true, 12385 // "type": "string" 12386 // } 12387 // }, 12388 // "path": "turnbasedmatches/{matchId}", 12389 // "response": { 12390 // "$ref": "TurnBasedMatch" 12391 // }, 12392 // "scopes": [ 12393 // "https://www.googleapis.com/auth/games" 12394 // ] 12395 // } 12396 12397} 12398 12399// method id "games.turnBasedMatches.join": 12400 12401type TurnBasedMatchesJoinCall struct { 12402 s *Service 12403 matchId string 12404 urlParams_ gensupport.URLParams 12405 ctx_ context.Context 12406 header_ http.Header 12407} 12408 12409// Join: Join a turn-based match. 12410func (r *TurnBasedMatchesService) Join(matchId string) *TurnBasedMatchesJoinCall { 12411 c := &TurnBasedMatchesJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12412 c.matchId = matchId 12413 return c 12414} 12415 12416// Language sets the optional parameter "language": The preferred 12417// language to use for strings returned by this method. 12418func (c *TurnBasedMatchesJoinCall) Language(language string) *TurnBasedMatchesJoinCall { 12419 c.urlParams_.Set("language", language) 12420 return c 12421} 12422 12423// Fields allows partial responses to be retrieved. See 12424// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12425// for more information. 12426func (c *TurnBasedMatchesJoinCall) Fields(s ...googleapi.Field) *TurnBasedMatchesJoinCall { 12427 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12428 return c 12429} 12430 12431// Context sets the context to be used in this call's Do method. Any 12432// pending HTTP request will be aborted if the provided context is 12433// canceled. 12434func (c *TurnBasedMatchesJoinCall) Context(ctx context.Context) *TurnBasedMatchesJoinCall { 12435 c.ctx_ = ctx 12436 return c 12437} 12438 12439// Header returns an http.Header that can be modified by the caller to 12440// add HTTP headers to the request. 12441func (c *TurnBasedMatchesJoinCall) Header() http.Header { 12442 if c.header_ == nil { 12443 c.header_ = make(http.Header) 12444 } 12445 return c.header_ 12446} 12447 12448func (c *TurnBasedMatchesJoinCall) doRequest(alt string) (*http.Response, error) { 12449 reqHeaders := make(http.Header) 12450 for k, v := range c.header_ { 12451 reqHeaders[k] = v 12452 } 12453 reqHeaders.Set("User-Agent", c.s.userAgent()) 12454 var body io.Reader = nil 12455 c.urlParams_.Set("alt", alt) 12456 c.urlParams_.Set("prettyPrint", "false") 12457 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/join") 12458 urls += "?" + c.urlParams_.Encode() 12459 req, err := http.NewRequest("PUT", urls, body) 12460 if err != nil { 12461 return nil, err 12462 } 12463 req.Header = reqHeaders 12464 googleapi.Expand(req.URL, map[string]string{ 12465 "matchId": c.matchId, 12466 }) 12467 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12468} 12469 12470// Do executes the "games.turnBasedMatches.join" call. 12471// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 12472// status code is an error. Response headers are in either 12473// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 12474// at all) in error.(*googleapi.Error).Header. Use 12475// googleapi.IsNotModified to check whether the returned error was 12476// because http.StatusNotModified was returned. 12477func (c *TurnBasedMatchesJoinCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 12478 gensupport.SetOptions(c.urlParams_, opts...) 12479 res, err := c.doRequest("json") 12480 if res != nil && res.StatusCode == http.StatusNotModified { 12481 if res.Body != nil { 12482 res.Body.Close() 12483 } 12484 return nil, &googleapi.Error{ 12485 Code: res.StatusCode, 12486 Header: res.Header, 12487 } 12488 } 12489 if err != nil { 12490 return nil, err 12491 } 12492 defer googleapi.CloseBody(res) 12493 if err := googleapi.CheckResponse(res); err != nil { 12494 return nil, err 12495 } 12496 ret := &TurnBasedMatch{ 12497 ServerResponse: googleapi.ServerResponse{ 12498 Header: res.Header, 12499 HTTPStatusCode: res.StatusCode, 12500 }, 12501 } 12502 target := &ret 12503 if err := gensupport.DecodeResponse(target, res); err != nil { 12504 return nil, err 12505 } 12506 return ret, nil 12507 // { 12508 // "description": "Join a turn-based match.", 12509 // "httpMethod": "PUT", 12510 // "id": "games.turnBasedMatches.join", 12511 // "parameterOrder": [ 12512 // "matchId" 12513 // ], 12514 // "parameters": { 12515 // "language": { 12516 // "description": "The preferred language to use for strings returned by this method.", 12517 // "location": "query", 12518 // "type": "string" 12519 // }, 12520 // "matchId": { 12521 // "description": "The ID of the match.", 12522 // "location": "path", 12523 // "required": true, 12524 // "type": "string" 12525 // } 12526 // }, 12527 // "path": "turnbasedmatches/{matchId}/join", 12528 // "response": { 12529 // "$ref": "TurnBasedMatch" 12530 // }, 12531 // "scopes": [ 12532 // "https://www.googleapis.com/auth/games" 12533 // ] 12534 // } 12535 12536} 12537 12538// method id "games.turnBasedMatches.leave": 12539 12540type TurnBasedMatchesLeaveCall struct { 12541 s *Service 12542 matchId string 12543 urlParams_ gensupport.URLParams 12544 ctx_ context.Context 12545 header_ http.Header 12546} 12547 12548// Leave: Leave a turn-based match when it is not the current player's 12549// turn, without canceling the match. 12550func (r *TurnBasedMatchesService) Leave(matchId string) *TurnBasedMatchesLeaveCall { 12551 c := &TurnBasedMatchesLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12552 c.matchId = matchId 12553 return c 12554} 12555 12556// Language sets the optional parameter "language": The preferred 12557// language to use for strings returned by this method. 12558func (c *TurnBasedMatchesLeaveCall) Language(language string) *TurnBasedMatchesLeaveCall { 12559 c.urlParams_.Set("language", language) 12560 return c 12561} 12562 12563// Fields allows partial responses to be retrieved. See 12564// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12565// for more information. 12566func (c *TurnBasedMatchesLeaveCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveCall { 12567 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12568 return c 12569} 12570 12571// Context sets the context to be used in this call's Do method. Any 12572// pending HTTP request will be aborted if the provided context is 12573// canceled. 12574func (c *TurnBasedMatchesLeaveCall) Context(ctx context.Context) *TurnBasedMatchesLeaveCall { 12575 c.ctx_ = ctx 12576 return c 12577} 12578 12579// Header returns an http.Header that can be modified by the caller to 12580// add HTTP headers to the request. 12581func (c *TurnBasedMatchesLeaveCall) Header() http.Header { 12582 if c.header_ == nil { 12583 c.header_ = make(http.Header) 12584 } 12585 return c.header_ 12586} 12587 12588func (c *TurnBasedMatchesLeaveCall) doRequest(alt string) (*http.Response, error) { 12589 reqHeaders := make(http.Header) 12590 for k, v := range c.header_ { 12591 reqHeaders[k] = v 12592 } 12593 reqHeaders.Set("User-Agent", c.s.userAgent()) 12594 var body io.Reader = nil 12595 c.urlParams_.Set("alt", alt) 12596 c.urlParams_.Set("prettyPrint", "false") 12597 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leave") 12598 urls += "?" + c.urlParams_.Encode() 12599 req, err := http.NewRequest("PUT", urls, body) 12600 if err != nil { 12601 return nil, err 12602 } 12603 req.Header = reqHeaders 12604 googleapi.Expand(req.URL, map[string]string{ 12605 "matchId": c.matchId, 12606 }) 12607 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12608} 12609 12610// Do executes the "games.turnBasedMatches.leave" call. 12611// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 12612// status code is an error. Response headers are in either 12613// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 12614// at all) in error.(*googleapi.Error).Header. Use 12615// googleapi.IsNotModified to check whether the returned error was 12616// because http.StatusNotModified was returned. 12617func (c *TurnBasedMatchesLeaveCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 12618 gensupport.SetOptions(c.urlParams_, opts...) 12619 res, err := c.doRequest("json") 12620 if res != nil && res.StatusCode == http.StatusNotModified { 12621 if res.Body != nil { 12622 res.Body.Close() 12623 } 12624 return nil, &googleapi.Error{ 12625 Code: res.StatusCode, 12626 Header: res.Header, 12627 } 12628 } 12629 if err != nil { 12630 return nil, err 12631 } 12632 defer googleapi.CloseBody(res) 12633 if err := googleapi.CheckResponse(res); err != nil { 12634 return nil, err 12635 } 12636 ret := &TurnBasedMatch{ 12637 ServerResponse: googleapi.ServerResponse{ 12638 Header: res.Header, 12639 HTTPStatusCode: res.StatusCode, 12640 }, 12641 } 12642 target := &ret 12643 if err := gensupport.DecodeResponse(target, res); err != nil { 12644 return nil, err 12645 } 12646 return ret, nil 12647 // { 12648 // "description": "Leave a turn-based match when it is not the current player's turn, without canceling the match.", 12649 // "httpMethod": "PUT", 12650 // "id": "games.turnBasedMatches.leave", 12651 // "parameterOrder": [ 12652 // "matchId" 12653 // ], 12654 // "parameters": { 12655 // "language": { 12656 // "description": "The preferred language to use for strings returned by this method.", 12657 // "location": "query", 12658 // "type": "string" 12659 // }, 12660 // "matchId": { 12661 // "description": "The ID of the match.", 12662 // "location": "path", 12663 // "required": true, 12664 // "type": "string" 12665 // } 12666 // }, 12667 // "path": "turnbasedmatches/{matchId}/leave", 12668 // "response": { 12669 // "$ref": "TurnBasedMatch" 12670 // }, 12671 // "scopes": [ 12672 // "https://www.googleapis.com/auth/games" 12673 // ] 12674 // } 12675 12676} 12677 12678// method id "games.turnBasedMatches.leaveTurn": 12679 12680type TurnBasedMatchesLeaveTurnCall struct { 12681 s *Service 12682 matchId string 12683 urlParams_ gensupport.URLParams 12684 ctx_ context.Context 12685 header_ http.Header 12686} 12687 12688// LeaveTurn: Leave a turn-based match during the current player's turn, 12689// without canceling the match. 12690func (r *TurnBasedMatchesService) LeaveTurn(matchId string, matchVersion int64) *TurnBasedMatchesLeaveTurnCall { 12691 c := &TurnBasedMatchesLeaveTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12692 c.matchId = matchId 12693 c.urlParams_.Set("matchVersion", fmt.Sprint(matchVersion)) 12694 return c 12695} 12696 12697// Language sets the optional parameter "language": The preferred 12698// language to use for strings returned by this method. 12699func (c *TurnBasedMatchesLeaveTurnCall) Language(language string) *TurnBasedMatchesLeaveTurnCall { 12700 c.urlParams_.Set("language", language) 12701 return c 12702} 12703 12704// PendingParticipantId sets the optional parameter 12705// "pendingParticipantId": The ID of another participant who should take 12706// their turn next. If not set, the match will wait for other player(s) 12707// to join via automatching; this is only valid if automatch criteria is 12708// set on the match with remaining slots for automatched players. 12709func (c *TurnBasedMatchesLeaveTurnCall) PendingParticipantId(pendingParticipantId string) *TurnBasedMatchesLeaveTurnCall { 12710 c.urlParams_.Set("pendingParticipantId", pendingParticipantId) 12711 return c 12712} 12713 12714// Fields allows partial responses to be retrieved. See 12715// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12716// for more information. 12717func (c *TurnBasedMatchesLeaveTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveTurnCall { 12718 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12719 return c 12720} 12721 12722// Context sets the context to be used in this call's Do method. Any 12723// pending HTTP request will be aborted if the provided context is 12724// canceled. 12725func (c *TurnBasedMatchesLeaveTurnCall) Context(ctx context.Context) *TurnBasedMatchesLeaveTurnCall { 12726 c.ctx_ = ctx 12727 return c 12728} 12729 12730// Header returns an http.Header that can be modified by the caller to 12731// add HTTP headers to the request. 12732func (c *TurnBasedMatchesLeaveTurnCall) Header() http.Header { 12733 if c.header_ == nil { 12734 c.header_ = make(http.Header) 12735 } 12736 return c.header_ 12737} 12738 12739func (c *TurnBasedMatchesLeaveTurnCall) doRequest(alt string) (*http.Response, error) { 12740 reqHeaders := make(http.Header) 12741 for k, v := range c.header_ { 12742 reqHeaders[k] = v 12743 } 12744 reqHeaders.Set("User-Agent", c.s.userAgent()) 12745 var body io.Reader = nil 12746 c.urlParams_.Set("alt", alt) 12747 c.urlParams_.Set("prettyPrint", "false") 12748 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leaveTurn") 12749 urls += "?" + c.urlParams_.Encode() 12750 req, err := http.NewRequest("PUT", urls, body) 12751 if err != nil { 12752 return nil, err 12753 } 12754 req.Header = reqHeaders 12755 googleapi.Expand(req.URL, map[string]string{ 12756 "matchId": c.matchId, 12757 }) 12758 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12759} 12760 12761// Do executes the "games.turnBasedMatches.leaveTurn" call. 12762// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 12763// status code is an error. Response headers are in either 12764// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 12765// at all) in error.(*googleapi.Error).Header. Use 12766// googleapi.IsNotModified to check whether the returned error was 12767// because http.StatusNotModified was returned. 12768func (c *TurnBasedMatchesLeaveTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 12769 gensupport.SetOptions(c.urlParams_, opts...) 12770 res, err := c.doRequest("json") 12771 if res != nil && res.StatusCode == http.StatusNotModified { 12772 if res.Body != nil { 12773 res.Body.Close() 12774 } 12775 return nil, &googleapi.Error{ 12776 Code: res.StatusCode, 12777 Header: res.Header, 12778 } 12779 } 12780 if err != nil { 12781 return nil, err 12782 } 12783 defer googleapi.CloseBody(res) 12784 if err := googleapi.CheckResponse(res); err != nil { 12785 return nil, err 12786 } 12787 ret := &TurnBasedMatch{ 12788 ServerResponse: googleapi.ServerResponse{ 12789 Header: res.Header, 12790 HTTPStatusCode: res.StatusCode, 12791 }, 12792 } 12793 target := &ret 12794 if err := gensupport.DecodeResponse(target, res); err != nil { 12795 return nil, err 12796 } 12797 return ret, nil 12798 // { 12799 // "description": "Leave a turn-based match during the current player's turn, without canceling the match.", 12800 // "httpMethod": "PUT", 12801 // "id": "games.turnBasedMatches.leaveTurn", 12802 // "parameterOrder": [ 12803 // "matchId", 12804 // "matchVersion" 12805 // ], 12806 // "parameters": { 12807 // "language": { 12808 // "description": "The preferred language to use for strings returned by this method.", 12809 // "location": "query", 12810 // "type": "string" 12811 // }, 12812 // "matchId": { 12813 // "description": "The ID of the match.", 12814 // "location": "path", 12815 // "required": true, 12816 // "type": "string" 12817 // }, 12818 // "matchVersion": { 12819 // "description": "The version of the match being updated.", 12820 // "format": "int32", 12821 // "location": "query", 12822 // "required": true, 12823 // "type": "integer" 12824 // }, 12825 // "pendingParticipantId": { 12826 // "description": "The ID of another participant who should take their turn next. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players.", 12827 // "location": "query", 12828 // "type": "string" 12829 // } 12830 // }, 12831 // "path": "turnbasedmatches/{matchId}/leaveTurn", 12832 // "response": { 12833 // "$ref": "TurnBasedMatch" 12834 // }, 12835 // "scopes": [ 12836 // "https://www.googleapis.com/auth/games" 12837 // ] 12838 // } 12839 12840} 12841 12842// method id "games.turnBasedMatches.list": 12843 12844type TurnBasedMatchesListCall struct { 12845 s *Service 12846 urlParams_ gensupport.URLParams 12847 ifNoneMatch_ string 12848 ctx_ context.Context 12849 header_ http.Header 12850} 12851 12852// List: Returns turn-based matches the player is or was involved in. 12853func (r *TurnBasedMatchesService) List() *TurnBasedMatchesListCall { 12854 c := &TurnBasedMatchesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12855 return c 12856} 12857 12858// IncludeMatchData sets the optional parameter "includeMatchData": True 12859// if match data should be returned in the response. Note that not all 12860// data will necessarily be returned if include_match_data is true; the 12861// server may decide to only return data for some of the matches to 12862// limit download size for the client. The remainder of the data for 12863// these matches will be retrievable on request. 12864func (c *TurnBasedMatchesListCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesListCall { 12865 c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData)) 12866 return c 12867} 12868 12869// Language sets the optional parameter "language": The preferred 12870// language to use for strings returned by this method. 12871func (c *TurnBasedMatchesListCall) Language(language string) *TurnBasedMatchesListCall { 12872 c.urlParams_.Set("language", language) 12873 return c 12874} 12875 12876// MaxCompletedMatches sets the optional parameter 12877// "maxCompletedMatches": The maximum number of completed or canceled 12878// matches to return in the response. If not set, all matches returned 12879// could be completed or canceled. 12880func (c *TurnBasedMatchesListCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesListCall { 12881 c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches)) 12882 return c 12883} 12884 12885// MaxResults sets the optional parameter "maxResults": The maximum 12886// number of matches to return in the response, used for paging. For any 12887// response, the actual number of matches to return may be less than the 12888// specified maxResults. 12889func (c *TurnBasedMatchesListCall) MaxResults(maxResults int64) *TurnBasedMatchesListCall { 12890 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 12891 return c 12892} 12893 12894// PageToken sets the optional parameter "pageToken": The token returned 12895// by the previous request. 12896func (c *TurnBasedMatchesListCall) PageToken(pageToken string) *TurnBasedMatchesListCall { 12897 c.urlParams_.Set("pageToken", pageToken) 12898 return c 12899} 12900 12901// Fields allows partial responses to be retrieved. See 12902// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12903// for more information. 12904func (c *TurnBasedMatchesListCall) Fields(s ...googleapi.Field) *TurnBasedMatchesListCall { 12905 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12906 return c 12907} 12908 12909// IfNoneMatch sets the optional parameter which makes the operation 12910// fail if the object's ETag matches the given value. This is useful for 12911// getting updates only after the object has changed since the last 12912// request. Use googleapi.IsNotModified to check whether the response 12913// error from Do is the result of In-None-Match. 12914func (c *TurnBasedMatchesListCall) IfNoneMatch(entityTag string) *TurnBasedMatchesListCall { 12915 c.ifNoneMatch_ = entityTag 12916 return c 12917} 12918 12919// Context sets the context to be used in this call's Do method. Any 12920// pending HTTP request will be aborted if the provided context is 12921// canceled. 12922func (c *TurnBasedMatchesListCall) Context(ctx context.Context) *TurnBasedMatchesListCall { 12923 c.ctx_ = ctx 12924 return c 12925} 12926 12927// Header returns an http.Header that can be modified by the caller to 12928// add HTTP headers to the request. 12929func (c *TurnBasedMatchesListCall) Header() http.Header { 12930 if c.header_ == nil { 12931 c.header_ = make(http.Header) 12932 } 12933 return c.header_ 12934} 12935 12936func (c *TurnBasedMatchesListCall) doRequest(alt string) (*http.Response, error) { 12937 reqHeaders := make(http.Header) 12938 for k, v := range c.header_ { 12939 reqHeaders[k] = v 12940 } 12941 reqHeaders.Set("User-Agent", c.s.userAgent()) 12942 if c.ifNoneMatch_ != "" { 12943 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12944 } 12945 var body io.Reader = nil 12946 c.urlParams_.Set("alt", alt) 12947 c.urlParams_.Set("prettyPrint", "false") 12948 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches") 12949 urls += "?" + c.urlParams_.Encode() 12950 req, err := http.NewRequest("GET", urls, body) 12951 if err != nil { 12952 return nil, err 12953 } 12954 req.Header = reqHeaders 12955 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12956} 12957 12958// Do executes the "games.turnBasedMatches.list" call. 12959// Exactly one of *TurnBasedMatchList or error will be non-nil. Any 12960// non-2xx status code is an error. Response headers are in either 12961// *TurnBasedMatchList.ServerResponse.Header or (if a response was 12962// returned at all) in error.(*googleapi.Error).Header. Use 12963// googleapi.IsNotModified to check whether the returned error was 12964// because http.StatusNotModified was returned. 12965func (c *TurnBasedMatchesListCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchList, error) { 12966 gensupport.SetOptions(c.urlParams_, opts...) 12967 res, err := c.doRequest("json") 12968 if res != nil && res.StatusCode == http.StatusNotModified { 12969 if res.Body != nil { 12970 res.Body.Close() 12971 } 12972 return nil, &googleapi.Error{ 12973 Code: res.StatusCode, 12974 Header: res.Header, 12975 } 12976 } 12977 if err != nil { 12978 return nil, err 12979 } 12980 defer googleapi.CloseBody(res) 12981 if err := googleapi.CheckResponse(res); err != nil { 12982 return nil, err 12983 } 12984 ret := &TurnBasedMatchList{ 12985 ServerResponse: googleapi.ServerResponse{ 12986 Header: res.Header, 12987 HTTPStatusCode: res.StatusCode, 12988 }, 12989 } 12990 target := &ret 12991 if err := gensupport.DecodeResponse(target, res); err != nil { 12992 return nil, err 12993 } 12994 return ret, nil 12995 // { 12996 // "description": "Returns turn-based matches the player is or was involved in.", 12997 // "httpMethod": "GET", 12998 // "id": "games.turnBasedMatches.list", 12999 // "parameters": { 13000 // "includeMatchData": { 13001 // "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.", 13002 // "location": "query", 13003 // "type": "boolean" 13004 // }, 13005 // "language": { 13006 // "description": "The preferred language to use for strings returned by this method.", 13007 // "location": "query", 13008 // "type": "string" 13009 // }, 13010 // "maxCompletedMatches": { 13011 // "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.", 13012 // "format": "int32", 13013 // "location": "query", 13014 // "maximum": "500", 13015 // "minimum": "0", 13016 // "type": "integer" 13017 // }, 13018 // "maxResults": { 13019 // "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.", 13020 // "format": "int32", 13021 // "location": "query", 13022 // "maximum": "500", 13023 // "minimum": "1", 13024 // "type": "integer" 13025 // }, 13026 // "pageToken": { 13027 // "description": "The token returned by the previous request.", 13028 // "location": "query", 13029 // "type": "string" 13030 // } 13031 // }, 13032 // "path": "turnbasedmatches", 13033 // "response": { 13034 // "$ref": "TurnBasedMatchList" 13035 // }, 13036 // "scopes": [ 13037 // "https://www.googleapis.com/auth/games" 13038 // ] 13039 // } 13040 13041} 13042 13043// Pages invokes f for each page of results. 13044// A non-nil error returned from f will halt the iteration. 13045// The provided context supersedes any context provided to the Context method. 13046func (c *TurnBasedMatchesListCall) Pages(ctx context.Context, f func(*TurnBasedMatchList) error) error { 13047 c.ctx_ = ctx 13048 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13049 for { 13050 x, err := c.Do() 13051 if err != nil { 13052 return err 13053 } 13054 if err := f(x); err != nil { 13055 return err 13056 } 13057 if x.NextPageToken == "" { 13058 return nil 13059 } 13060 c.PageToken(x.NextPageToken) 13061 } 13062} 13063 13064// method id "games.turnBasedMatches.rematch": 13065 13066type TurnBasedMatchesRematchCall struct { 13067 s *Service 13068 matchId string 13069 urlParams_ gensupport.URLParams 13070 ctx_ context.Context 13071 header_ http.Header 13072} 13073 13074// Rematch: Create a rematch of a match that was previously completed, 13075// with the same participants. This can be called by only one player on 13076// a match still in their list; the player must have called Finish 13077// first. Returns the newly created match; it will be the caller's turn. 13078func (r *TurnBasedMatchesService) Rematch(matchId string) *TurnBasedMatchesRematchCall { 13079 c := &TurnBasedMatchesRematchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13080 c.matchId = matchId 13081 return c 13082} 13083 13084// Language sets the optional parameter "language": The preferred 13085// language to use for strings returned by this method. 13086func (c *TurnBasedMatchesRematchCall) Language(language string) *TurnBasedMatchesRematchCall { 13087 c.urlParams_.Set("language", language) 13088 return c 13089} 13090 13091// RequestId sets the optional parameter "requestId": A randomly 13092// generated numeric ID for each request specified by the caller. This 13093// number is used at the server to ensure that the request is handled 13094// correctly across retries. 13095func (c *TurnBasedMatchesRematchCall) RequestId(requestId int64) *TurnBasedMatchesRematchCall { 13096 c.urlParams_.Set("requestId", fmt.Sprint(requestId)) 13097 return c 13098} 13099 13100// Fields allows partial responses to be retrieved. See 13101// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13102// for more information. 13103func (c *TurnBasedMatchesRematchCall) Fields(s ...googleapi.Field) *TurnBasedMatchesRematchCall { 13104 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13105 return c 13106} 13107 13108// Context sets the context to be used in this call's Do method. Any 13109// pending HTTP request will be aborted if the provided context is 13110// canceled. 13111func (c *TurnBasedMatchesRematchCall) Context(ctx context.Context) *TurnBasedMatchesRematchCall { 13112 c.ctx_ = ctx 13113 return c 13114} 13115 13116// Header returns an http.Header that can be modified by the caller to 13117// add HTTP headers to the request. 13118func (c *TurnBasedMatchesRematchCall) Header() http.Header { 13119 if c.header_ == nil { 13120 c.header_ = make(http.Header) 13121 } 13122 return c.header_ 13123} 13124 13125func (c *TurnBasedMatchesRematchCall) doRequest(alt string) (*http.Response, error) { 13126 reqHeaders := make(http.Header) 13127 for k, v := range c.header_ { 13128 reqHeaders[k] = v 13129 } 13130 reqHeaders.Set("User-Agent", c.s.userAgent()) 13131 var body io.Reader = nil 13132 c.urlParams_.Set("alt", alt) 13133 c.urlParams_.Set("prettyPrint", "false") 13134 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/rematch") 13135 urls += "?" + c.urlParams_.Encode() 13136 req, err := http.NewRequest("POST", urls, body) 13137 if err != nil { 13138 return nil, err 13139 } 13140 req.Header = reqHeaders 13141 googleapi.Expand(req.URL, map[string]string{ 13142 "matchId": c.matchId, 13143 }) 13144 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13145} 13146 13147// Do executes the "games.turnBasedMatches.rematch" call. 13148// Exactly one of *TurnBasedMatchRematch or error will be non-nil. Any 13149// non-2xx status code is an error. Response headers are in either 13150// *TurnBasedMatchRematch.ServerResponse.Header or (if a response was 13151// returned at all) in error.(*googleapi.Error).Header. Use 13152// googleapi.IsNotModified to check whether the returned error was 13153// because http.StatusNotModified was returned. 13154func (c *TurnBasedMatchesRematchCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchRematch, error) { 13155 gensupport.SetOptions(c.urlParams_, opts...) 13156 res, err := c.doRequest("json") 13157 if res != nil && res.StatusCode == http.StatusNotModified { 13158 if res.Body != nil { 13159 res.Body.Close() 13160 } 13161 return nil, &googleapi.Error{ 13162 Code: res.StatusCode, 13163 Header: res.Header, 13164 } 13165 } 13166 if err != nil { 13167 return nil, err 13168 } 13169 defer googleapi.CloseBody(res) 13170 if err := googleapi.CheckResponse(res); err != nil { 13171 return nil, err 13172 } 13173 ret := &TurnBasedMatchRematch{ 13174 ServerResponse: googleapi.ServerResponse{ 13175 Header: res.Header, 13176 HTTPStatusCode: res.StatusCode, 13177 }, 13178 } 13179 target := &ret 13180 if err := gensupport.DecodeResponse(target, res); err != nil { 13181 return nil, err 13182 } 13183 return ret, nil 13184 // { 13185 // "description": "Create a rematch of a match that was previously completed, with the same participants. This can be called by only one player on a match still in their list; the player must have called Finish first. Returns the newly created match; it will be the caller's turn.", 13186 // "httpMethod": "POST", 13187 // "id": "games.turnBasedMatches.rematch", 13188 // "parameterOrder": [ 13189 // "matchId" 13190 // ], 13191 // "parameters": { 13192 // "language": { 13193 // "description": "The preferred language to use for strings returned by this method.", 13194 // "location": "query", 13195 // "type": "string" 13196 // }, 13197 // "matchId": { 13198 // "description": "The ID of the match.", 13199 // "location": "path", 13200 // "required": true, 13201 // "type": "string" 13202 // }, 13203 // "requestId": { 13204 // "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.", 13205 // "format": "int64", 13206 // "location": "query", 13207 // "type": "string" 13208 // } 13209 // }, 13210 // "path": "turnbasedmatches/{matchId}/rematch", 13211 // "response": { 13212 // "$ref": "TurnBasedMatchRematch" 13213 // }, 13214 // "scopes": [ 13215 // "https://www.googleapis.com/auth/games" 13216 // ] 13217 // } 13218 13219} 13220 13221// method id "games.turnBasedMatches.sync": 13222 13223type TurnBasedMatchesSyncCall struct { 13224 s *Service 13225 urlParams_ gensupport.URLParams 13226 ifNoneMatch_ string 13227 ctx_ context.Context 13228 header_ http.Header 13229} 13230 13231// Sync: Returns turn-based matches the player is or was involved in 13232// that changed since the last sync call, with the least recent changes 13233// coming first. Matches that should be removed from the local cache 13234// will have a status of MATCH_DELETED. 13235func (r *TurnBasedMatchesService) Sync() *TurnBasedMatchesSyncCall { 13236 c := &TurnBasedMatchesSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13237 return c 13238} 13239 13240// IncludeMatchData sets the optional parameter "includeMatchData": True 13241// if match data should be returned in the response. Note that not all 13242// data will necessarily be returned if include_match_data is true; the 13243// server may decide to only return data for some of the matches to 13244// limit download size for the client. The remainder of the data for 13245// these matches will be retrievable on request. 13246func (c *TurnBasedMatchesSyncCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesSyncCall { 13247 c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData)) 13248 return c 13249} 13250 13251// Language sets the optional parameter "language": The preferred 13252// language to use for strings returned by this method. 13253func (c *TurnBasedMatchesSyncCall) Language(language string) *TurnBasedMatchesSyncCall { 13254 c.urlParams_.Set("language", language) 13255 return c 13256} 13257 13258// MaxCompletedMatches sets the optional parameter 13259// "maxCompletedMatches": The maximum number of completed or canceled 13260// matches to return in the response. If not set, all matches returned 13261// could be completed or canceled. 13262func (c *TurnBasedMatchesSyncCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesSyncCall { 13263 c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches)) 13264 return c 13265} 13266 13267// MaxResults sets the optional parameter "maxResults": The maximum 13268// number of matches to return in the response, used for paging. For any 13269// response, the actual number of matches to return may be less than the 13270// specified maxResults. 13271func (c *TurnBasedMatchesSyncCall) MaxResults(maxResults int64) *TurnBasedMatchesSyncCall { 13272 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 13273 return c 13274} 13275 13276// PageToken sets the optional parameter "pageToken": The token returned 13277// by the previous request. 13278func (c *TurnBasedMatchesSyncCall) PageToken(pageToken string) *TurnBasedMatchesSyncCall { 13279 c.urlParams_.Set("pageToken", pageToken) 13280 return c 13281} 13282 13283// Fields allows partial responses to be retrieved. See 13284// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13285// for more information. 13286func (c *TurnBasedMatchesSyncCall) Fields(s ...googleapi.Field) *TurnBasedMatchesSyncCall { 13287 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13288 return c 13289} 13290 13291// IfNoneMatch sets the optional parameter which makes the operation 13292// fail if the object's ETag matches the given value. This is useful for 13293// getting updates only after the object has changed since the last 13294// request. Use googleapi.IsNotModified to check whether the response 13295// error from Do is the result of In-None-Match. 13296func (c *TurnBasedMatchesSyncCall) IfNoneMatch(entityTag string) *TurnBasedMatchesSyncCall { 13297 c.ifNoneMatch_ = entityTag 13298 return c 13299} 13300 13301// Context sets the context to be used in this call's Do method. Any 13302// pending HTTP request will be aborted if the provided context is 13303// canceled. 13304func (c *TurnBasedMatchesSyncCall) Context(ctx context.Context) *TurnBasedMatchesSyncCall { 13305 c.ctx_ = ctx 13306 return c 13307} 13308 13309// Header returns an http.Header that can be modified by the caller to 13310// add HTTP headers to the request. 13311func (c *TurnBasedMatchesSyncCall) Header() http.Header { 13312 if c.header_ == nil { 13313 c.header_ = make(http.Header) 13314 } 13315 return c.header_ 13316} 13317 13318func (c *TurnBasedMatchesSyncCall) doRequest(alt string) (*http.Response, error) { 13319 reqHeaders := make(http.Header) 13320 for k, v := range c.header_ { 13321 reqHeaders[k] = v 13322 } 13323 reqHeaders.Set("User-Agent", c.s.userAgent()) 13324 if c.ifNoneMatch_ != "" { 13325 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13326 } 13327 var body io.Reader = nil 13328 c.urlParams_.Set("alt", alt) 13329 c.urlParams_.Set("prettyPrint", "false") 13330 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/sync") 13331 urls += "?" + c.urlParams_.Encode() 13332 req, err := http.NewRequest("GET", urls, body) 13333 if err != nil { 13334 return nil, err 13335 } 13336 req.Header = reqHeaders 13337 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13338} 13339 13340// Do executes the "games.turnBasedMatches.sync" call. 13341// Exactly one of *TurnBasedMatchSync or error will be non-nil. Any 13342// non-2xx status code is an error. Response headers are in either 13343// *TurnBasedMatchSync.ServerResponse.Header or (if a response was 13344// returned at all) in error.(*googleapi.Error).Header. Use 13345// googleapi.IsNotModified to check whether the returned error was 13346// because http.StatusNotModified was returned. 13347func (c *TurnBasedMatchesSyncCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchSync, error) { 13348 gensupport.SetOptions(c.urlParams_, opts...) 13349 res, err := c.doRequest("json") 13350 if res != nil && res.StatusCode == http.StatusNotModified { 13351 if res.Body != nil { 13352 res.Body.Close() 13353 } 13354 return nil, &googleapi.Error{ 13355 Code: res.StatusCode, 13356 Header: res.Header, 13357 } 13358 } 13359 if err != nil { 13360 return nil, err 13361 } 13362 defer googleapi.CloseBody(res) 13363 if err := googleapi.CheckResponse(res); err != nil { 13364 return nil, err 13365 } 13366 ret := &TurnBasedMatchSync{ 13367 ServerResponse: googleapi.ServerResponse{ 13368 Header: res.Header, 13369 HTTPStatusCode: res.StatusCode, 13370 }, 13371 } 13372 target := &ret 13373 if err := gensupport.DecodeResponse(target, res); err != nil { 13374 return nil, err 13375 } 13376 return ret, nil 13377 // { 13378 // "description": "Returns turn-based matches the player is or was involved in that changed since the last sync call, with the least recent changes coming first. Matches that should be removed from the local cache will have a status of MATCH_DELETED.", 13379 // "httpMethod": "GET", 13380 // "id": "games.turnBasedMatches.sync", 13381 // "parameters": { 13382 // "includeMatchData": { 13383 // "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.", 13384 // "location": "query", 13385 // "type": "boolean" 13386 // }, 13387 // "language": { 13388 // "description": "The preferred language to use for strings returned by this method.", 13389 // "location": "query", 13390 // "type": "string" 13391 // }, 13392 // "maxCompletedMatches": { 13393 // "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.", 13394 // "format": "int32", 13395 // "location": "query", 13396 // "maximum": "500", 13397 // "minimum": "0", 13398 // "type": "integer" 13399 // }, 13400 // "maxResults": { 13401 // "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.", 13402 // "format": "int32", 13403 // "location": "query", 13404 // "maximum": "500", 13405 // "minimum": "1", 13406 // "type": "integer" 13407 // }, 13408 // "pageToken": { 13409 // "description": "The token returned by the previous request.", 13410 // "location": "query", 13411 // "type": "string" 13412 // } 13413 // }, 13414 // "path": "turnbasedmatches/sync", 13415 // "response": { 13416 // "$ref": "TurnBasedMatchSync" 13417 // }, 13418 // "scopes": [ 13419 // "https://www.googleapis.com/auth/games" 13420 // ] 13421 // } 13422 13423} 13424 13425// Pages invokes f for each page of results. 13426// A non-nil error returned from f will halt the iteration. 13427// The provided context supersedes any context provided to the Context method. 13428func (c *TurnBasedMatchesSyncCall) Pages(ctx context.Context, f func(*TurnBasedMatchSync) error) error { 13429 c.ctx_ = ctx 13430 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13431 for { 13432 x, err := c.Do() 13433 if err != nil { 13434 return err 13435 } 13436 if err := f(x); err != nil { 13437 return err 13438 } 13439 if x.NextPageToken == "" { 13440 return nil 13441 } 13442 c.PageToken(x.NextPageToken) 13443 } 13444} 13445 13446// method id "games.turnBasedMatches.takeTurn": 13447 13448type TurnBasedMatchesTakeTurnCall struct { 13449 s *Service 13450 matchId string 13451 turnbasedmatchturn *TurnBasedMatchTurn 13452 urlParams_ gensupport.URLParams 13453 ctx_ context.Context 13454 header_ http.Header 13455} 13456 13457// TakeTurn: Commit the results of a player turn. 13458func (r *TurnBasedMatchesService) TakeTurn(matchId string, turnbasedmatchturn *TurnBasedMatchTurn) *TurnBasedMatchesTakeTurnCall { 13459 c := &TurnBasedMatchesTakeTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13460 c.matchId = matchId 13461 c.turnbasedmatchturn = turnbasedmatchturn 13462 return c 13463} 13464 13465// Language sets the optional parameter "language": The preferred 13466// language to use for strings returned by this method. 13467func (c *TurnBasedMatchesTakeTurnCall) Language(language string) *TurnBasedMatchesTakeTurnCall { 13468 c.urlParams_.Set("language", language) 13469 return c 13470} 13471 13472// Fields allows partial responses to be retrieved. See 13473// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13474// for more information. 13475func (c *TurnBasedMatchesTakeTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesTakeTurnCall { 13476 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13477 return c 13478} 13479 13480// Context sets the context to be used in this call's Do method. Any 13481// pending HTTP request will be aborted if the provided context is 13482// canceled. 13483func (c *TurnBasedMatchesTakeTurnCall) Context(ctx context.Context) *TurnBasedMatchesTakeTurnCall { 13484 c.ctx_ = ctx 13485 return c 13486} 13487 13488// Header returns an http.Header that can be modified by the caller to 13489// add HTTP headers to the request. 13490func (c *TurnBasedMatchesTakeTurnCall) Header() http.Header { 13491 if c.header_ == nil { 13492 c.header_ = make(http.Header) 13493 } 13494 return c.header_ 13495} 13496 13497func (c *TurnBasedMatchesTakeTurnCall) doRequest(alt string) (*http.Response, error) { 13498 reqHeaders := make(http.Header) 13499 for k, v := range c.header_ { 13500 reqHeaders[k] = v 13501 } 13502 reqHeaders.Set("User-Agent", c.s.userAgent()) 13503 var body io.Reader = nil 13504 body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchturn) 13505 if err != nil { 13506 return nil, err 13507 } 13508 reqHeaders.Set("Content-Type", "application/json") 13509 c.urlParams_.Set("alt", alt) 13510 c.urlParams_.Set("prettyPrint", "false") 13511 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/turn") 13512 urls += "?" + c.urlParams_.Encode() 13513 req, err := http.NewRequest("PUT", urls, body) 13514 if err != nil { 13515 return nil, err 13516 } 13517 req.Header = reqHeaders 13518 googleapi.Expand(req.URL, map[string]string{ 13519 "matchId": c.matchId, 13520 }) 13521 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13522} 13523 13524// Do executes the "games.turnBasedMatches.takeTurn" call. 13525// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 13526// status code is an error. Response headers are in either 13527// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 13528// at all) in error.(*googleapi.Error).Header. Use 13529// googleapi.IsNotModified to check whether the returned error was 13530// because http.StatusNotModified was returned. 13531func (c *TurnBasedMatchesTakeTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 13532 gensupport.SetOptions(c.urlParams_, opts...) 13533 res, err := c.doRequest("json") 13534 if res != nil && res.StatusCode == http.StatusNotModified { 13535 if res.Body != nil { 13536 res.Body.Close() 13537 } 13538 return nil, &googleapi.Error{ 13539 Code: res.StatusCode, 13540 Header: res.Header, 13541 } 13542 } 13543 if err != nil { 13544 return nil, err 13545 } 13546 defer googleapi.CloseBody(res) 13547 if err := googleapi.CheckResponse(res); err != nil { 13548 return nil, err 13549 } 13550 ret := &TurnBasedMatch{ 13551 ServerResponse: googleapi.ServerResponse{ 13552 Header: res.Header, 13553 HTTPStatusCode: res.StatusCode, 13554 }, 13555 } 13556 target := &ret 13557 if err := gensupport.DecodeResponse(target, res); err != nil { 13558 return nil, err 13559 } 13560 return ret, nil 13561 // { 13562 // "description": "Commit the results of a player turn.", 13563 // "httpMethod": "PUT", 13564 // "id": "games.turnBasedMatches.takeTurn", 13565 // "parameterOrder": [ 13566 // "matchId" 13567 // ], 13568 // "parameters": { 13569 // "language": { 13570 // "description": "The preferred language to use for strings returned by this method.", 13571 // "location": "query", 13572 // "type": "string" 13573 // }, 13574 // "matchId": { 13575 // "description": "The ID of the match.", 13576 // "location": "path", 13577 // "required": true, 13578 // "type": "string" 13579 // } 13580 // }, 13581 // "path": "turnbasedmatches/{matchId}/turn", 13582 // "request": { 13583 // "$ref": "TurnBasedMatchTurn" 13584 // }, 13585 // "response": { 13586 // "$ref": "TurnBasedMatch" 13587 // }, 13588 // "scopes": [ 13589 // "https://www.googleapis.com/auth/games" 13590 // ] 13591 // } 13592 13593} 13594