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 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 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.Revisions = NewRevisionsService(s) 131 s.Rooms = NewRoomsService(s) 132 s.Scores = NewScoresService(s) 133 s.Snapshots = NewSnapshotsService(s) 134 s.TurnBasedMatches = NewTurnBasedMatchesService(s) 135 return s, nil 136} 137 138type Service struct { 139 client *http.Client 140 BasePath string // API endpoint base URL 141 UserAgent string // optional additional User-Agent fragment 142 143 AchievementDefinitions *AchievementDefinitionsService 144 145 Achievements *AchievementsService 146 147 Applications *ApplicationsService 148 149 Events *EventsService 150 151 Leaderboards *LeaderboardsService 152 153 Metagame *MetagameService 154 155 Players *PlayersService 156 157 Pushtokens *PushtokensService 158 159 Revisions *RevisionsService 160 161 Rooms *RoomsService 162 163 Scores *ScoresService 164 165 Snapshots *SnapshotsService 166 167 TurnBasedMatches *TurnBasedMatchesService 168} 169 170func (s *Service) userAgent() string { 171 if s.UserAgent == "" { 172 return googleapi.UserAgent 173 } 174 return googleapi.UserAgent + " " + s.UserAgent 175} 176 177func NewAchievementDefinitionsService(s *Service) *AchievementDefinitionsService { 178 rs := &AchievementDefinitionsService{s: s} 179 return rs 180} 181 182type AchievementDefinitionsService struct { 183 s *Service 184} 185 186func NewAchievementsService(s *Service) *AchievementsService { 187 rs := &AchievementsService{s: s} 188 return rs 189} 190 191type AchievementsService struct { 192 s *Service 193} 194 195func NewApplicationsService(s *Service) *ApplicationsService { 196 rs := &ApplicationsService{s: s} 197 return rs 198} 199 200type ApplicationsService struct { 201 s *Service 202} 203 204func NewEventsService(s *Service) *EventsService { 205 rs := &EventsService{s: s} 206 return rs 207} 208 209type EventsService struct { 210 s *Service 211} 212 213func NewLeaderboardsService(s *Service) *LeaderboardsService { 214 rs := &LeaderboardsService{s: s} 215 return rs 216} 217 218type LeaderboardsService struct { 219 s *Service 220} 221 222func NewMetagameService(s *Service) *MetagameService { 223 rs := &MetagameService{s: s} 224 return rs 225} 226 227type MetagameService struct { 228 s *Service 229} 230 231func NewPlayersService(s *Service) *PlayersService { 232 rs := &PlayersService{s: s} 233 return rs 234} 235 236type PlayersService struct { 237 s *Service 238} 239 240func NewPushtokensService(s *Service) *PushtokensService { 241 rs := &PushtokensService{s: s} 242 return rs 243} 244 245type PushtokensService struct { 246 s *Service 247} 248 249func NewRevisionsService(s *Service) *RevisionsService { 250 rs := &RevisionsService{s: s} 251 return rs 252} 253 254type RevisionsService struct { 255 s *Service 256} 257 258func NewRoomsService(s *Service) *RoomsService { 259 rs := &RoomsService{s: s} 260 return rs 261} 262 263type RoomsService struct { 264 s *Service 265} 266 267func NewScoresService(s *Service) *ScoresService { 268 rs := &ScoresService{s: s} 269 return rs 270} 271 272type ScoresService struct { 273 s *Service 274} 275 276func NewSnapshotsService(s *Service) *SnapshotsService { 277 rs := &SnapshotsService{s: s} 278 return rs 279} 280 281type SnapshotsService struct { 282 s *Service 283} 284 285func NewTurnBasedMatchesService(s *Service) *TurnBasedMatchesService { 286 rs := &TurnBasedMatchesService{s: s} 287 return rs 288} 289 290type TurnBasedMatchesService struct { 291 s *Service 292} 293 294// AchievementDefinition: This is a JSON template for an achievement 295// definition object. 296type AchievementDefinition struct { 297 // AchievementType: The type of the achievement. 298 // Possible values are: 299 // - "STANDARD" - Achievement is either locked or unlocked. 300 // - "INCREMENTAL" - Achievement is incremental. 301 AchievementType string `json:"achievementType,omitempty"` 302 303 // Description: The description of the achievement. 304 Description string `json:"description,omitempty"` 305 306 // ExperiencePoints: Experience points which will be earned when 307 // unlocking this achievement. 308 ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` 309 310 // FormattedTotalSteps: The total steps for an incremental achievement 311 // as a string. 312 FormattedTotalSteps string `json:"formattedTotalSteps,omitempty"` 313 314 // Id: The ID of the achievement. 315 Id string `json:"id,omitempty"` 316 317 // InitialState: The initial state of the achievement. 318 // Possible values are: 319 // - "HIDDEN" - Achievement is hidden. 320 // - "REVEALED" - Achievement is revealed. 321 // - "UNLOCKED" - Achievement is unlocked. 322 InitialState string `json:"initialState,omitempty"` 323 324 // IsRevealedIconUrlDefault: Indicates whether the revealed icon image 325 // being returned is a default image, or is provided by the game. 326 IsRevealedIconUrlDefault bool `json:"isRevealedIconUrlDefault,omitempty"` 327 328 // IsUnlockedIconUrlDefault: Indicates whether the unlocked icon image 329 // being returned is a default image, or is game-provided. 330 IsUnlockedIconUrlDefault bool `json:"isUnlockedIconUrlDefault,omitempty"` 331 332 // Kind: Uniquely identifies the type of this resource. Value is always 333 // the fixed string games#achievementDefinition. 334 Kind string `json:"kind,omitempty"` 335 336 // Name: The name of the achievement. 337 Name string `json:"name,omitempty"` 338 339 // RevealedIconUrl: The image URL for the revealed achievement icon. 340 RevealedIconUrl string `json:"revealedIconUrl,omitempty"` 341 342 // TotalSteps: The total steps for an incremental achievement. 343 TotalSteps int64 `json:"totalSteps,omitempty"` 344 345 // UnlockedIconUrl: The image URL for the unlocked achievement icon. 346 UnlockedIconUrl string `json:"unlockedIconUrl,omitempty"` 347 348 // ForceSendFields is a list of field names (e.g. "AchievementType") to 349 // unconditionally include in API requests. By default, fields with 350 // empty values are omitted from API requests. However, any non-pointer, 351 // non-interface field appearing in ForceSendFields will be sent to the 352 // server regardless of whether the field is empty or not. This may be 353 // used to include empty fields in Patch requests. 354 ForceSendFields []string `json:"-"` 355 356 // NullFields is a list of field names (e.g. "AchievementType") to 357 // include in API requests with the JSON null value. By default, fields 358 // with empty values are omitted from API requests. However, any field 359 // with an empty value appearing in NullFields will be sent to the 360 // server as null. It is an error if a field in this list has a 361 // non-empty value. This may be used to include null fields in Patch 362 // requests. 363 NullFields []string `json:"-"` 364} 365 366func (s *AchievementDefinition) MarshalJSON() ([]byte, error) { 367 type NoMethod AchievementDefinition 368 raw := NoMethod(*s) 369 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 370} 371 372// AchievementDefinitionsListResponse: This is a JSON template for a 373// list of achievement definition objects. 374type AchievementDefinitionsListResponse struct { 375 // Items: The achievement definitions. 376 Items []*AchievementDefinition `json:"items,omitempty"` 377 378 // Kind: Uniquely identifies the type of this resource. Value is always 379 // the fixed string games#achievementDefinitionsListResponse. 380 Kind string `json:"kind,omitempty"` 381 382 // NextPageToken: Token corresponding to the next page of results. 383 NextPageToken string `json:"nextPageToken,omitempty"` 384 385 // ServerResponse contains the HTTP response code and headers from the 386 // server. 387 googleapi.ServerResponse `json:"-"` 388 389 // ForceSendFields is a list of field names (e.g. "Items") to 390 // unconditionally include in API requests. By default, fields with 391 // empty values are omitted from API requests. However, any non-pointer, 392 // non-interface field appearing in ForceSendFields will be sent to the 393 // server regardless of whether the field is empty or not. This may be 394 // used to include empty fields in Patch requests. 395 ForceSendFields []string `json:"-"` 396 397 // NullFields is a list of field names (e.g. "Items") to include in API 398 // requests with the JSON null value. By default, fields with empty 399 // values are omitted from API requests. However, any field with an 400 // empty value appearing in NullFields will be sent to the server as 401 // null. It is an error if a field in this list has a non-empty value. 402 // This may be used to include null fields in Patch requests. 403 NullFields []string `json:"-"` 404} 405 406func (s *AchievementDefinitionsListResponse) MarshalJSON() ([]byte, error) { 407 type NoMethod AchievementDefinitionsListResponse 408 raw := NoMethod(*s) 409 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 410} 411 412// AchievementIncrementResponse: This is a JSON template for an 413// achievement increment response 414type AchievementIncrementResponse struct { 415 // CurrentSteps: The current steps recorded for this incremental 416 // achievement. 417 CurrentSteps int64 `json:"currentSteps,omitempty"` 418 419 // Kind: Uniquely identifies the type of this resource. Value is always 420 // the fixed string games#achievementIncrementResponse. 421 Kind string `json:"kind,omitempty"` 422 423 // NewlyUnlocked: Whether the current steps for the achievement has 424 // reached the number of steps required to unlock. 425 NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` 426 427 // ServerResponse contains the HTTP response code and headers from the 428 // server. 429 googleapi.ServerResponse `json:"-"` 430 431 // ForceSendFields is a list of field names (e.g. "CurrentSteps") to 432 // unconditionally include in API requests. By default, fields with 433 // empty values are omitted from API requests. However, any non-pointer, 434 // non-interface field appearing in ForceSendFields will be sent to the 435 // server regardless of whether the field is empty or not. This may be 436 // used to include empty fields in Patch requests. 437 ForceSendFields []string `json:"-"` 438 439 // NullFields is a list of field names (e.g. "CurrentSteps") to include 440 // in API requests with the JSON null value. By default, fields with 441 // empty values are omitted from API requests. However, any field with 442 // an empty value appearing in NullFields will be sent to the server as 443 // null. It is an error if a field in this list has a non-empty value. 444 // This may be used to include null fields in Patch requests. 445 NullFields []string `json:"-"` 446} 447 448func (s *AchievementIncrementResponse) MarshalJSON() ([]byte, error) { 449 type NoMethod AchievementIncrementResponse 450 raw := NoMethod(*s) 451 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 452} 453 454// AchievementRevealResponse: This is a JSON template for an achievement 455// reveal response 456type AchievementRevealResponse struct { 457 // CurrentState: The current state of the achievement for which a reveal 458 // was attempted. This might be UNLOCKED if the achievement was already 459 // unlocked. 460 // Possible values are: 461 // - "REVEALED" - Achievement is revealed. 462 // - "UNLOCKED" - Achievement is unlocked. 463 CurrentState string `json:"currentState,omitempty"` 464 465 // Kind: Uniquely identifies the type of this resource. Value is always 466 // the fixed string games#achievementRevealResponse. 467 Kind string `json:"kind,omitempty"` 468 469 // ServerResponse contains the HTTP response code and headers from the 470 // server. 471 googleapi.ServerResponse `json:"-"` 472 473 // ForceSendFields is a list of field names (e.g. "CurrentState") to 474 // unconditionally include in API requests. By default, fields with 475 // empty values are omitted from API requests. However, any non-pointer, 476 // non-interface field appearing in ForceSendFields will be sent to the 477 // server regardless of whether the field is empty or not. This may be 478 // used to include empty fields in Patch requests. 479 ForceSendFields []string `json:"-"` 480 481 // NullFields is a list of field names (e.g. "CurrentState") to include 482 // in API requests with the JSON null value. By default, fields with 483 // empty values are omitted from API requests. However, any field with 484 // an empty value appearing in NullFields will be sent to the server as 485 // null. It is an error if a field in this list has a non-empty value. 486 // This may be used to include null fields in Patch requests. 487 NullFields []string `json:"-"` 488} 489 490func (s *AchievementRevealResponse) MarshalJSON() ([]byte, error) { 491 type NoMethod AchievementRevealResponse 492 raw := NoMethod(*s) 493 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 494} 495 496// AchievementSetStepsAtLeastResponse: This is a JSON template for an 497// achievement set steps at least response. 498type AchievementSetStepsAtLeastResponse struct { 499 // CurrentSteps: The current steps recorded for this incremental 500 // achievement. 501 CurrentSteps int64 `json:"currentSteps,omitempty"` 502 503 // Kind: Uniquely identifies the type of this resource. Value is always 504 // the fixed string games#achievementSetStepsAtLeastResponse. 505 Kind string `json:"kind,omitempty"` 506 507 // NewlyUnlocked: Whether the the current steps for the achievement has 508 // reached the number of steps required to unlock. 509 NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` 510 511 // ServerResponse contains the HTTP response code and headers from the 512 // server. 513 googleapi.ServerResponse `json:"-"` 514 515 // ForceSendFields is a list of field names (e.g. "CurrentSteps") to 516 // unconditionally include in API requests. By default, fields with 517 // empty values are omitted from API requests. However, any non-pointer, 518 // non-interface field appearing in ForceSendFields will be sent to the 519 // server regardless of whether the field is empty or not. This may be 520 // used to include empty fields in Patch requests. 521 ForceSendFields []string `json:"-"` 522 523 // NullFields is a list of field names (e.g. "CurrentSteps") to include 524 // in API requests with the JSON null value. By default, fields with 525 // empty values are omitted from API requests. However, any field with 526 // an empty value appearing in NullFields will be sent to the server as 527 // null. It is an error if a field in this list has a non-empty value. 528 // This may be used to include null fields in Patch requests. 529 NullFields []string `json:"-"` 530} 531 532func (s *AchievementSetStepsAtLeastResponse) MarshalJSON() ([]byte, error) { 533 type NoMethod AchievementSetStepsAtLeastResponse 534 raw := NoMethod(*s) 535 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 536} 537 538// AchievementUnlockResponse: This is a JSON template for an achievement 539// unlock response 540type AchievementUnlockResponse struct { 541 // Kind: Uniquely identifies the type of this resource. Value is always 542 // the fixed string games#achievementUnlockResponse. 543 Kind string `json:"kind,omitempty"` 544 545 // NewlyUnlocked: Whether this achievement was newly unlocked (that is, 546 // whether the unlock request for the achievement was the first for the 547 // player). 548 NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` 549 550 // ServerResponse contains the HTTP response code and headers from the 551 // server. 552 googleapi.ServerResponse `json:"-"` 553 554 // ForceSendFields is a list of field names (e.g. "Kind") to 555 // unconditionally include in API requests. By default, fields with 556 // empty values are omitted from API requests. However, any non-pointer, 557 // non-interface field appearing in ForceSendFields will be sent to the 558 // server regardless of whether the field is empty or not. This may be 559 // used to include empty fields in Patch requests. 560 ForceSendFields []string `json:"-"` 561 562 // NullFields is a list of field names (e.g. "Kind") to include in API 563 // requests with the JSON null value. By default, fields with empty 564 // values are omitted from API requests. However, any field with an 565 // empty value appearing in NullFields will be sent to the server as 566 // null. It is an error if a field in this list has a non-empty value. 567 // This may be used to include null fields in Patch requests. 568 NullFields []string `json:"-"` 569} 570 571func (s *AchievementUnlockResponse) MarshalJSON() ([]byte, error) { 572 type NoMethod AchievementUnlockResponse 573 raw := NoMethod(*s) 574 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 575} 576 577// AchievementUpdateMultipleRequest: This is a JSON template for a list 578// of achievement update requests. 579type AchievementUpdateMultipleRequest struct { 580 // Kind: Uniquely identifies the type of this resource. Value is always 581 // the fixed string games#achievementUpdateMultipleRequest. 582 Kind string `json:"kind,omitempty"` 583 584 // Updates: The individual achievement update requests. 585 Updates []*AchievementUpdateRequest `json:"updates,omitempty"` 586 587 // ForceSendFields is a list of field names (e.g. "Kind") to 588 // unconditionally include in API requests. By default, fields with 589 // empty values are omitted from API requests. However, any non-pointer, 590 // non-interface field appearing in ForceSendFields will be sent to the 591 // server regardless of whether the field is empty or not. This may be 592 // used to include empty fields in Patch requests. 593 ForceSendFields []string `json:"-"` 594 595 // NullFields is a list of field names (e.g. "Kind") to include in API 596 // requests with the JSON null value. By default, fields with empty 597 // values are omitted from API requests. However, any field with an 598 // empty value appearing in NullFields will be sent to the server as 599 // null. It is an error if a field in this list has a non-empty value. 600 // This may be used to include null fields in Patch requests. 601 NullFields []string `json:"-"` 602} 603 604func (s *AchievementUpdateMultipleRequest) MarshalJSON() ([]byte, error) { 605 type NoMethod AchievementUpdateMultipleRequest 606 raw := NoMethod(*s) 607 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 608} 609 610// AchievementUpdateMultipleResponse: This is a JSON template for an 611// achievement unlock response. 612type AchievementUpdateMultipleResponse struct { 613 // Kind: Uniquely identifies the type of this resource. Value is always 614 // the fixed string games#achievementUpdateListResponse. 615 Kind string `json:"kind,omitempty"` 616 617 // UpdatedAchievements: The updated state of the achievements. 618 UpdatedAchievements []*AchievementUpdateResponse `json:"updatedAchievements,omitempty"` 619 620 // ServerResponse contains the HTTP response code and headers from the 621 // server. 622 googleapi.ServerResponse `json:"-"` 623 624 // ForceSendFields is a list of field names (e.g. "Kind") to 625 // unconditionally include in API requests. By default, fields with 626 // empty values are omitted from API requests. However, any non-pointer, 627 // non-interface field appearing in ForceSendFields will be sent to the 628 // server regardless of whether the field is empty or not. This may be 629 // used to include empty fields in Patch requests. 630 ForceSendFields []string `json:"-"` 631 632 // NullFields is a list of field names (e.g. "Kind") to include in API 633 // requests with the JSON null value. By default, fields with empty 634 // values are omitted from API requests. However, any field with an 635 // empty value appearing in NullFields will be sent to the server as 636 // null. It is an error if a field in this list has a non-empty value. 637 // This may be used to include null fields in Patch requests. 638 NullFields []string `json:"-"` 639} 640 641func (s *AchievementUpdateMultipleResponse) MarshalJSON() ([]byte, error) { 642 type NoMethod AchievementUpdateMultipleResponse 643 raw := NoMethod(*s) 644 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 645} 646 647// AchievementUpdateRequest: This is a JSON template for a request to 648// update an achievement. 649type AchievementUpdateRequest struct { 650 // AchievementId: The achievement this update is being applied to. 651 AchievementId string `json:"achievementId,omitempty"` 652 653 // IncrementPayload: The payload if an update of type INCREMENT was 654 // requested for the achievement. 655 IncrementPayload *GamesAchievementIncrement `json:"incrementPayload,omitempty"` 656 657 // Kind: Uniquely identifies the type of this resource. Value is always 658 // the fixed string games#achievementUpdateRequest. 659 Kind string `json:"kind,omitempty"` 660 661 // SetStepsAtLeastPayload: The payload if an update of type 662 // SET_STEPS_AT_LEAST was requested for the achievement. 663 SetStepsAtLeastPayload *GamesAchievementSetStepsAtLeast `json:"setStepsAtLeastPayload,omitempty"` 664 665 // UpdateType: The type of update being applied. 666 // Possible values are: 667 // - "REVEAL" - Achievement is revealed. 668 // - "UNLOCK" - Achievement is unlocked. 669 // - "INCREMENT" - Achievement is incremented. 670 // - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the 671 // passed value. 672 UpdateType string `json:"updateType,omitempty"` 673 674 // ForceSendFields is a list of field names (e.g. "AchievementId") to 675 // unconditionally include in API requests. By default, fields with 676 // empty values are omitted from API requests. However, any non-pointer, 677 // non-interface field appearing in ForceSendFields will be sent to the 678 // server regardless of whether the field is empty or not. This may be 679 // used to include empty fields in Patch requests. 680 ForceSendFields []string `json:"-"` 681 682 // NullFields is a list of field names (e.g. "AchievementId") to include 683 // in API requests with the JSON null value. By default, fields with 684 // empty values are omitted from API requests. However, any field with 685 // an empty value appearing in NullFields will be sent to the server as 686 // null. It is an error if a field in this list has a non-empty value. 687 // This may be used to include null fields in Patch requests. 688 NullFields []string `json:"-"` 689} 690 691func (s *AchievementUpdateRequest) MarshalJSON() ([]byte, error) { 692 type NoMethod AchievementUpdateRequest 693 raw := NoMethod(*s) 694 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 695} 696 697// AchievementUpdateResponse: This is a JSON template for an achievement 698// update response. 699type AchievementUpdateResponse struct { 700 // AchievementId: The achievement this update is was applied to. 701 AchievementId string `json:"achievementId,omitempty"` 702 703 // CurrentState: The current state of the achievement. 704 // Possible values are: 705 // - "HIDDEN" - Achievement is hidden. 706 // - "REVEALED" - Achievement is revealed. 707 // - "UNLOCKED" - Achievement is unlocked. 708 CurrentState string `json:"currentState,omitempty"` 709 710 // CurrentSteps: The current steps recorded for this achievement if it 711 // is incremental. 712 CurrentSteps int64 `json:"currentSteps,omitempty"` 713 714 // Kind: Uniquely identifies the type of this resource. Value is always 715 // the fixed string games#achievementUpdateResponse. 716 Kind string `json:"kind,omitempty"` 717 718 // NewlyUnlocked: Whether this achievement was newly unlocked (that is, 719 // whether the unlock request for the achievement was the first for the 720 // player). 721 NewlyUnlocked bool `json:"newlyUnlocked,omitempty"` 722 723 // UpdateOccurred: Whether the requested updates actually affected the 724 // achievement. 725 UpdateOccurred bool `json:"updateOccurred,omitempty"` 726 727 // ForceSendFields is a list of field names (e.g. "AchievementId") to 728 // unconditionally include in API requests. By default, fields with 729 // empty values are omitted from API requests. However, any non-pointer, 730 // non-interface field appearing in ForceSendFields will be sent to the 731 // server regardless of whether the field is empty or not. This may be 732 // used to include empty fields in Patch requests. 733 ForceSendFields []string `json:"-"` 734 735 // NullFields is a list of field names (e.g. "AchievementId") to include 736 // in API requests with the JSON null value. By default, fields with 737 // empty values are omitted from API requests. However, any field with 738 // an empty value appearing in NullFields will be sent to the server as 739 // null. It is an error if a field in this list has a non-empty value. 740 // This may be used to include null fields in Patch requests. 741 NullFields []string `json:"-"` 742} 743 744func (s *AchievementUpdateResponse) MarshalJSON() ([]byte, error) { 745 type NoMethod AchievementUpdateResponse 746 raw := NoMethod(*s) 747 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 748} 749 750// AggregateStats: This is a JSON template for aggregate stats. 751type AggregateStats struct { 752 // Count: The number of messages sent between a pair of peers. 753 Count int64 `json:"count,omitempty,string"` 754 755 // Kind: Uniquely identifies the type of this resource. Value is always 756 // the fixed string games#aggregateStats. 757 Kind string `json:"kind,omitempty"` 758 759 // Max: The maximum amount. 760 Max int64 `json:"max,omitempty,string"` 761 762 // Min: The minimum amount. 763 Min int64 `json:"min,omitempty,string"` 764 765 // Sum: The total number of bytes sent for messages between a pair of 766 // peers. 767 Sum int64 `json:"sum,omitempty,string"` 768 769 // ForceSendFields is a list of field names (e.g. "Count") to 770 // unconditionally include in API requests. By default, fields with 771 // empty values are omitted from API requests. However, any non-pointer, 772 // non-interface field appearing in ForceSendFields will be sent to the 773 // server regardless of whether the field is empty or not. This may be 774 // used to include empty fields in Patch requests. 775 ForceSendFields []string `json:"-"` 776 777 // NullFields is a list of field names (e.g. "Count") to include in API 778 // requests with the JSON null value. By default, fields with empty 779 // values are omitted from API requests. However, any field with an 780 // empty value appearing in NullFields will be sent to the server as 781 // null. It is an error if a field in this list has a non-empty value. 782 // This may be used to include null fields in Patch requests. 783 NullFields []string `json:"-"` 784} 785 786func (s *AggregateStats) MarshalJSON() ([]byte, error) { 787 type NoMethod AggregateStats 788 raw := NoMethod(*s) 789 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 790} 791 792// AnonymousPlayer: This is a JSON template for an anonymous player 793type AnonymousPlayer struct { 794 // AvatarImageUrl: The base URL for the image to display for the 795 // anonymous player. 796 AvatarImageUrl string `json:"avatarImageUrl,omitempty"` 797 798 // DisplayName: The name to display for the anonymous player. 799 DisplayName string `json:"displayName,omitempty"` 800 801 // Kind: Uniquely identifies the type of this resource. Value is always 802 // the fixed string games#anonymousPlayer. 803 Kind string `json:"kind,omitempty"` 804 805 // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to 806 // unconditionally include in API requests. By default, fields with 807 // empty values are omitted from API requests. However, any non-pointer, 808 // non-interface field appearing in ForceSendFields will be sent to the 809 // server regardless of whether the field is empty or not. This may be 810 // used to include empty fields in Patch requests. 811 ForceSendFields []string `json:"-"` 812 813 // NullFields is a list of field names (e.g. "AvatarImageUrl") to 814 // include in API requests with the JSON null value. By default, fields 815 // with empty values are omitted from API requests. However, any field 816 // with an empty value appearing in NullFields will be sent to the 817 // server as null. It is an error if a field in this list has a 818 // non-empty value. This may be used to include null fields in Patch 819 // requests. 820 NullFields []string `json:"-"` 821} 822 823func (s *AnonymousPlayer) MarshalJSON() ([]byte, error) { 824 type NoMethod AnonymousPlayer 825 raw := NoMethod(*s) 826 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 827} 828 829// Application: This is a JSON template for the Application resource. 830type Application struct { 831 // AchievementCount: The number of achievements visible to the currently 832 // authenticated player. 833 AchievementCount int64 `json:"achievement_count,omitempty"` 834 835 // Assets: The assets of the application. 836 Assets []*ImageAsset `json:"assets,omitempty"` 837 838 // Author: The author of the application. 839 Author string `json:"author,omitempty"` 840 841 // Category: The category of the application. 842 Category *ApplicationCategory `json:"category,omitempty"` 843 844 // Description: The description of the application. 845 Description string `json:"description,omitempty"` 846 847 // EnabledFeatures: A list of features that have been enabled for the 848 // application. 849 // Possible values are: 850 // - "SNAPSHOTS" - Snapshots has been enabled 851 EnabledFeatures []string `json:"enabledFeatures,omitempty"` 852 853 // Id: The ID of the application. 854 Id string `json:"id,omitempty"` 855 856 // Instances: The instances of the application. 857 Instances []*Instance `json:"instances,omitempty"` 858 859 // Kind: Uniquely identifies the type of this resource. Value is always 860 // the fixed string games#application. 861 Kind string `json:"kind,omitempty"` 862 863 // LastUpdatedTimestamp: The last updated timestamp of the application. 864 LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"` 865 866 // LeaderboardCount: The number of leaderboards visible to the currently 867 // authenticated player. 868 LeaderboardCount int64 `json:"leaderboard_count,omitempty"` 869 870 // Name: The name of the application. 871 Name string `json:"name,omitempty"` 872 873 // ThemeColor: A hint to the client UI for what color to use as an 874 // app-themed color. The color is given as an RGB triplet (e.g. 875 // "E0E0E0"). 876 ThemeColor string `json:"themeColor,omitempty"` 877 878 // ServerResponse contains the HTTP response code and headers from the 879 // server. 880 googleapi.ServerResponse `json:"-"` 881 882 // ForceSendFields is a list of field names (e.g. "AchievementCount") to 883 // unconditionally include in API requests. By default, fields with 884 // empty values are omitted from API requests. However, any non-pointer, 885 // non-interface field appearing in ForceSendFields will be sent to the 886 // server regardless of whether the field is empty or not. This may be 887 // used to include empty fields in Patch requests. 888 ForceSendFields []string `json:"-"` 889 890 // NullFields is a list of field names (e.g. "AchievementCount") to 891 // include in API requests with the JSON null value. By default, fields 892 // with empty values are omitted from API requests. However, any field 893 // with an empty value appearing in NullFields will be sent to the 894 // server as null. It is an error if a field in this list has a 895 // non-empty value. This may be used to include null fields in Patch 896 // requests. 897 NullFields []string `json:"-"` 898} 899 900func (s *Application) MarshalJSON() ([]byte, error) { 901 type NoMethod Application 902 raw := NoMethod(*s) 903 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 904} 905 906// ApplicationCategory: This is a JSON template for an application 907// category object. 908type ApplicationCategory struct { 909 // Kind: Uniquely identifies the type of this resource. Value is always 910 // the fixed string games#applicationCategory. 911 Kind string `json:"kind,omitempty"` 912 913 // Primary: The primary category. 914 Primary string `json:"primary,omitempty"` 915 916 // Secondary: The secondary category. 917 Secondary string `json:"secondary,omitempty"` 918 919 // ForceSendFields is a list of field names (e.g. "Kind") to 920 // unconditionally include in API requests. By default, fields with 921 // empty values are omitted from API requests. However, any non-pointer, 922 // non-interface field appearing in ForceSendFields will be sent to the 923 // server regardless of whether the field is empty or not. This may be 924 // used to include empty fields in Patch requests. 925 ForceSendFields []string `json:"-"` 926 927 // NullFields is a list of field names (e.g. "Kind") to include in API 928 // requests with the JSON null value. By default, fields with empty 929 // values are omitted from API requests. However, any field with an 930 // empty value appearing in NullFields will be sent to the server as 931 // null. It is an error if a field in this list has a non-empty value. 932 // This may be used to include null fields in Patch requests. 933 NullFields []string `json:"-"` 934} 935 936func (s *ApplicationCategory) MarshalJSON() ([]byte, error) { 937 type NoMethod ApplicationCategory 938 raw := NoMethod(*s) 939 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 940} 941 942// ApplicationVerifyResponse: This is a JSON template for a third party 943// application verification response resource. 944type ApplicationVerifyResponse struct { 945 // AlternatePlayerId: An alternate ID that was once used for the player 946 // that was issued the auth token used in this request. (This field is 947 // not normally populated.) 948 AlternatePlayerId string `json:"alternate_player_id,omitempty"` 949 950 // Kind: Uniquely identifies the type of this resource. Value is always 951 // the fixed string games#applicationVerifyResponse. 952 Kind string `json:"kind,omitempty"` 953 954 // PlayerId: The ID of the player that was issued the auth token used in 955 // this request. 956 PlayerId string `json:"player_id,omitempty"` 957 958 // ServerResponse contains the HTTP response code and headers from the 959 // server. 960 googleapi.ServerResponse `json:"-"` 961 962 // ForceSendFields is a list of field names (e.g. "AlternatePlayerId") 963 // to unconditionally include in API requests. By default, fields with 964 // empty values are omitted from API requests. However, any non-pointer, 965 // non-interface field appearing in ForceSendFields will be sent to the 966 // server regardless of whether the field is empty or not. This may be 967 // used to include empty fields in Patch requests. 968 ForceSendFields []string `json:"-"` 969 970 // NullFields is a list of field names (e.g. "AlternatePlayerId") to 971 // include in API requests with the JSON null value. By default, fields 972 // with empty values are omitted from API requests. However, any field 973 // with an empty value appearing in NullFields will be sent to the 974 // server as null. It is an error if a field in this list has a 975 // non-empty value. This may be used to include null fields in Patch 976 // requests. 977 NullFields []string `json:"-"` 978} 979 980func (s *ApplicationVerifyResponse) MarshalJSON() ([]byte, error) { 981 type NoMethod ApplicationVerifyResponse 982 raw := NoMethod(*s) 983 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 984} 985 986// Category: This is a JSON template for data related to individual game 987// categories. 988type Category struct { 989 // Category: The category name. 990 Category string `json:"category,omitempty"` 991 992 // ExperiencePoints: Experience points earned in this category. 993 ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` 994 995 // Kind: Uniquely identifies the type of this resource. Value is always 996 // the fixed string games#category. 997 Kind string `json:"kind,omitempty"` 998 999 // ForceSendFields is a list of field names (e.g. "Category") to 1000 // unconditionally include in API requests. By default, fields with 1001 // empty values are omitted from API requests. However, any non-pointer, 1002 // non-interface field appearing in ForceSendFields will be sent to the 1003 // server regardless of whether the field is empty or not. This may be 1004 // used to include empty fields in Patch requests. 1005 ForceSendFields []string `json:"-"` 1006 1007 // NullFields is a list of field names (e.g. "Category") to include in 1008 // API requests with the JSON null value. By default, fields with empty 1009 // values are omitted from API requests. However, any field with an 1010 // empty value appearing in NullFields will be sent to the server as 1011 // null. It is an error if a field in this list has a non-empty value. 1012 // This may be used to include null fields in Patch requests. 1013 NullFields []string `json:"-"` 1014} 1015 1016func (s *Category) MarshalJSON() ([]byte, error) { 1017 type NoMethod Category 1018 raw := NoMethod(*s) 1019 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1020} 1021 1022// CategoryListResponse: This is a JSON template for a list of category 1023// data objects. 1024type CategoryListResponse struct { 1025 // Items: The list of categories with usage data. 1026 Items []*Category `json:"items,omitempty"` 1027 1028 // Kind: Uniquely identifies the type of this resource. Value is always 1029 // the fixed string games#categoryListResponse. 1030 Kind string `json:"kind,omitempty"` 1031 1032 // NextPageToken: Token corresponding to the next page of results. 1033 NextPageToken string `json:"nextPageToken,omitempty"` 1034 1035 // ServerResponse contains the HTTP response code and headers from the 1036 // server. 1037 googleapi.ServerResponse `json:"-"` 1038 1039 // ForceSendFields is a list of field names (e.g. "Items") to 1040 // unconditionally include in API requests. By default, fields with 1041 // empty values are omitted from API requests. However, any non-pointer, 1042 // non-interface field appearing in ForceSendFields will be sent to the 1043 // server regardless of whether the field is empty or not. This may be 1044 // used to include empty fields in Patch requests. 1045 ForceSendFields []string `json:"-"` 1046 1047 // NullFields is a list of field names (e.g. "Items") to include in API 1048 // requests with the JSON null value. By default, fields with empty 1049 // values are omitted from API requests. However, any field with an 1050 // empty value appearing in NullFields will be sent to the server as 1051 // null. It is an error if a field in this list has a non-empty value. 1052 // This may be used to include null fields in Patch requests. 1053 NullFields []string `json:"-"` 1054} 1055 1056func (s *CategoryListResponse) MarshalJSON() ([]byte, error) { 1057 type NoMethod CategoryListResponse 1058 raw := NoMethod(*s) 1059 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1060} 1061 1062// EventBatchRecordFailure: This is a JSON template for a batch update 1063// failure resource. 1064type EventBatchRecordFailure struct { 1065 // FailureCause: The cause for the update failure. 1066 // Possible values are: 1067 // - "TOO_LARGE": A batch request was issued with more events than are 1068 // allowed in a single batch. 1069 // - "TIME_PERIOD_EXPIRED": A batch was sent with data too far in the 1070 // past to record. 1071 // - "TIME_PERIOD_SHORT": A batch was sent with a time range that was 1072 // too short. 1073 // - "TIME_PERIOD_LONG": A batch was sent with a time range that was too 1074 // long. 1075 // - "ALREADY_UPDATED": An attempt was made to record a batch of data 1076 // which was already seen. 1077 // - "RECORD_RATE_HIGH": An attempt was made to record data faster than 1078 // the server will apply updates. 1079 FailureCause string `json:"failureCause,omitempty"` 1080 1081 // Kind: Uniquely identifies the type of this resource. Value is always 1082 // the fixed string games#eventBatchRecordFailure. 1083 Kind string `json:"kind,omitempty"` 1084 1085 // Range: The time range which was rejected; empty for a request-wide 1086 // failure. 1087 Range *EventPeriodRange `json:"range,omitempty"` 1088 1089 // ForceSendFields is a list of field names (e.g. "FailureCause") to 1090 // unconditionally include in API requests. By default, fields with 1091 // empty values are omitted from API requests. However, any non-pointer, 1092 // non-interface field appearing in ForceSendFields will be sent to the 1093 // server regardless of whether the field is empty or not. This may be 1094 // used to include empty fields in Patch requests. 1095 ForceSendFields []string `json:"-"` 1096 1097 // NullFields is a list of field names (e.g. "FailureCause") to include 1098 // in API requests with the JSON null value. By default, fields with 1099 // empty values are omitted from API requests. However, any field with 1100 // an empty value appearing in NullFields will be sent to the server as 1101 // null. It is an error if a field in this list has a non-empty value. 1102 // This may be used to include null fields in Patch requests. 1103 NullFields []string `json:"-"` 1104} 1105 1106func (s *EventBatchRecordFailure) MarshalJSON() ([]byte, error) { 1107 type NoMethod EventBatchRecordFailure 1108 raw := NoMethod(*s) 1109 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1110} 1111 1112// EventChild: This is a JSON template for an event child relationship 1113// resource. 1114type EventChild struct { 1115 // ChildId: The ID of the child event. 1116 ChildId string `json:"childId,omitempty"` 1117 1118 // Kind: Uniquely identifies the type of this resource. Value is always 1119 // the fixed string games#eventChild. 1120 Kind string `json:"kind,omitempty"` 1121 1122 // ForceSendFields is a list of field names (e.g. "ChildId") to 1123 // unconditionally include in API requests. By default, fields with 1124 // empty values are omitted from API requests. However, any non-pointer, 1125 // non-interface field appearing in ForceSendFields will be sent to the 1126 // server regardless of whether the field is empty or not. This may be 1127 // used to include empty fields in Patch requests. 1128 ForceSendFields []string `json:"-"` 1129 1130 // NullFields is a list of field names (e.g. "ChildId") to include in 1131 // API requests with the JSON null value. By default, fields with empty 1132 // values are omitted from API requests. However, any field with an 1133 // empty value appearing in NullFields will be sent to the server as 1134 // null. It is an error if a field in this list has a non-empty value. 1135 // This may be used to include null fields in Patch requests. 1136 NullFields []string `json:"-"` 1137} 1138 1139func (s *EventChild) MarshalJSON() ([]byte, error) { 1140 type NoMethod EventChild 1141 raw := NoMethod(*s) 1142 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1143} 1144 1145// EventDefinition: This is a JSON template for an event definition 1146// resource. 1147type EventDefinition struct { 1148 // ChildEvents: A list of events that are a child of this event. 1149 ChildEvents []*EventChild `json:"childEvents,omitempty"` 1150 1151 // Description: Description of what this event represents. 1152 Description string `json:"description,omitempty"` 1153 1154 // DisplayName: The name to display for the event. 1155 DisplayName string `json:"displayName,omitempty"` 1156 1157 // Id: The ID of the event. 1158 Id string `json:"id,omitempty"` 1159 1160 // ImageUrl: The base URL for the image that represents the event. 1161 ImageUrl string `json:"imageUrl,omitempty"` 1162 1163 // IsDefaultImageUrl: Indicates whether the icon image being returned is 1164 // a default image, or is game-provided. 1165 IsDefaultImageUrl bool `json:"isDefaultImageUrl,omitempty"` 1166 1167 // Kind: Uniquely identifies the type of this resource. Value is always 1168 // the fixed string games#eventDefinition. 1169 Kind string `json:"kind,omitempty"` 1170 1171 // Visibility: The visibility of event being tracked in this 1172 // definition. 1173 // Possible values are: 1174 // - "REVEALED": This event should be visible to all users. 1175 // - "HIDDEN": This event should only be shown to users that have 1176 // recorded this event at least once. 1177 Visibility string `json:"visibility,omitempty"` 1178 1179 // ForceSendFields is a list of field names (e.g. "ChildEvents") to 1180 // unconditionally include in API requests. By default, fields with 1181 // empty values are omitted from API requests. However, any non-pointer, 1182 // non-interface field appearing in ForceSendFields will be sent to the 1183 // server regardless of whether the field is empty or not. This may be 1184 // used to include empty fields in Patch requests. 1185 ForceSendFields []string `json:"-"` 1186 1187 // NullFields is a list of field names (e.g. "ChildEvents") to include 1188 // in API requests with the JSON null value. By default, fields with 1189 // empty values are omitted from API requests. However, any field with 1190 // an empty value appearing in NullFields will be sent to the server as 1191 // null. It is an error if a field in this list has a non-empty value. 1192 // This may be used to include null fields in Patch requests. 1193 NullFields []string `json:"-"` 1194} 1195 1196func (s *EventDefinition) MarshalJSON() ([]byte, error) { 1197 type NoMethod EventDefinition 1198 raw := NoMethod(*s) 1199 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1200} 1201 1202// EventDefinitionListResponse: This is a JSON template for a 1203// ListDefinitions response. 1204type EventDefinitionListResponse struct { 1205 // Items: The event definitions. 1206 Items []*EventDefinition `json:"items,omitempty"` 1207 1208 // Kind: Uniquely identifies the type of this resource. Value is always 1209 // the fixed string games#eventDefinitionListResponse. 1210 Kind string `json:"kind,omitempty"` 1211 1212 // NextPageToken: The pagination token for the next page of results. 1213 NextPageToken string `json:"nextPageToken,omitempty"` 1214 1215 // ServerResponse contains the HTTP response code and headers from the 1216 // server. 1217 googleapi.ServerResponse `json:"-"` 1218 1219 // ForceSendFields is a list of field names (e.g. "Items") to 1220 // unconditionally include in API requests. By default, fields with 1221 // empty values are omitted from API requests. However, any non-pointer, 1222 // non-interface field appearing in ForceSendFields will be sent to the 1223 // server regardless of whether the field is empty or not. This may be 1224 // used to include empty fields in Patch requests. 1225 ForceSendFields []string `json:"-"` 1226 1227 // NullFields is a list of field names (e.g. "Items") to include in API 1228 // requests with the JSON null value. By default, fields with empty 1229 // values are omitted from API requests. However, any field with an 1230 // empty value appearing in NullFields will be sent to the server as 1231 // null. It is an error if a field in this list has a non-empty value. 1232 // This may be used to include null fields in Patch requests. 1233 NullFields []string `json:"-"` 1234} 1235 1236func (s *EventDefinitionListResponse) MarshalJSON() ([]byte, error) { 1237 type NoMethod EventDefinitionListResponse 1238 raw := NoMethod(*s) 1239 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1240} 1241 1242// EventPeriodRange: This is a JSON template for an event period time 1243// range. 1244type EventPeriodRange struct { 1245 // Kind: Uniquely identifies the type of this resource. Value is always 1246 // the fixed string games#eventPeriodRange. 1247 Kind string `json:"kind,omitempty"` 1248 1249 // PeriodEndMillis: The time when this update period ends, in millis, 1250 // since 1970 UTC (Unix Epoch). 1251 PeriodEndMillis int64 `json:"periodEndMillis,omitempty,string"` 1252 1253 // PeriodStartMillis: The time when this update period begins, in 1254 // millis, since 1970 UTC (Unix Epoch). 1255 PeriodStartMillis int64 `json:"periodStartMillis,omitempty,string"` 1256 1257 // ForceSendFields is a list of field names (e.g. "Kind") to 1258 // unconditionally include in API requests. By default, fields with 1259 // empty values are omitted from API requests. However, any non-pointer, 1260 // non-interface field appearing in ForceSendFields will be sent to the 1261 // server regardless of whether the field is empty or not. This may be 1262 // used to include empty fields in Patch requests. 1263 ForceSendFields []string `json:"-"` 1264 1265 // NullFields is a list of field names (e.g. "Kind") to include in API 1266 // requests with the JSON null value. By default, fields with empty 1267 // values are omitted from API requests. However, any field with an 1268 // empty value appearing in NullFields will be sent to the server as 1269 // null. It is an error if a field in this list has a non-empty value. 1270 // This may be used to include null fields in Patch requests. 1271 NullFields []string `json:"-"` 1272} 1273 1274func (s *EventPeriodRange) MarshalJSON() ([]byte, error) { 1275 type NoMethod EventPeriodRange 1276 raw := NoMethod(*s) 1277 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1278} 1279 1280// EventPeriodUpdate: This is a JSON template for an event period update 1281// resource. 1282type EventPeriodUpdate struct { 1283 // Kind: Uniquely identifies the type of this resource. Value is always 1284 // the fixed string games#eventPeriodUpdate. 1285 Kind string `json:"kind,omitempty"` 1286 1287 // TimePeriod: The time period being covered by this update. 1288 TimePeriod *EventPeriodRange `json:"timePeriod,omitempty"` 1289 1290 // Updates: The updates being made for this time period. 1291 Updates []*EventUpdateRequest `json:"updates,omitempty"` 1292 1293 // ForceSendFields is a list of field names (e.g. "Kind") to 1294 // unconditionally include in API requests. By default, fields with 1295 // empty values are omitted from API requests. However, any non-pointer, 1296 // non-interface field appearing in ForceSendFields will be sent to the 1297 // server regardless of whether the field is empty or not. This may be 1298 // used to include empty fields in Patch requests. 1299 ForceSendFields []string `json:"-"` 1300 1301 // NullFields is a list of field names (e.g. "Kind") to include in API 1302 // requests with the JSON null value. By default, fields with empty 1303 // values are omitted from API requests. However, any field with an 1304 // empty value appearing in NullFields will be sent to the server as 1305 // null. It is an error if a field in this list has a non-empty value. 1306 // This may be used to include null fields in Patch requests. 1307 NullFields []string `json:"-"` 1308} 1309 1310func (s *EventPeriodUpdate) MarshalJSON() ([]byte, error) { 1311 type NoMethod EventPeriodUpdate 1312 raw := NoMethod(*s) 1313 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1314} 1315 1316// EventRecordFailure: This is a JSON template for an event update 1317// failure resource. 1318type EventRecordFailure struct { 1319 // EventId: The ID of the event that was not updated. 1320 EventId string `json:"eventId,omitempty"` 1321 1322 // FailureCause: The cause for the update failure. 1323 // Possible values are: 1324 // - "NOT_FOUND" - An attempt was made to set an event that was not 1325 // defined. 1326 // - "INVALID_UPDATE_VALUE" - An attempt was made to increment an event 1327 // by a non-positive value. 1328 FailureCause string `json:"failureCause,omitempty"` 1329 1330 // Kind: Uniquely identifies the type of this resource. Value is always 1331 // the fixed string games#eventRecordFailure. 1332 Kind string `json:"kind,omitempty"` 1333 1334 // ForceSendFields is a list of field names (e.g. "EventId") to 1335 // unconditionally include in API requests. By default, fields with 1336 // empty values are omitted from API requests. However, any non-pointer, 1337 // non-interface field appearing in ForceSendFields will be sent to the 1338 // server regardless of whether the field is empty or not. This may be 1339 // used to include empty fields in Patch requests. 1340 ForceSendFields []string `json:"-"` 1341 1342 // NullFields is a list of field names (e.g. "EventId") to include in 1343 // API requests with the JSON null value. By default, fields with empty 1344 // values are omitted from API requests. However, any field with an 1345 // empty value appearing in NullFields will be sent to the server as 1346 // null. It is an error if a field in this list has a non-empty value. 1347 // This may be used to include null fields in Patch requests. 1348 NullFields []string `json:"-"` 1349} 1350 1351func (s *EventRecordFailure) MarshalJSON() ([]byte, error) { 1352 type NoMethod EventRecordFailure 1353 raw := NoMethod(*s) 1354 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1355} 1356 1357// EventRecordRequest: This is a JSON template for an event period 1358// update resource. 1359type EventRecordRequest struct { 1360 // CurrentTimeMillis: The current time when this update was sent, in 1361 // milliseconds, since 1970 UTC (Unix Epoch). 1362 CurrentTimeMillis int64 `json:"currentTimeMillis,omitempty,string"` 1363 1364 // Kind: Uniquely identifies the type of this resource. Value is always 1365 // the fixed string games#eventRecordRequest. 1366 Kind string `json:"kind,omitempty"` 1367 1368 // RequestId: The request ID used to identify this attempt to record 1369 // events. 1370 RequestId int64 `json:"requestId,omitempty,string"` 1371 1372 // TimePeriods: A list of the time period updates being made in this 1373 // request. 1374 TimePeriods []*EventPeriodUpdate `json:"timePeriods,omitempty"` 1375 1376 // ForceSendFields is a list of field names (e.g. "CurrentTimeMillis") 1377 // to unconditionally include in API requests. By default, fields with 1378 // empty values are omitted from API requests. However, any non-pointer, 1379 // non-interface field appearing in ForceSendFields will be sent to the 1380 // server regardless of whether the field is empty or not. This may be 1381 // used to include empty fields in Patch requests. 1382 ForceSendFields []string `json:"-"` 1383 1384 // NullFields is a list of field names (e.g. "CurrentTimeMillis") to 1385 // include in API requests with the JSON null value. By default, fields 1386 // with empty values are omitted from API requests. However, any field 1387 // with an empty value appearing in NullFields will be sent to the 1388 // server as null. It is an error if a field in this list has a 1389 // non-empty value. This may be used to include null fields in Patch 1390 // requests. 1391 NullFields []string `json:"-"` 1392} 1393 1394func (s *EventRecordRequest) MarshalJSON() ([]byte, error) { 1395 type NoMethod EventRecordRequest 1396 raw := NoMethod(*s) 1397 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1398} 1399 1400// EventUpdateRequest: This is a JSON template for an event period 1401// update resource. 1402type EventUpdateRequest struct { 1403 // DefinitionId: The ID of the event being modified in this update. 1404 DefinitionId string `json:"definitionId,omitempty"` 1405 1406 // Kind: Uniquely identifies the type of this resource. Value is always 1407 // the fixed string games#eventUpdateRequest. 1408 Kind string `json:"kind,omitempty"` 1409 1410 // UpdateCount: The number of times this event occurred in this time 1411 // period. 1412 UpdateCount int64 `json:"updateCount,omitempty,string"` 1413 1414 // ForceSendFields is a list of field names (e.g. "DefinitionId") to 1415 // unconditionally include in API requests. By default, fields with 1416 // empty values are omitted from API requests. However, any non-pointer, 1417 // non-interface field appearing in ForceSendFields will be sent to the 1418 // server regardless of whether the field is empty or not. This may be 1419 // used to include empty fields in Patch requests. 1420 ForceSendFields []string `json:"-"` 1421 1422 // NullFields is a list of field names (e.g. "DefinitionId") to include 1423 // in API requests with the JSON null value. By default, fields with 1424 // empty values are omitted from API requests. However, any field with 1425 // an empty value appearing in NullFields will be sent to the server as 1426 // null. It is an error if a field in this list has a non-empty value. 1427 // This may be used to include null fields in Patch requests. 1428 NullFields []string `json:"-"` 1429} 1430 1431func (s *EventUpdateRequest) MarshalJSON() ([]byte, error) { 1432 type NoMethod EventUpdateRequest 1433 raw := NoMethod(*s) 1434 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1435} 1436 1437// EventUpdateResponse: This is a JSON template for an event period 1438// update resource. 1439type EventUpdateResponse struct { 1440 // BatchFailures: Any batch-wide failures which occurred applying 1441 // updates. 1442 BatchFailures []*EventBatchRecordFailure `json:"batchFailures,omitempty"` 1443 1444 // EventFailures: Any failures updating a particular event. 1445 EventFailures []*EventRecordFailure `json:"eventFailures,omitempty"` 1446 1447 // Kind: Uniquely identifies the type of this resource. Value is always 1448 // the fixed string games#eventUpdateResponse. 1449 Kind string `json:"kind,omitempty"` 1450 1451 // PlayerEvents: The current status of any updated events 1452 PlayerEvents []*PlayerEvent `json:"playerEvents,omitempty"` 1453 1454 // ServerResponse contains the HTTP response code and headers from the 1455 // server. 1456 googleapi.ServerResponse `json:"-"` 1457 1458 // ForceSendFields is a list of field names (e.g. "BatchFailures") to 1459 // unconditionally include in API requests. By default, fields with 1460 // empty values are omitted from API requests. However, any non-pointer, 1461 // non-interface field appearing in ForceSendFields will be sent to the 1462 // server regardless of whether the field is empty or not. This may be 1463 // used to include empty fields in Patch requests. 1464 ForceSendFields []string `json:"-"` 1465 1466 // NullFields is a list of field names (e.g. "BatchFailures") to include 1467 // in API requests with the JSON null value. By default, fields with 1468 // empty values are omitted from API requests. However, any field with 1469 // an empty value appearing in NullFields will be sent to the server as 1470 // null. It is an error if a field in this list has a non-empty value. 1471 // This may be used to include null fields in Patch requests. 1472 NullFields []string `json:"-"` 1473} 1474 1475func (s *EventUpdateResponse) MarshalJSON() ([]byte, error) { 1476 type NoMethod EventUpdateResponse 1477 raw := NoMethod(*s) 1478 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1479} 1480 1481// GamesAchievementIncrement: This is a JSON template for the payload to 1482// request to increment an achievement. 1483type GamesAchievementIncrement struct { 1484 // Kind: Uniquely identifies the type of this resource. Value is always 1485 // the fixed string games#GamesAchievementIncrement. 1486 Kind string `json:"kind,omitempty"` 1487 1488 // RequestId: The requestId associated with an increment to an 1489 // achievement. 1490 RequestId int64 `json:"requestId,omitempty,string"` 1491 1492 // Steps: The number of steps to be incremented. 1493 Steps int64 `json:"steps,omitempty"` 1494 1495 // ForceSendFields is a list of field names (e.g. "Kind") to 1496 // unconditionally include in API requests. By default, fields with 1497 // empty values are omitted from API requests. However, any non-pointer, 1498 // non-interface field appearing in ForceSendFields will be sent to the 1499 // server regardless of whether the field is empty or not. This may be 1500 // used to include empty fields in Patch requests. 1501 ForceSendFields []string `json:"-"` 1502 1503 // NullFields is a list of field names (e.g. "Kind") to include in API 1504 // requests with the JSON null value. By default, fields with empty 1505 // values are omitted from API requests. However, any field with an 1506 // empty value appearing in NullFields will be sent to the server as 1507 // null. It is an error if a field in this list has a non-empty value. 1508 // This may be used to include null fields in Patch requests. 1509 NullFields []string `json:"-"` 1510} 1511 1512func (s *GamesAchievementIncrement) MarshalJSON() ([]byte, error) { 1513 type NoMethod GamesAchievementIncrement 1514 raw := NoMethod(*s) 1515 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1516} 1517 1518// GamesAchievementSetStepsAtLeast: This is a JSON template for the 1519// payload to request to increment an achievement. 1520type GamesAchievementSetStepsAtLeast struct { 1521 // Kind: Uniquely identifies the type of this resource. Value is always 1522 // the fixed string games#GamesAchievementSetStepsAtLeast. 1523 Kind string `json:"kind,omitempty"` 1524 1525 // Steps: The minimum number of steps for the achievement to be set to. 1526 Steps int64 `json:"steps,omitempty"` 1527 1528 // ForceSendFields is a list of field names (e.g. "Kind") to 1529 // unconditionally include in API requests. By default, fields with 1530 // empty values are omitted from API requests. However, any non-pointer, 1531 // non-interface field appearing in ForceSendFields will be sent to the 1532 // server regardless of whether the field is empty or not. This may be 1533 // used to include empty fields in Patch requests. 1534 ForceSendFields []string `json:"-"` 1535 1536 // NullFields is a list of field names (e.g. "Kind") to include in API 1537 // requests with the JSON null value. By default, fields with empty 1538 // values are omitted from API requests. However, any field with an 1539 // empty value appearing in NullFields will be sent to the server as 1540 // null. It is an error if a field in this list has a non-empty value. 1541 // This may be used to include null fields in Patch requests. 1542 NullFields []string `json:"-"` 1543} 1544 1545func (s *GamesAchievementSetStepsAtLeast) MarshalJSON() ([]byte, error) { 1546 type NoMethod GamesAchievementSetStepsAtLeast 1547 raw := NoMethod(*s) 1548 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1549} 1550 1551// ImageAsset: This is a JSON template for an image asset object. 1552type ImageAsset struct { 1553 // Height: The height of the asset. 1554 Height int64 `json:"height,omitempty"` 1555 1556 // Kind: Uniquely identifies the type of this resource. Value is always 1557 // the fixed string games#imageAsset. 1558 Kind string `json:"kind,omitempty"` 1559 1560 // Name: The name of the asset. 1561 Name string `json:"name,omitempty"` 1562 1563 // Url: The URL of the asset. 1564 Url string `json:"url,omitempty"` 1565 1566 // Width: The width of the asset. 1567 Width int64 `json:"width,omitempty"` 1568 1569 // ForceSendFields is a list of field names (e.g. "Height") to 1570 // unconditionally include in API requests. By default, fields with 1571 // empty values are omitted from API requests. However, any non-pointer, 1572 // non-interface field appearing in ForceSendFields will be sent to the 1573 // server regardless of whether the field is empty or not. This may be 1574 // used to include empty fields in Patch requests. 1575 ForceSendFields []string `json:"-"` 1576 1577 // NullFields is a list of field names (e.g. "Height") to include in API 1578 // requests with the JSON null value. By default, fields with empty 1579 // values are omitted from API requests. However, any field with an 1580 // empty value appearing in NullFields will be sent to the server as 1581 // null. It is an error if a field in this list has a non-empty value. 1582 // This may be used to include null fields in Patch requests. 1583 NullFields []string `json:"-"` 1584} 1585 1586func (s *ImageAsset) MarshalJSON() ([]byte, error) { 1587 type NoMethod ImageAsset 1588 raw := NoMethod(*s) 1589 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1590} 1591 1592// Instance: This is a JSON template for the Instance resource. 1593type Instance struct { 1594 // AcquisitionUri: URI which shows where a user can acquire this 1595 // instance. 1596 AcquisitionUri string `json:"acquisitionUri,omitempty"` 1597 1598 // AndroidInstance: Platform dependent details for Android. 1599 AndroidInstance *InstanceAndroidDetails `json:"androidInstance,omitempty"` 1600 1601 // IosInstance: Platform dependent details for iOS. 1602 IosInstance *InstanceIosDetails `json:"iosInstance,omitempty"` 1603 1604 // Kind: Uniquely identifies the type of this resource. Value is always 1605 // the fixed string games#instance. 1606 Kind string `json:"kind,omitempty"` 1607 1608 // Name: Localized display name. 1609 Name string `json:"name,omitempty"` 1610 1611 // PlatformType: The platform type. 1612 // Possible values are: 1613 // - "ANDROID" - Instance is for Android. 1614 // - "IOS" - Instance is for iOS 1615 // - "WEB_APP" - Instance is for Web App. 1616 PlatformType string `json:"platformType,omitempty"` 1617 1618 // RealtimePlay: Flag to show if this game instance supports realtime 1619 // play. 1620 RealtimePlay bool `json:"realtimePlay,omitempty"` 1621 1622 // TurnBasedPlay: Flag to show if this game instance supports turn based 1623 // play. 1624 TurnBasedPlay bool `json:"turnBasedPlay,omitempty"` 1625 1626 // WebInstance: Platform dependent details for Web. 1627 WebInstance *InstanceWebDetails `json:"webInstance,omitempty"` 1628 1629 // ForceSendFields is a list of field names (e.g. "AcquisitionUri") to 1630 // unconditionally include in API requests. By default, fields with 1631 // empty values are omitted from API requests. However, any non-pointer, 1632 // non-interface field appearing in ForceSendFields will be sent to the 1633 // server regardless of whether the field is empty or not. This may be 1634 // used to include empty fields in Patch requests. 1635 ForceSendFields []string `json:"-"` 1636 1637 // NullFields is a list of field names (e.g. "AcquisitionUri") to 1638 // include in API requests with the JSON null value. By default, fields 1639 // with empty values are omitted from API requests. However, any field 1640 // with an empty value appearing in NullFields will be sent to the 1641 // server as null. It is an error if a field in this list has a 1642 // non-empty value. This may be used to include null fields in Patch 1643 // requests. 1644 NullFields []string `json:"-"` 1645} 1646 1647func (s *Instance) MarshalJSON() ([]byte, error) { 1648 type NoMethod Instance 1649 raw := NoMethod(*s) 1650 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1651} 1652 1653// InstanceAndroidDetails: This is a JSON template for the Android 1654// instance details resource. 1655type InstanceAndroidDetails struct { 1656 // EnablePiracyCheck: Flag indicating whether the anti-piracy check is 1657 // enabled. 1658 EnablePiracyCheck bool `json:"enablePiracyCheck,omitempty"` 1659 1660 // Kind: Uniquely identifies the type of this resource. Value is always 1661 // the fixed string games#instanceAndroidDetails. 1662 Kind string `json:"kind,omitempty"` 1663 1664 // PackageName: Android package name which maps to Google Play URL. 1665 PackageName string `json:"packageName,omitempty"` 1666 1667 // Preferred: Indicates that this instance is the default for new 1668 // installations. 1669 Preferred bool `json:"preferred,omitempty"` 1670 1671 // ForceSendFields is a list of field names (e.g. "EnablePiracyCheck") 1672 // to unconditionally include in API requests. By default, fields with 1673 // empty values are omitted from API requests. However, any non-pointer, 1674 // non-interface field appearing in ForceSendFields will be sent to the 1675 // server regardless of whether the field is empty or not. This may be 1676 // used to include empty fields in Patch requests. 1677 ForceSendFields []string `json:"-"` 1678 1679 // NullFields is a list of field names (e.g. "EnablePiracyCheck") to 1680 // include in API requests with the JSON null value. By default, fields 1681 // with empty values are omitted from API requests. However, any field 1682 // with an empty value appearing in NullFields will be sent to the 1683 // server as null. It is an error if a field in this list has a 1684 // non-empty value. This may be used to include null fields in Patch 1685 // requests. 1686 NullFields []string `json:"-"` 1687} 1688 1689func (s *InstanceAndroidDetails) MarshalJSON() ([]byte, error) { 1690 type NoMethod InstanceAndroidDetails 1691 raw := NoMethod(*s) 1692 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1693} 1694 1695// InstanceIosDetails: This is a JSON template for the iOS details 1696// resource. 1697type InstanceIosDetails struct { 1698 // BundleIdentifier: Bundle identifier. 1699 BundleIdentifier string `json:"bundleIdentifier,omitempty"` 1700 1701 // ItunesAppId: iTunes App ID. 1702 ItunesAppId string `json:"itunesAppId,omitempty"` 1703 1704 // Kind: Uniquely identifies the type of this resource. Value is always 1705 // the fixed string games#instanceIosDetails. 1706 Kind string `json:"kind,omitempty"` 1707 1708 // PreferredForIpad: Indicates that this instance is the default for new 1709 // installations on iPad devices. 1710 PreferredForIpad bool `json:"preferredForIpad,omitempty"` 1711 1712 // PreferredForIphone: Indicates that this instance is the default for 1713 // new installations on iPhone devices. 1714 PreferredForIphone bool `json:"preferredForIphone,omitempty"` 1715 1716 // SupportIpad: Flag to indicate if this instance supports iPad. 1717 SupportIpad bool `json:"supportIpad,omitempty"` 1718 1719 // SupportIphone: Flag to indicate if this instance supports iPhone. 1720 SupportIphone bool `json:"supportIphone,omitempty"` 1721 1722 // ForceSendFields is a list of field names (e.g. "BundleIdentifier") to 1723 // unconditionally include in API requests. By default, fields with 1724 // empty values are omitted from API requests. However, any non-pointer, 1725 // non-interface field appearing in ForceSendFields will be sent to the 1726 // server regardless of whether the field is empty or not. This may be 1727 // used to include empty fields in Patch requests. 1728 ForceSendFields []string `json:"-"` 1729 1730 // NullFields is a list of field names (e.g. "BundleIdentifier") to 1731 // include in API requests with the JSON null value. By default, fields 1732 // with empty values are omitted from API requests. However, any field 1733 // with an empty value appearing in NullFields will be sent to the 1734 // server as null. It is an error if a field in this list has a 1735 // non-empty value. This may be used to include null fields in Patch 1736 // requests. 1737 NullFields []string `json:"-"` 1738} 1739 1740func (s *InstanceIosDetails) MarshalJSON() ([]byte, error) { 1741 type NoMethod InstanceIosDetails 1742 raw := NoMethod(*s) 1743 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1744} 1745 1746// InstanceWebDetails: This is a JSON template for the Web details 1747// resource. 1748type InstanceWebDetails struct { 1749 // Kind: Uniquely identifies the type of this resource. Value is always 1750 // the fixed string games#instanceWebDetails. 1751 Kind string `json:"kind,omitempty"` 1752 1753 // LaunchUrl: Launch URL for the game. 1754 LaunchUrl string `json:"launchUrl,omitempty"` 1755 1756 // Preferred: Indicates that this instance is the default for new 1757 // installations. 1758 Preferred bool `json:"preferred,omitempty"` 1759 1760 // ForceSendFields is a list of field names (e.g. "Kind") to 1761 // unconditionally include in API requests. By default, fields with 1762 // empty values are omitted from API requests. However, any non-pointer, 1763 // non-interface field appearing in ForceSendFields will be sent to the 1764 // server regardless of whether the field is empty or not. This may be 1765 // used to include empty fields in Patch requests. 1766 ForceSendFields []string `json:"-"` 1767 1768 // NullFields is a list of field names (e.g. "Kind") to include in API 1769 // requests with the JSON null value. By default, fields with empty 1770 // values are omitted from API requests. However, any field with an 1771 // empty value appearing in NullFields will be sent to the server as 1772 // null. It is an error if a field in this list has a non-empty value. 1773 // This may be used to include null fields in Patch requests. 1774 NullFields []string `json:"-"` 1775} 1776 1777func (s *InstanceWebDetails) MarshalJSON() ([]byte, error) { 1778 type NoMethod InstanceWebDetails 1779 raw := NoMethod(*s) 1780 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1781} 1782 1783// Leaderboard: This is a JSON template for the Leaderboard resource. 1784type Leaderboard struct { 1785 // IconUrl: The icon for the leaderboard. 1786 IconUrl string `json:"iconUrl,omitempty"` 1787 1788 // Id: The leaderboard ID. 1789 Id string `json:"id,omitempty"` 1790 1791 // IsIconUrlDefault: Indicates whether the icon image being returned is 1792 // a default image, or is game-provided. 1793 IsIconUrlDefault bool `json:"isIconUrlDefault,omitempty"` 1794 1795 // Kind: Uniquely identifies the type of this resource. Value is always 1796 // the fixed string games#leaderboard. 1797 Kind string `json:"kind,omitempty"` 1798 1799 // Name: The name of the leaderboard. 1800 Name string `json:"name,omitempty"` 1801 1802 // Order: How scores are ordered. 1803 // Possible values are: 1804 // - "LARGER_IS_BETTER" - Larger values are better; scores are sorted in 1805 // descending order. 1806 // - "SMALLER_IS_BETTER" - Smaller values are better; scores are sorted 1807 // in ascending order. 1808 Order string `json:"order,omitempty"` 1809 1810 // ServerResponse contains the HTTP response code and headers from the 1811 // server. 1812 googleapi.ServerResponse `json:"-"` 1813 1814 // ForceSendFields is a list of field names (e.g. "IconUrl") to 1815 // unconditionally include in API requests. By default, fields with 1816 // empty values are omitted from API requests. However, any non-pointer, 1817 // non-interface field appearing in ForceSendFields will be sent to the 1818 // server regardless of whether the field is empty or not. This may be 1819 // used to include empty fields in Patch requests. 1820 ForceSendFields []string `json:"-"` 1821 1822 // NullFields is a list of field names (e.g. "IconUrl") to include in 1823 // API requests with the JSON null value. By default, fields with empty 1824 // values are omitted from API requests. However, any field with an 1825 // empty value appearing in NullFields will be sent to the server as 1826 // null. It is an error if a field in this list has a non-empty value. 1827 // This may be used to include null fields in Patch requests. 1828 NullFields []string `json:"-"` 1829} 1830 1831func (s *Leaderboard) MarshalJSON() ([]byte, error) { 1832 type NoMethod Leaderboard 1833 raw := NoMethod(*s) 1834 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1835} 1836 1837// LeaderboardEntry: This is a JSON template for the Leaderboard Entry 1838// resource. 1839type LeaderboardEntry struct { 1840 // FormattedScore: The localized string for the numerical value of this 1841 // score. 1842 FormattedScore string `json:"formattedScore,omitempty"` 1843 1844 // FormattedScoreRank: The localized string for the rank of this score 1845 // for this leaderboard. 1846 FormattedScoreRank string `json:"formattedScoreRank,omitempty"` 1847 1848 // Kind: Uniquely identifies the type of this resource. Value is always 1849 // the fixed string games#leaderboardEntry. 1850 Kind string `json:"kind,omitempty"` 1851 1852 // Player: The player who holds this score. 1853 Player *Player `json:"player,omitempty"` 1854 1855 // ScoreRank: The rank of this score for this leaderboard. 1856 ScoreRank int64 `json:"scoreRank,omitempty,string"` 1857 1858 // ScoreTag: Additional information about the score. Values must contain 1859 // no more than 64 URI-safe characters as defined by section 2.3 of RFC 1860 // 3986. 1861 ScoreTag string `json:"scoreTag,omitempty"` 1862 1863 // ScoreValue: The numerical value of this score. 1864 ScoreValue int64 `json:"scoreValue,omitempty,string"` 1865 1866 // TimeSpan: The time span of this high score. 1867 // Possible values are: 1868 // - "ALL_TIME" - The score is an all-time high score. 1869 // - "WEEKLY" - The score is a weekly high score. 1870 // - "DAILY" - The score is a daily high score. 1871 TimeSpan string `json:"timeSpan,omitempty"` 1872 1873 // WriteTimestampMillis: The timestamp at which this score was recorded, 1874 // in milliseconds since the epoch in UTC. 1875 WriteTimestampMillis int64 `json:"writeTimestampMillis,omitempty,string"` 1876 1877 // ForceSendFields is a list of field names (e.g. "FormattedScore") to 1878 // unconditionally include in API requests. By default, fields with 1879 // empty values are omitted from API requests. However, any non-pointer, 1880 // non-interface field appearing in ForceSendFields will be sent to the 1881 // server regardless of whether the field is empty or not. This may be 1882 // used to include empty fields in Patch requests. 1883 ForceSendFields []string `json:"-"` 1884 1885 // NullFields is a list of field names (e.g. "FormattedScore") to 1886 // include in API requests with the JSON null value. By default, fields 1887 // with empty values are omitted from API requests. However, any field 1888 // with an empty value appearing in NullFields will be sent to the 1889 // server as null. It is an error if a field in this list has a 1890 // non-empty value. This may be used to include null fields in Patch 1891 // requests. 1892 NullFields []string `json:"-"` 1893} 1894 1895func (s *LeaderboardEntry) MarshalJSON() ([]byte, error) { 1896 type NoMethod LeaderboardEntry 1897 raw := NoMethod(*s) 1898 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1899} 1900 1901// LeaderboardListResponse: This is a JSON template for a list of 1902// leaderboard objects. 1903type LeaderboardListResponse struct { 1904 // Items: The leaderboards. 1905 Items []*Leaderboard `json:"items,omitempty"` 1906 1907 // Kind: Uniquely identifies the type of this resource. Value is always 1908 // the fixed string games#leaderboardListResponse. 1909 Kind string `json:"kind,omitempty"` 1910 1911 // NextPageToken: Token corresponding to the next page of results. 1912 NextPageToken string `json:"nextPageToken,omitempty"` 1913 1914 // ServerResponse contains the HTTP response code and headers from the 1915 // server. 1916 googleapi.ServerResponse `json:"-"` 1917 1918 // ForceSendFields is a list of field names (e.g. "Items") to 1919 // unconditionally include in API requests. By default, fields with 1920 // empty values are omitted from API requests. However, any non-pointer, 1921 // non-interface field appearing in ForceSendFields will be sent to the 1922 // server regardless of whether the field is empty or not. This may be 1923 // used to include empty fields in Patch requests. 1924 ForceSendFields []string `json:"-"` 1925 1926 // NullFields is a list of field names (e.g. "Items") to include in API 1927 // requests with the JSON null value. By default, fields with empty 1928 // values are omitted from API requests. However, any field with an 1929 // empty value appearing in NullFields will be sent to the server as 1930 // null. It is an error if a field in this list has a non-empty value. 1931 // This may be used to include null fields in Patch requests. 1932 NullFields []string `json:"-"` 1933} 1934 1935func (s *LeaderboardListResponse) MarshalJSON() ([]byte, error) { 1936 type NoMethod LeaderboardListResponse 1937 raw := NoMethod(*s) 1938 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1939} 1940 1941// LeaderboardScoreRank: This is a JSON template for a score rank in a 1942// leaderboard. 1943type LeaderboardScoreRank struct { 1944 // FormattedNumScores: The number of scores in the leaderboard as a 1945 // string. 1946 FormattedNumScores string `json:"formattedNumScores,omitempty"` 1947 1948 // FormattedRank: The rank in the leaderboard as a string. 1949 FormattedRank string `json:"formattedRank,omitempty"` 1950 1951 // Kind: Uniquely identifies the type of this resource. Value is always 1952 // the fixed string games#leaderboardScoreRank. 1953 Kind string `json:"kind,omitempty"` 1954 1955 // NumScores: The number of scores in the leaderboard. 1956 NumScores int64 `json:"numScores,omitempty,string"` 1957 1958 // Rank: The rank in the leaderboard. 1959 Rank int64 `json:"rank,omitempty,string"` 1960 1961 // ForceSendFields is a list of field names (e.g. "FormattedNumScores") 1962 // to unconditionally include in API requests. By default, fields with 1963 // empty values are omitted from API requests. However, any non-pointer, 1964 // non-interface field appearing in ForceSendFields will be sent to the 1965 // server regardless of whether the field is empty or not. This may be 1966 // used to include empty fields in Patch requests. 1967 ForceSendFields []string `json:"-"` 1968 1969 // NullFields is a list of field names (e.g. "FormattedNumScores") to 1970 // include in API requests with the JSON null value. By default, fields 1971 // with empty values are omitted from API requests. However, any field 1972 // with an empty value appearing in NullFields will be sent to the 1973 // server as null. It is an error if a field in this list has a 1974 // non-empty value. This may be used to include null fields in Patch 1975 // requests. 1976 NullFields []string `json:"-"` 1977} 1978 1979func (s *LeaderboardScoreRank) MarshalJSON() ([]byte, error) { 1980 type NoMethod LeaderboardScoreRank 1981 raw := NoMethod(*s) 1982 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1983} 1984 1985// LeaderboardScores: This is a JSON template for a ListScores response. 1986type LeaderboardScores struct { 1987 // Items: The scores in the leaderboard. 1988 Items []*LeaderboardEntry `json:"items,omitempty"` 1989 1990 // Kind: Uniquely identifies the type of this resource. Value is always 1991 // the fixed string games#leaderboardScores. 1992 Kind string `json:"kind,omitempty"` 1993 1994 // NextPageToken: The pagination token for the next page of results. 1995 NextPageToken string `json:"nextPageToken,omitempty"` 1996 1997 // NumScores: The total number of scores in the leaderboard. 1998 NumScores int64 `json:"numScores,omitempty,string"` 1999 2000 // PlayerScore: The score of the requesting player on the leaderboard. 2001 // The player's score may appear both here and in the list of scores 2002 // above. If you are viewing a public leaderboard and the player is not 2003 // sharing their gameplay information publicly, the scoreRank and 2004 // formattedScoreRank values will not be present. 2005 PlayerScore *LeaderboardEntry `json:"playerScore,omitempty"` 2006 2007 // PrevPageToken: The pagination token for the previous page of results. 2008 PrevPageToken string `json:"prevPageToken,omitempty"` 2009 2010 // ServerResponse contains the HTTP response code and headers from the 2011 // server. 2012 googleapi.ServerResponse `json:"-"` 2013 2014 // ForceSendFields is a list of field names (e.g. "Items") to 2015 // unconditionally include in API requests. By default, fields with 2016 // empty values are omitted from API requests. However, any non-pointer, 2017 // non-interface field appearing in ForceSendFields will be sent to the 2018 // server regardless of whether the field is empty or not. This may be 2019 // used to include empty fields in Patch requests. 2020 ForceSendFields []string `json:"-"` 2021 2022 // NullFields is a list of field names (e.g. "Items") to include in API 2023 // requests with the JSON null value. By default, fields with empty 2024 // values are omitted from API requests. However, any field with an 2025 // empty value appearing in NullFields will be sent to the server as 2026 // null. It is an error if a field in this list has a non-empty value. 2027 // This may be used to include null fields in Patch requests. 2028 NullFields []string `json:"-"` 2029} 2030 2031func (s *LeaderboardScores) MarshalJSON() ([]byte, error) { 2032 type NoMethod LeaderboardScores 2033 raw := NoMethod(*s) 2034 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2035} 2036 2037// MetagameConfig: This is a JSON template for the metagame config 2038// resource 2039type MetagameConfig struct { 2040 // CurrentVersion: Current version of the metagame configuration data. 2041 // When this data is updated, the version number will be increased by 2042 // one. 2043 CurrentVersion int64 `json:"currentVersion,omitempty"` 2044 2045 // Kind: Uniquely identifies the type of this resource. Value is always 2046 // the fixed string games#metagameConfig. 2047 Kind string `json:"kind,omitempty"` 2048 2049 // PlayerLevels: The list of player levels. 2050 PlayerLevels []*PlayerLevel `json:"playerLevels,omitempty"` 2051 2052 // ServerResponse contains the HTTP response code and headers from the 2053 // server. 2054 googleapi.ServerResponse `json:"-"` 2055 2056 // ForceSendFields is a list of field names (e.g. "CurrentVersion") to 2057 // unconditionally include in API requests. By default, fields with 2058 // empty values are omitted from API requests. However, any non-pointer, 2059 // non-interface field appearing in ForceSendFields will be sent to the 2060 // server regardless of whether the field is empty or not. This may be 2061 // used to include empty fields in Patch requests. 2062 ForceSendFields []string `json:"-"` 2063 2064 // NullFields is a list of field names (e.g. "CurrentVersion") to 2065 // include in API requests with the JSON null value. By default, fields 2066 // with empty values are omitted from API requests. However, any field 2067 // with an empty value appearing in NullFields will be sent to the 2068 // server as null. It is an error if a field in this list has a 2069 // non-empty value. This may be used to include null fields in Patch 2070 // requests. 2071 NullFields []string `json:"-"` 2072} 2073 2074func (s *MetagameConfig) MarshalJSON() ([]byte, error) { 2075 type NoMethod MetagameConfig 2076 raw := NoMethod(*s) 2077 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2078} 2079 2080// NetworkDiagnostics: This is a JSON template for network diagnostics 2081// reported for a client. 2082type NetworkDiagnostics struct { 2083 // AndroidNetworkSubtype: The Android network subtype. 2084 AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"` 2085 2086 // AndroidNetworkType: The Android network type. 2087 AndroidNetworkType int64 `json:"androidNetworkType,omitempty"` 2088 2089 // IosNetworkType: iOS network type as defined in Reachability.h. 2090 IosNetworkType int64 `json:"iosNetworkType,omitempty"` 2091 2092 // Kind: Uniquely identifies the type of this resource. Value is always 2093 // the fixed string games#networkDiagnostics. 2094 Kind string `json:"kind,omitempty"` 2095 2096 // NetworkOperatorCode: The MCC+MNC code for the client's network 2097 // connection. On Android: 2098 // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: 2099 // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html 2100 NetworkOperatorCode string `json:"networkOperatorCode,omitempty"` 2101 2102 // NetworkOperatorName: The name of the carrier of the client's network 2103 // connection. On Android: 2104 // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: 2105 // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName 2106 NetworkOperatorName string `json:"networkOperatorName,omitempty"` 2107 2108 // RegistrationLatencyMillis: The amount of time in milliseconds it took 2109 // for the client to establish a connection with the XMPP server. 2110 RegistrationLatencyMillis int64 `json:"registrationLatencyMillis,omitempty"` 2111 2112 // ForceSendFields is a list of field names (e.g. 2113 // "AndroidNetworkSubtype") to unconditionally include in API requests. 2114 // By default, fields with empty values are omitted from API requests. 2115 // However, any non-pointer, non-interface field appearing in 2116 // ForceSendFields will be sent to the server regardless of whether the 2117 // field is empty or not. This may be used to include empty fields in 2118 // Patch requests. 2119 ForceSendFields []string `json:"-"` 2120 2121 // NullFields is a list of field names (e.g. "AndroidNetworkSubtype") to 2122 // include in API requests with the JSON null value. By default, fields 2123 // with empty values are omitted from API requests. However, any field 2124 // with an empty value appearing in NullFields will be sent to the 2125 // server as null. It is an error if a field in this list has a 2126 // non-empty value. This may be used to include null fields in Patch 2127 // requests. 2128 NullFields []string `json:"-"` 2129} 2130 2131func (s *NetworkDiagnostics) MarshalJSON() ([]byte, error) { 2132 type NoMethod NetworkDiagnostics 2133 raw := NoMethod(*s) 2134 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2135} 2136 2137// ParticipantResult: This is a JSON template for a result for a match 2138// participant. 2139type ParticipantResult struct { 2140 // Kind: Uniquely identifies the type of this resource. Value is always 2141 // the fixed string games#participantResult. 2142 Kind string `json:"kind,omitempty"` 2143 2144 // ParticipantId: The ID of the participant. 2145 ParticipantId string `json:"participantId,omitempty"` 2146 2147 // Placing: The placement or ranking of the participant in the match 2148 // results; a number from one to the number of participants in the 2149 // match. Multiple participants may have the same placing value in case 2150 // of a type. 2151 Placing int64 `json:"placing,omitempty"` 2152 2153 // Result: The result of the participant for this match. 2154 // Possible values are: 2155 // - "MATCH_RESULT_WIN" - The participant won the match. 2156 // - "MATCH_RESULT_LOSS" - The participant lost the match. 2157 // - "MATCH_RESULT_TIE" - The participant tied the match. 2158 // - "MATCH_RESULT_NONE" - There was no winner for the match (nobody 2159 // wins or loses this kind of game.) 2160 // - "MATCH_RESULT_DISCONNECT" - The participant disconnected / left 2161 // during the match. 2162 // - "MATCH_RESULT_DISAGREED" - Different clients reported different 2163 // results for this participant. 2164 Result string `json:"result,omitempty"` 2165 2166 // ForceSendFields is a list of field names (e.g. "Kind") to 2167 // unconditionally include in API requests. By default, fields with 2168 // empty values are omitted from API requests. However, any non-pointer, 2169 // non-interface field appearing in ForceSendFields will be sent to the 2170 // server regardless of whether the field is empty or not. This may be 2171 // used to include empty fields in Patch requests. 2172 ForceSendFields []string `json:"-"` 2173 2174 // NullFields is a list of field names (e.g. "Kind") to include in API 2175 // requests with the JSON null value. By default, fields with empty 2176 // values are omitted from API requests. However, any field with an 2177 // empty value appearing in NullFields will be sent to the server as 2178 // null. It is an error if a field in this list has a non-empty value. 2179 // This may be used to include null fields in Patch requests. 2180 NullFields []string `json:"-"` 2181} 2182 2183func (s *ParticipantResult) MarshalJSON() ([]byte, error) { 2184 type NoMethod ParticipantResult 2185 raw := NoMethod(*s) 2186 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2187} 2188 2189// PeerChannelDiagnostics: This is a JSON template for peer channel 2190// diagnostics. 2191type PeerChannelDiagnostics struct { 2192 // BytesReceived: Number of bytes received. 2193 BytesReceived *AggregateStats `json:"bytesReceived,omitempty"` 2194 2195 // BytesSent: Number of bytes sent. 2196 BytesSent *AggregateStats `json:"bytesSent,omitempty"` 2197 2198 // Kind: Uniquely identifies the type of this resource. Value is always 2199 // the fixed string games#peerChannelDiagnostics. 2200 Kind string `json:"kind,omitempty"` 2201 2202 // NumMessagesLost: Number of messages lost. 2203 NumMessagesLost int64 `json:"numMessagesLost,omitempty"` 2204 2205 // NumMessagesReceived: Number of messages received. 2206 NumMessagesReceived int64 `json:"numMessagesReceived,omitempty"` 2207 2208 // NumMessagesSent: Number of messages sent. 2209 NumMessagesSent int64 `json:"numMessagesSent,omitempty"` 2210 2211 // NumSendFailures: Number of send failures. 2212 NumSendFailures int64 `json:"numSendFailures,omitempty"` 2213 2214 // RoundtripLatencyMillis: Roundtrip latency stats in milliseconds. 2215 RoundtripLatencyMillis *AggregateStats `json:"roundtripLatencyMillis,omitempty"` 2216 2217 // ForceSendFields is a list of field names (e.g. "BytesReceived") to 2218 // unconditionally include in API requests. By default, fields with 2219 // empty values are omitted from API requests. However, any non-pointer, 2220 // non-interface field appearing in ForceSendFields will be sent to the 2221 // server regardless of whether the field is empty or not. This may be 2222 // used to include empty fields in Patch requests. 2223 ForceSendFields []string `json:"-"` 2224 2225 // NullFields is a list of field names (e.g. "BytesReceived") to include 2226 // in API requests with the JSON null value. By default, fields with 2227 // empty values are omitted from API requests. However, any field with 2228 // an empty value appearing in NullFields will be sent to the server as 2229 // null. It is an error if a field in this list has a non-empty value. 2230 // This may be used to include null fields in Patch requests. 2231 NullFields []string `json:"-"` 2232} 2233 2234func (s *PeerChannelDiagnostics) MarshalJSON() ([]byte, error) { 2235 type NoMethod PeerChannelDiagnostics 2236 raw := NoMethod(*s) 2237 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2238} 2239 2240// PeerSessionDiagnostics: This is a JSON template for peer session 2241// diagnostics. 2242type PeerSessionDiagnostics struct { 2243 // ConnectedTimestampMillis: Connected time in milliseconds. 2244 ConnectedTimestampMillis int64 `json:"connectedTimestampMillis,omitempty,string"` 2245 2246 // Kind: Uniquely identifies the type of this resource. Value is always 2247 // the fixed string games#peerSessionDiagnostics. 2248 Kind string `json:"kind,omitempty"` 2249 2250 // ParticipantId: The participant ID of the peer. 2251 ParticipantId string `json:"participantId,omitempty"` 2252 2253 // ReliableChannel: Reliable channel diagnostics. 2254 ReliableChannel *PeerChannelDiagnostics `json:"reliableChannel,omitempty"` 2255 2256 // UnreliableChannel: Unreliable channel diagnostics. 2257 UnreliableChannel *PeerChannelDiagnostics `json:"unreliableChannel,omitempty"` 2258 2259 // ForceSendFields is a list of field names (e.g. 2260 // "ConnectedTimestampMillis") to unconditionally include in API 2261 // requests. By default, fields with empty values are omitted from API 2262 // requests. However, any non-pointer, non-interface field appearing in 2263 // ForceSendFields will be sent to the server regardless of whether the 2264 // field is empty or not. This may be used to include empty fields in 2265 // Patch requests. 2266 ForceSendFields []string `json:"-"` 2267 2268 // NullFields is a list of field names (e.g. "ConnectedTimestampMillis") 2269 // to include in API requests with the JSON null value. By default, 2270 // fields with empty values are omitted from API requests. However, any 2271 // field with an empty value appearing in NullFields will be sent to the 2272 // server as null. It is an error if a field in this list has a 2273 // non-empty value. This may be used to include null fields in Patch 2274 // requests. 2275 NullFields []string `json:"-"` 2276} 2277 2278func (s *PeerSessionDiagnostics) MarshalJSON() ([]byte, error) { 2279 type NoMethod PeerSessionDiagnostics 2280 raw := NoMethod(*s) 2281 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2282} 2283 2284// Played: This is a JSON template for metadata about a player playing a 2285// game with the currently authenticated user. 2286type Played struct { 2287 // AutoMatched: True if the player was auto-matched with the currently 2288 // authenticated user. 2289 AutoMatched bool `json:"autoMatched,omitempty"` 2290 2291 // Kind: Uniquely identifies the type of this resource. Value is always 2292 // the fixed string games#played. 2293 Kind string `json:"kind,omitempty"` 2294 2295 // TimeMillis: The last time the player played the game in milliseconds 2296 // since the epoch in UTC. 2297 TimeMillis int64 `json:"timeMillis,omitempty,string"` 2298 2299 // ForceSendFields is a list of field names (e.g. "AutoMatched") to 2300 // unconditionally include in API requests. By default, fields with 2301 // empty values are omitted from API requests. However, any non-pointer, 2302 // non-interface field appearing in ForceSendFields will be sent to the 2303 // server regardless of whether the field is empty or not. This may be 2304 // used to include empty fields in Patch requests. 2305 ForceSendFields []string `json:"-"` 2306 2307 // NullFields is a list of field names (e.g. "AutoMatched") to include 2308 // in API requests with the JSON null value. By default, fields with 2309 // empty values are omitted from API requests. However, any field with 2310 // an empty value appearing in NullFields will be sent to the server as 2311 // null. It is an error if a field in this list has a non-empty value. 2312 // This may be used to include null fields in Patch requests. 2313 NullFields []string `json:"-"` 2314} 2315 2316func (s *Played) MarshalJSON() ([]byte, error) { 2317 type NoMethod Played 2318 raw := NoMethod(*s) 2319 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2320} 2321 2322// Player: This is a JSON template for a Player resource. 2323type Player struct { 2324 // AvatarImageUrl: The base URL for the image that represents the 2325 // player. 2326 AvatarImageUrl string `json:"avatarImageUrl,omitempty"` 2327 2328 // BannerUrlLandscape: The url to the landscape mode player banner 2329 // image. 2330 BannerUrlLandscape string `json:"bannerUrlLandscape,omitempty"` 2331 2332 // BannerUrlPortrait: The url to the portrait mode player banner image. 2333 BannerUrlPortrait string `json:"bannerUrlPortrait,omitempty"` 2334 2335 // DisplayName: The name to display for the player. 2336 DisplayName string `json:"displayName,omitempty"` 2337 2338 // ExperienceInfo: An object to represent Play Game experience 2339 // information for the player. 2340 ExperienceInfo *PlayerExperienceInfo `json:"experienceInfo,omitempty"` 2341 2342 // Kind: Uniquely identifies the type of this resource. Value is always 2343 // the fixed string games#player. 2344 Kind string `json:"kind,omitempty"` 2345 2346 // LastPlayedWith: Details about the last time this player played a 2347 // multiplayer game with the currently authenticated player. Populated 2348 // for PLAYED_WITH player collection members. 2349 LastPlayedWith *Played `json:"lastPlayedWith,omitempty"` 2350 2351 // Name: An object representation of the individual components of the 2352 // player's name. For some players, these fields may not be present. 2353 Name *PlayerName `json:"name,omitempty"` 2354 2355 // OriginalPlayerId: The player ID that was used for this player the 2356 // first time they signed into the game in question. This is only 2357 // populated for calls to player.get for the requesting player, only if 2358 // the player ID has subsequently changed, and only to clients that 2359 // support remapping player IDs. 2360 OriginalPlayerId string `json:"originalPlayerId,omitempty"` 2361 2362 // PlayerId: The ID of the player. 2363 PlayerId string `json:"playerId,omitempty"` 2364 2365 PlayerStattus string `json:"playerStattus,omitempty"` 2366 2367 // ProfileSettings: The player's profile settings. Controls whether or 2368 // not the player's profile is visible to other players. 2369 ProfileSettings *ProfileSettings `json:"profileSettings,omitempty"` 2370 2371 // Title: The player's title rewarded for their game activities. 2372 Title string `json:"title,omitempty"` 2373 2374 // ServerResponse contains the HTTP response code and headers from the 2375 // server. 2376 googleapi.ServerResponse `json:"-"` 2377 2378 // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to 2379 // unconditionally include in API requests. By default, fields with 2380 // empty values are omitted from API requests. However, any non-pointer, 2381 // non-interface field appearing in ForceSendFields will be sent to the 2382 // server regardless of whether the field is empty or not. This may be 2383 // used to include empty fields in Patch requests. 2384 ForceSendFields []string `json:"-"` 2385 2386 // NullFields is a list of field names (e.g. "AvatarImageUrl") to 2387 // include in API requests with the JSON null value. By default, fields 2388 // with empty values are omitted from API requests. However, any field 2389 // with an empty value appearing in NullFields will be sent to the 2390 // server as null. It is an error if a field in this list has a 2391 // non-empty value. This may be used to include null fields in Patch 2392 // requests. 2393 NullFields []string `json:"-"` 2394} 2395 2396func (s *Player) MarshalJSON() ([]byte, error) { 2397 type NoMethod Player 2398 raw := NoMethod(*s) 2399 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2400} 2401 2402// PlayerName: An object representation of the individual components of 2403// the player's name. For some players, these fields may not be present. 2404type PlayerName struct { 2405 // FamilyName: The family name of this player. In some places, this is 2406 // known as the last name. 2407 FamilyName string `json:"familyName,omitempty"` 2408 2409 // GivenName: The given name of this player. In some places, this is 2410 // known as the first name. 2411 GivenName string `json:"givenName,omitempty"` 2412 2413 // ForceSendFields is a list of field names (e.g. "FamilyName") to 2414 // unconditionally include in API requests. By default, fields with 2415 // empty values are omitted from API requests. However, any non-pointer, 2416 // non-interface field appearing in ForceSendFields will be sent to the 2417 // server regardless of whether the field is empty or not. This may be 2418 // used to include empty fields in Patch requests. 2419 ForceSendFields []string `json:"-"` 2420 2421 // NullFields is a list of field names (e.g. "FamilyName") to include in 2422 // API requests with the JSON null value. By default, fields with empty 2423 // values are omitted from API requests. However, any field with an 2424 // empty value appearing in NullFields will be sent to the server as 2425 // null. It is an error if a field in this list has a non-empty value. 2426 // This may be used to include null fields in Patch requests. 2427 NullFields []string `json:"-"` 2428} 2429 2430func (s *PlayerName) MarshalJSON() ([]byte, error) { 2431 type NoMethod PlayerName 2432 raw := NoMethod(*s) 2433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2434} 2435 2436// PlayerAchievement: This is a JSON template for an achievement object. 2437type PlayerAchievement struct { 2438 // AchievementState: The state of the achievement. 2439 // Possible values are: 2440 // - "HIDDEN" - Achievement is hidden. 2441 // - "REVEALED" - Achievement is revealed. 2442 // - "UNLOCKED" - Achievement is unlocked. 2443 AchievementState string `json:"achievementState,omitempty"` 2444 2445 // CurrentSteps: The current steps for an incremental achievement. 2446 CurrentSteps int64 `json:"currentSteps,omitempty"` 2447 2448 // ExperiencePoints: Experience points earned for the achievement. This 2449 // field is absent for achievements that have not yet been unlocked and 2450 // 0 for achievements that have been unlocked by testers but that are 2451 // unpublished. 2452 ExperiencePoints int64 `json:"experiencePoints,omitempty,string"` 2453 2454 // FormattedCurrentStepsString: The current steps for an incremental 2455 // achievement as a string. 2456 FormattedCurrentStepsString string `json:"formattedCurrentStepsString,omitempty"` 2457 2458 // Id: The ID of the achievement. 2459 Id string `json:"id,omitempty"` 2460 2461 // Kind: Uniquely identifies the type of this resource. Value is always 2462 // the fixed string games#playerAchievement. 2463 Kind string `json:"kind,omitempty"` 2464 2465 // LastUpdatedTimestamp: The timestamp of the last modification to this 2466 // achievement's state. 2467 LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"` 2468 2469 // ForceSendFields is a list of field names (e.g. "AchievementState") to 2470 // unconditionally include in API requests. By default, fields with 2471 // empty values are omitted from API requests. However, any non-pointer, 2472 // non-interface field appearing in ForceSendFields will be sent to the 2473 // server regardless of whether the field is empty or not. This may be 2474 // used to include empty fields in Patch requests. 2475 ForceSendFields []string `json:"-"` 2476 2477 // NullFields is a list of field names (e.g. "AchievementState") to 2478 // include in API requests with the JSON null value. By default, fields 2479 // with empty values are omitted from API requests. However, any field 2480 // with an empty value appearing in NullFields will be sent to the 2481 // server as null. It is an error if a field in this list has a 2482 // non-empty value. This may be used to include null fields in Patch 2483 // requests. 2484 NullFields []string `json:"-"` 2485} 2486 2487func (s *PlayerAchievement) MarshalJSON() ([]byte, error) { 2488 type NoMethod PlayerAchievement 2489 raw := NoMethod(*s) 2490 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2491} 2492 2493// PlayerAchievementListResponse: This is a JSON template for a list of 2494// achievement objects. 2495type PlayerAchievementListResponse struct { 2496 // Items: The achievements. 2497 Items []*PlayerAchievement `json:"items,omitempty"` 2498 2499 // Kind: Uniquely identifies the type of this resource. Value is always 2500 // the fixed string games#playerAchievementListResponse. 2501 Kind string `json:"kind,omitempty"` 2502 2503 // NextPageToken: Token corresponding to the next page of results. 2504 NextPageToken string `json:"nextPageToken,omitempty"` 2505 2506 // ServerResponse contains the HTTP response code and headers from the 2507 // server. 2508 googleapi.ServerResponse `json:"-"` 2509 2510 // ForceSendFields is a list of field names (e.g. "Items") to 2511 // unconditionally include in API requests. By default, fields with 2512 // empty values are omitted from API requests. However, any non-pointer, 2513 // non-interface field appearing in ForceSendFields will be sent to the 2514 // server regardless of whether the field is empty or not. This may be 2515 // used to include empty fields in Patch requests. 2516 ForceSendFields []string `json:"-"` 2517 2518 // NullFields is a list of field names (e.g. "Items") to include in API 2519 // requests with the JSON null value. By default, fields with empty 2520 // values are omitted from API requests. However, any field with an 2521 // empty value appearing in NullFields will be sent to the server as 2522 // null. It is an error if a field in this list has a non-empty value. 2523 // This may be used to include null fields in Patch requests. 2524 NullFields []string `json:"-"` 2525} 2526 2527func (s *PlayerAchievementListResponse) MarshalJSON() ([]byte, error) { 2528 type NoMethod PlayerAchievementListResponse 2529 raw := NoMethod(*s) 2530 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2531} 2532 2533// PlayerEvent: This is a JSON template for an event status resource. 2534type PlayerEvent struct { 2535 // DefinitionId: The ID of the event definition. 2536 DefinitionId string `json:"definitionId,omitempty"` 2537 2538 // FormattedNumEvents: The current number of times this event has 2539 // occurred, as a string. The formatting of this string depends on the 2540 // configuration of your event in the Play Games Developer Console. 2541 FormattedNumEvents string `json:"formattedNumEvents,omitempty"` 2542 2543 // Kind: Uniquely identifies the type of this resource. Value is always 2544 // the fixed string games#playerEvent. 2545 Kind string `json:"kind,omitempty"` 2546 2547 // NumEvents: The current number of times this event has occurred. 2548 NumEvents int64 `json:"numEvents,omitempty,string"` 2549 2550 // PlayerId: The ID of the player. 2551 PlayerId string `json:"playerId,omitempty"` 2552 2553 // ForceSendFields is a list of field names (e.g. "DefinitionId") to 2554 // unconditionally include in API requests. By default, fields with 2555 // empty values are omitted from API requests. However, any non-pointer, 2556 // non-interface field appearing in ForceSendFields will be sent to the 2557 // server regardless of whether the field is empty or not. This may be 2558 // used to include empty fields in Patch requests. 2559 ForceSendFields []string `json:"-"` 2560 2561 // NullFields is a list of field names (e.g. "DefinitionId") to include 2562 // in API requests with the JSON null value. By default, fields with 2563 // empty values are omitted from API requests. However, any field with 2564 // an empty value appearing in NullFields will be sent to the server as 2565 // null. It is an error if a field in this list has a non-empty value. 2566 // This may be used to include null fields in Patch requests. 2567 NullFields []string `json:"-"` 2568} 2569 2570func (s *PlayerEvent) MarshalJSON() ([]byte, error) { 2571 type NoMethod PlayerEvent 2572 raw := NoMethod(*s) 2573 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2574} 2575 2576// PlayerEventListResponse: This is a JSON template for a ListByPlayer 2577// response. 2578type PlayerEventListResponse struct { 2579 // Items: The player events. 2580 Items []*PlayerEvent `json:"items,omitempty"` 2581 2582 // Kind: Uniquely identifies the type of this resource. Value is always 2583 // the fixed string games#playerEventListResponse. 2584 Kind string `json:"kind,omitempty"` 2585 2586 // NextPageToken: The pagination token for the next page of results. 2587 NextPageToken string `json:"nextPageToken,omitempty"` 2588 2589 // ServerResponse contains the HTTP response code and headers from the 2590 // server. 2591 googleapi.ServerResponse `json:"-"` 2592 2593 // ForceSendFields is a list of field names (e.g. "Items") to 2594 // unconditionally include in API requests. By default, fields with 2595 // empty values are omitted from API requests. However, any non-pointer, 2596 // non-interface field appearing in ForceSendFields will be sent to the 2597 // server regardless of whether the field is empty or not. This may be 2598 // used to include empty fields in Patch requests. 2599 ForceSendFields []string `json:"-"` 2600 2601 // NullFields is a list of field names (e.g. "Items") to include in API 2602 // requests with the JSON null value. By default, fields with empty 2603 // values are omitted from API requests. However, any field with an 2604 // empty value appearing in NullFields will be sent to the server as 2605 // null. It is an error if a field in this list has a non-empty value. 2606 // This may be used to include null fields in Patch requests. 2607 NullFields []string `json:"-"` 2608} 2609 2610func (s *PlayerEventListResponse) MarshalJSON() ([]byte, error) { 2611 type NoMethod PlayerEventListResponse 2612 raw := NoMethod(*s) 2613 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2614} 2615 2616// PlayerExperienceInfo: This is a JSON template for 1P/3P metadata 2617// about the player's experience. 2618type PlayerExperienceInfo struct { 2619 // CurrentExperiencePoints: The current number of experience points for 2620 // the player. 2621 CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"` 2622 2623 // CurrentLevel: The current level of the player. 2624 CurrentLevel *PlayerLevel `json:"currentLevel,omitempty"` 2625 2626 // Kind: Uniquely identifies the type of this resource. Value is always 2627 // the fixed string games#playerExperienceInfo. 2628 Kind string `json:"kind,omitempty"` 2629 2630 // LastLevelUpTimestampMillis: The timestamp when the player was leveled 2631 // up, in millis since Unix epoch UTC. 2632 LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"` 2633 2634 // NextLevel: The next level of the player. If the current level is the 2635 // maximum level, this should be same as the current level. 2636 NextLevel *PlayerLevel `json:"nextLevel,omitempty"` 2637 2638 // ForceSendFields is a list of field names (e.g. 2639 // "CurrentExperiencePoints") to unconditionally include in API 2640 // requests. By default, fields with empty values are omitted from API 2641 // requests. However, any non-pointer, non-interface field appearing in 2642 // ForceSendFields will be sent to the server regardless of whether the 2643 // field is empty or not. This may be used to include empty fields in 2644 // Patch requests. 2645 ForceSendFields []string `json:"-"` 2646 2647 // NullFields is a list of field names (e.g. "CurrentExperiencePoints") 2648 // to include in API requests with the JSON null value. By default, 2649 // fields with empty values are omitted from API requests. However, any 2650 // field with an empty value appearing in NullFields will be sent to the 2651 // server as null. It is an error if a field in this list has a 2652 // non-empty value. This may be used to include null fields in Patch 2653 // requests. 2654 NullFields []string `json:"-"` 2655} 2656 2657func (s *PlayerExperienceInfo) MarshalJSON() ([]byte, error) { 2658 type NoMethod PlayerExperienceInfo 2659 raw := NoMethod(*s) 2660 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2661} 2662 2663// PlayerLeaderboardScore: This is a JSON template for a player 2664// leaderboard score object. 2665type PlayerLeaderboardScore struct { 2666 // Kind: Uniquely identifies the type of this resource. Value is always 2667 // the fixed string games#playerLeaderboardScore. 2668 Kind string `json:"kind,omitempty"` 2669 2670 // LeaderboardId: The ID of the leaderboard this score is in. 2671 LeaderboardId string `json:"leaderboard_id,omitempty"` 2672 2673 // PublicRank: The public rank of the score in this leaderboard. This 2674 // object will not be present if the user is not sharing their scores 2675 // publicly. 2676 PublicRank *LeaderboardScoreRank `json:"publicRank,omitempty"` 2677 2678 // ScoreString: The formatted value of this score. 2679 ScoreString string `json:"scoreString,omitempty"` 2680 2681 // ScoreTag: Additional information about the score. Values must contain 2682 // no more than 64 URI-safe characters as defined by section 2.3 of RFC 2683 // 3986. 2684 ScoreTag string `json:"scoreTag,omitempty"` 2685 2686 // ScoreValue: The numerical value of this score. 2687 ScoreValue int64 `json:"scoreValue,omitempty,string"` 2688 2689 // SocialRank: The social rank of the score in this leaderboard. 2690 SocialRank *LeaderboardScoreRank `json:"socialRank,omitempty"` 2691 2692 // TimeSpan: The time span of this score. 2693 // Possible values are: 2694 // - "ALL_TIME" - The score is an all-time score. 2695 // - "WEEKLY" - The score is a weekly score. 2696 // - "DAILY" - The score is a daily score. 2697 TimeSpan string `json:"timeSpan,omitempty"` 2698 2699 // WriteTimestamp: The timestamp at which this score was recorded, in 2700 // milliseconds since the epoch in UTC. 2701 WriteTimestamp int64 `json:"writeTimestamp,omitempty,string"` 2702 2703 // ForceSendFields is a list of field names (e.g. "Kind") to 2704 // unconditionally include in API requests. By default, fields with 2705 // empty values are omitted from API requests. However, any non-pointer, 2706 // non-interface field appearing in ForceSendFields will be sent to the 2707 // server regardless of whether the field is empty or not. This may be 2708 // used to include empty fields in Patch requests. 2709 ForceSendFields []string `json:"-"` 2710 2711 // NullFields is a list of field names (e.g. "Kind") to include in API 2712 // requests with the JSON null value. By default, fields with empty 2713 // values are omitted from API requests. However, any field with an 2714 // empty value appearing in NullFields will be sent to the server as 2715 // null. It is an error if a field in this list has a non-empty value. 2716 // This may be used to include null fields in Patch requests. 2717 NullFields []string `json:"-"` 2718} 2719 2720func (s *PlayerLeaderboardScore) MarshalJSON() ([]byte, error) { 2721 type NoMethod PlayerLeaderboardScore 2722 raw := NoMethod(*s) 2723 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2724} 2725 2726// PlayerLeaderboardScoreListResponse: This is a JSON template for a 2727// list of player leaderboard scores. 2728type PlayerLeaderboardScoreListResponse struct { 2729 // Items: The leaderboard scores. 2730 Items []*PlayerLeaderboardScore `json:"items,omitempty"` 2731 2732 // Kind: Uniquely identifies the type of this resource. Value is always 2733 // the fixed string games#playerLeaderboardScoreListResponse. 2734 Kind string `json:"kind,omitempty"` 2735 2736 // NextPageToken: The pagination token for the next page of results. 2737 NextPageToken string `json:"nextPageToken,omitempty"` 2738 2739 // Player: The Player resources for the owner of this score. 2740 Player *Player `json:"player,omitempty"` 2741 2742 // ServerResponse contains the HTTP response code and headers from the 2743 // server. 2744 googleapi.ServerResponse `json:"-"` 2745 2746 // ForceSendFields is a list of field names (e.g. "Items") to 2747 // unconditionally include in API requests. By default, fields with 2748 // empty values are omitted from API requests. However, any non-pointer, 2749 // non-interface field appearing in ForceSendFields will be sent to the 2750 // server regardless of whether the field is empty or not. This may be 2751 // used to include empty fields in Patch requests. 2752 ForceSendFields []string `json:"-"` 2753 2754 // NullFields is a list of field names (e.g. "Items") to include in API 2755 // requests with the JSON null value. By default, fields with empty 2756 // values are omitted from API requests. However, any field with an 2757 // empty value appearing in NullFields will be sent to the server as 2758 // null. It is an error if a field in this list has a non-empty value. 2759 // This may be used to include null fields in Patch requests. 2760 NullFields []string `json:"-"` 2761} 2762 2763func (s *PlayerLeaderboardScoreListResponse) MarshalJSON() ([]byte, error) { 2764 type NoMethod PlayerLeaderboardScoreListResponse 2765 raw := NoMethod(*s) 2766 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2767} 2768 2769// PlayerLevel: This is a JSON template for 1P/3P metadata about a 2770// user's level. 2771type PlayerLevel struct { 2772 // Kind: Uniquely identifies the type of this resource. Value is always 2773 // the fixed string games#playerLevel. 2774 Kind string `json:"kind,omitempty"` 2775 2776 // Level: The level for the user. 2777 Level int64 `json:"level,omitempty"` 2778 2779 // MaxExperiencePoints: The maximum experience points for this level. 2780 MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"` 2781 2782 // MinExperiencePoints: The minimum experience points for this level. 2783 MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"` 2784 2785 // ForceSendFields is a list of field names (e.g. "Kind") to 2786 // unconditionally include in API requests. By default, fields with 2787 // empty values are omitted from API requests. However, any non-pointer, 2788 // non-interface field appearing in ForceSendFields will be sent to the 2789 // server regardless of whether the field is empty or not. This may be 2790 // used to include empty fields in Patch requests. 2791 ForceSendFields []string `json:"-"` 2792 2793 // NullFields is a list of field names (e.g. "Kind") to include in API 2794 // requests with the JSON null value. By default, fields with empty 2795 // values are omitted from API requests. However, any field with an 2796 // empty value appearing in NullFields will be sent to the server as 2797 // null. It is an error if a field in this list has a non-empty value. 2798 // This may be used to include null fields in Patch requests. 2799 NullFields []string `json:"-"` 2800} 2801 2802func (s *PlayerLevel) MarshalJSON() ([]byte, error) { 2803 type NoMethod PlayerLevel 2804 raw := NoMethod(*s) 2805 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2806} 2807 2808// PlayerListResponse: This is a JSON template for a third party player 2809// list response. 2810type PlayerListResponse struct { 2811 // Items: The players. 2812 Items []*Player `json:"items,omitempty"` 2813 2814 // Kind: Uniquely identifies the type of this resource. Value is always 2815 // the fixed string games#playerListResponse. 2816 Kind string `json:"kind,omitempty"` 2817 2818 // NextPageToken: Token corresponding to the next page of results. 2819 NextPageToken string `json:"nextPageToken,omitempty"` 2820 2821 // ServerResponse contains the HTTP response code and headers from the 2822 // server. 2823 googleapi.ServerResponse `json:"-"` 2824 2825 // ForceSendFields is a list of field names (e.g. "Items") to 2826 // unconditionally include in API requests. By default, fields with 2827 // empty values are omitted from API requests. However, any non-pointer, 2828 // non-interface field appearing in ForceSendFields will be sent to the 2829 // server regardless of whether the field is empty or not. This may be 2830 // used to include empty fields in Patch requests. 2831 ForceSendFields []string `json:"-"` 2832 2833 // NullFields is a list of field names (e.g. "Items") to include in API 2834 // requests with the JSON null value. By default, fields with empty 2835 // values are omitted from API requests. However, any field with an 2836 // empty value appearing in NullFields will be sent to the server as 2837 // null. It is an error if a field in this list has a non-empty value. 2838 // This may be used to include null fields in Patch requests. 2839 NullFields []string `json:"-"` 2840} 2841 2842func (s *PlayerListResponse) MarshalJSON() ([]byte, error) { 2843 type NoMethod PlayerListResponse 2844 raw := NoMethod(*s) 2845 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2846} 2847 2848// PlayerScore: This is a JSON template for a player score. 2849type PlayerScore struct { 2850 // FormattedScore: The formatted score for this player score. 2851 FormattedScore string `json:"formattedScore,omitempty"` 2852 2853 // Kind: Uniquely identifies the type of this resource. Value is always 2854 // the fixed string games#playerScore. 2855 Kind string `json:"kind,omitempty"` 2856 2857 // Score: The numerical value for this player score. 2858 Score int64 `json:"score,omitempty,string"` 2859 2860 // ScoreTag: Additional information about this score. Values will 2861 // contain no more than 64 URI-safe characters as defined by section 2.3 2862 // of RFC 3986. 2863 ScoreTag string `json:"scoreTag,omitempty"` 2864 2865 // TimeSpan: The time span for this player score. 2866 // Possible values are: 2867 // - "ALL_TIME" - The score is an all-time score. 2868 // - "WEEKLY" - The score is a weekly score. 2869 // - "DAILY" - The score is a daily score. 2870 TimeSpan string `json:"timeSpan,omitempty"` 2871 2872 // ForceSendFields is a list of field names (e.g. "FormattedScore") to 2873 // unconditionally include in API requests. By default, fields with 2874 // empty values are omitted from API requests. However, any non-pointer, 2875 // non-interface field appearing in ForceSendFields will be sent to the 2876 // server regardless of whether the field is empty or not. This may be 2877 // used to include empty fields in Patch requests. 2878 ForceSendFields []string `json:"-"` 2879 2880 // NullFields is a list of field names (e.g. "FormattedScore") to 2881 // include in API requests with the JSON null value. By default, fields 2882 // with empty values are omitted from API requests. However, any field 2883 // with an empty value appearing in NullFields will be sent to the 2884 // server as null. It is an error if a field in this list has a 2885 // non-empty value. This may be used to include null fields in Patch 2886 // requests. 2887 NullFields []string `json:"-"` 2888} 2889 2890func (s *PlayerScore) MarshalJSON() ([]byte, error) { 2891 type NoMethod PlayerScore 2892 raw := NoMethod(*s) 2893 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2894} 2895 2896// PlayerScoreListResponse: This is a JSON template for a list of score 2897// submission statuses. 2898type PlayerScoreListResponse struct { 2899 // Kind: Uniquely identifies the type of this resource. Value is always 2900 // the fixed string games#playerScoreListResponse. 2901 Kind string `json:"kind,omitempty"` 2902 2903 // SubmittedScores: The score submissions statuses. 2904 SubmittedScores []*PlayerScoreResponse `json:"submittedScores,omitempty"` 2905 2906 // ServerResponse contains the HTTP response code and headers from the 2907 // server. 2908 googleapi.ServerResponse `json:"-"` 2909 2910 // ForceSendFields is a list of field names (e.g. "Kind") to 2911 // unconditionally include in API requests. By default, fields with 2912 // empty values are omitted from API requests. However, any non-pointer, 2913 // non-interface field appearing in ForceSendFields will be sent to the 2914 // server regardless of whether the field is empty or not. This may be 2915 // used to include empty fields in Patch requests. 2916 ForceSendFields []string `json:"-"` 2917 2918 // NullFields is a list of field names (e.g. "Kind") to include in API 2919 // requests with the JSON null value. By default, fields with empty 2920 // values are omitted from API requests. However, any field with an 2921 // empty value appearing in NullFields will be sent to the server as 2922 // null. It is an error if a field in this list has a non-empty value. 2923 // This may be used to include null fields in Patch requests. 2924 NullFields []string `json:"-"` 2925} 2926 2927func (s *PlayerScoreListResponse) MarshalJSON() ([]byte, error) { 2928 type NoMethod PlayerScoreListResponse 2929 raw := NoMethod(*s) 2930 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2931} 2932 2933// PlayerScoreResponse: This is a JSON template for a list of 2934// leaderboard entry resources. 2935type PlayerScoreResponse struct { 2936 // BeatenScoreTimeSpans: The time spans where the submitted score is 2937 // better than the existing score for that time span. 2938 // Possible values are: 2939 // - "ALL_TIME" - The score is an all-time score. 2940 // - "WEEKLY" - The score is a weekly score. 2941 // - "DAILY" - The score is a daily score. 2942 BeatenScoreTimeSpans []string `json:"beatenScoreTimeSpans,omitempty"` 2943 2944 // FormattedScore: The formatted value of the submitted score. 2945 FormattedScore string `json:"formattedScore,omitempty"` 2946 2947 // Kind: Uniquely identifies the type of this resource. Value is always 2948 // the fixed string games#playerScoreResponse. 2949 Kind string `json:"kind,omitempty"` 2950 2951 // LeaderboardId: The leaderboard ID that this score was submitted to. 2952 LeaderboardId string `json:"leaderboardId,omitempty"` 2953 2954 // ScoreTag: Additional information about this score. Values will 2955 // contain no more than 64 URI-safe characters as defined by section 2.3 2956 // of RFC 3986. 2957 ScoreTag string `json:"scoreTag,omitempty"` 2958 2959 // UnbeatenScores: The scores in time spans that have not been beaten. 2960 // As an example, the submitted score may be better than the player's 2961 // DAILY score, but not better than the player's scores for the WEEKLY 2962 // or ALL_TIME time spans. 2963 UnbeatenScores []*PlayerScore `json:"unbeatenScores,omitempty"` 2964 2965 // ServerResponse contains the HTTP response code and headers from the 2966 // server. 2967 googleapi.ServerResponse `json:"-"` 2968 2969 // ForceSendFields is a list of field names (e.g. 2970 // "BeatenScoreTimeSpans") to unconditionally include in API requests. 2971 // By default, fields with empty values are omitted from API requests. 2972 // However, any non-pointer, non-interface field appearing in 2973 // ForceSendFields will be sent to the server regardless of whether the 2974 // field is empty or not. This may be used to include empty fields in 2975 // Patch requests. 2976 ForceSendFields []string `json:"-"` 2977 2978 // NullFields is a list of field names (e.g. "BeatenScoreTimeSpans") to 2979 // include in API requests with the JSON null value. By default, fields 2980 // with empty values are omitted from API requests. However, any field 2981 // with an empty value appearing in NullFields will be sent to the 2982 // server as null. It is an error if a field in this list has a 2983 // non-empty value. This may be used to include null fields in Patch 2984 // requests. 2985 NullFields []string `json:"-"` 2986} 2987 2988func (s *PlayerScoreResponse) MarshalJSON() ([]byte, error) { 2989 type NoMethod PlayerScoreResponse 2990 raw := NoMethod(*s) 2991 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2992} 2993 2994// PlayerScoreSubmissionList: This is a JSON template for a list of 2995// score submission requests 2996type PlayerScoreSubmissionList struct { 2997 // Kind: Uniquely identifies the type of this resource. Value is always 2998 // the fixed string games#playerScoreSubmissionList. 2999 Kind string `json:"kind,omitempty"` 3000 3001 // Scores: The score submissions. 3002 Scores []*ScoreSubmission `json:"scores,omitempty"` 3003 3004 // ForceSendFields is a list of field names (e.g. "Kind") to 3005 // unconditionally include in API requests. By default, fields with 3006 // empty values are omitted from API requests. However, any non-pointer, 3007 // non-interface field appearing in ForceSendFields will be sent to the 3008 // server regardless of whether the field is empty or not. This may be 3009 // used to include empty fields in Patch requests. 3010 ForceSendFields []string `json:"-"` 3011 3012 // NullFields is a list of field names (e.g. "Kind") to include in API 3013 // requests with the JSON null value. By default, fields with empty 3014 // values are omitted from API requests. However, any field with an 3015 // empty value appearing in NullFields will be sent to the server as 3016 // null. It is an error if a field in this list has a non-empty value. 3017 // This may be used to include null fields in Patch requests. 3018 NullFields []string `json:"-"` 3019} 3020 3021func (s *PlayerScoreSubmissionList) MarshalJSON() ([]byte, error) { 3022 type NoMethod PlayerScoreSubmissionList 3023 raw := NoMethod(*s) 3024 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3025} 3026 3027// ProfileSettings: This is a JSON template for profile settings 3028type ProfileSettings struct { 3029 // Kind: Uniquely identifies the type of this resource. Value is always 3030 // the fixed string games#profileSettings. 3031 Kind string `json:"kind,omitempty"` 3032 3033 ProfileVisible bool `json:"profileVisible,omitempty"` 3034 3035 // ForceSendFields is a list of field names (e.g. "Kind") to 3036 // unconditionally include in API requests. By default, fields with 3037 // empty values are omitted from API requests. However, any non-pointer, 3038 // non-interface field appearing in ForceSendFields will be sent to the 3039 // server regardless of whether the field is empty or not. This may be 3040 // used to include empty fields in Patch requests. 3041 ForceSendFields []string `json:"-"` 3042 3043 // NullFields is a list of field names (e.g. "Kind") to include in API 3044 // requests with the JSON null value. By default, fields with empty 3045 // values are omitted from API requests. However, any field with an 3046 // empty value appearing in NullFields will be sent to the server as 3047 // null. It is an error if a field in this list has a non-empty value. 3048 // This may be used to include null fields in Patch requests. 3049 NullFields []string `json:"-"` 3050} 3051 3052func (s *ProfileSettings) MarshalJSON() ([]byte, error) { 3053 type NoMethod ProfileSettings 3054 raw := NoMethod(*s) 3055 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3056} 3057 3058// PushToken: This is a JSON template for a push token resource. 3059type PushToken struct { 3060 // ClientRevision: The revision of the client SDK used by your 3061 // application, in the same format that's used by revisions.check. Used 3062 // to send backward compatible messages. Format: 3063 // [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE 3064 // are: 3065 // - IOS - Push token is for iOS 3066 ClientRevision string `json:"clientRevision,omitempty"` 3067 3068 // Id: Unique identifier for this push token. 3069 Id *PushTokenId `json:"id,omitempty"` 3070 3071 // Kind: Uniquely identifies the type of this resource. Value is always 3072 // the fixed string games#pushToken. 3073 Kind string `json:"kind,omitempty"` 3074 3075 // Language: The preferred language for notifications that are sent 3076 // using this token. 3077 Language string `json:"language,omitempty"` 3078 3079 // ForceSendFields is a list of field names (e.g. "ClientRevision") to 3080 // unconditionally include in API requests. By default, fields with 3081 // empty values are omitted from API requests. However, any non-pointer, 3082 // non-interface field appearing in ForceSendFields will be sent to the 3083 // server regardless of whether the field is empty or not. This may be 3084 // used to include empty fields in Patch requests. 3085 ForceSendFields []string `json:"-"` 3086 3087 // NullFields is a list of field names (e.g. "ClientRevision") to 3088 // include in API requests with the JSON null value. By default, fields 3089 // with empty values are omitted from API requests. However, any field 3090 // with an empty value appearing in NullFields will be sent to the 3091 // server as null. It is an error if a field in this list has a 3092 // non-empty value. This may be used to include null fields in Patch 3093 // requests. 3094 NullFields []string `json:"-"` 3095} 3096 3097func (s *PushToken) MarshalJSON() ([]byte, error) { 3098 type NoMethod PushToken 3099 raw := NoMethod(*s) 3100 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3101} 3102 3103// PushTokenId: This is a JSON template for a push token ID resource. 3104type PushTokenId struct { 3105 // Ios: A push token ID for iOS devices. 3106 Ios *PushTokenIdIos `json:"ios,omitempty"` 3107 3108 // Kind: Uniquely identifies the type of this resource. Value is always 3109 // the fixed string games#pushTokenId. 3110 Kind string `json:"kind,omitempty"` 3111 3112 // ForceSendFields is a list of field names (e.g. "Ios") to 3113 // unconditionally include in API requests. By default, fields with 3114 // empty values are omitted from API requests. However, any non-pointer, 3115 // non-interface field appearing in ForceSendFields will be sent to the 3116 // server regardless of whether the field is empty or not. This may be 3117 // used to include empty fields in Patch requests. 3118 ForceSendFields []string `json:"-"` 3119 3120 // NullFields is a list of field names (e.g. "Ios") to include in API 3121 // requests with the JSON null value. By default, fields with empty 3122 // values are omitted from API requests. However, any field with an 3123 // empty value appearing in NullFields will be sent to the server as 3124 // null. It is an error if a field in this list has a non-empty value. 3125 // This may be used to include null fields in Patch requests. 3126 NullFields []string `json:"-"` 3127} 3128 3129func (s *PushTokenId) MarshalJSON() ([]byte, error) { 3130 type NoMethod PushTokenId 3131 raw := NoMethod(*s) 3132 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3133} 3134 3135// PushTokenIdIos: A push token ID for iOS devices. 3136type PushTokenIdIos struct { 3137 // ApnsDeviceToken: Device token supplied by an iOS system call to 3138 // register for remote notifications. Encode this field as web-safe 3139 // base64. 3140 ApnsDeviceToken string `json:"apns_device_token,omitempty"` 3141 3142 // ApnsEnvironment: Indicates whether this token should be used for the 3143 // production or sandbox APNS server. 3144 ApnsEnvironment string `json:"apns_environment,omitempty"` 3145 3146 // ForceSendFields is a list of field names (e.g. "ApnsDeviceToken") to 3147 // unconditionally include in API requests. By default, fields with 3148 // empty values are omitted from API requests. However, any non-pointer, 3149 // non-interface field appearing in ForceSendFields will be sent to the 3150 // server regardless of whether the field is empty or not. This may be 3151 // used to include empty fields in Patch requests. 3152 ForceSendFields []string `json:"-"` 3153 3154 // NullFields is a list of field names (e.g. "ApnsDeviceToken") to 3155 // include in API requests with the JSON null value. By default, fields 3156 // with empty values are omitted from API requests. However, any field 3157 // with an empty value appearing in NullFields will be sent to the 3158 // server as null. It is an error if a field in this list has a 3159 // non-empty value. This may be used to include null fields in Patch 3160 // requests. 3161 NullFields []string `json:"-"` 3162} 3163 3164func (s *PushTokenIdIos) MarshalJSON() ([]byte, error) { 3165 type NoMethod PushTokenIdIos 3166 raw := NoMethod(*s) 3167 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3168} 3169 3170// RevisionCheckResponse: This is a JSON template for the result of 3171// checking a revision. 3172type RevisionCheckResponse struct { 3173 // ApiVersion: The version of the API this client revision should use 3174 // when calling API methods. 3175 ApiVersion string `json:"apiVersion,omitempty"` 3176 3177 // Kind: Uniquely identifies the type of this resource. Value is always 3178 // the fixed string games#revisionCheckResponse. 3179 Kind string `json:"kind,omitempty"` 3180 3181 // RevisionStatus: The result of the revision check. 3182 // Possible values are: 3183 // - "OK" - The revision being used is current. 3184 // - "DEPRECATED" - There is currently a newer version available, but 3185 // the revision being used still works. 3186 // - "INVALID" - The revision being used is not supported in any 3187 // released version. 3188 RevisionStatus string `json:"revisionStatus,omitempty"` 3189 3190 // ServerResponse contains the HTTP response code and headers from the 3191 // server. 3192 googleapi.ServerResponse `json:"-"` 3193 3194 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 3195 // unconditionally include in API requests. By default, fields with 3196 // empty values are omitted from API requests. However, any non-pointer, 3197 // non-interface field appearing in ForceSendFields will be sent to the 3198 // server regardless of whether the field is empty or not. This may be 3199 // used to include empty fields in Patch requests. 3200 ForceSendFields []string `json:"-"` 3201 3202 // NullFields is a list of field names (e.g. "ApiVersion") to include in 3203 // API requests with the JSON null value. By default, fields with empty 3204 // values are omitted from API requests. However, any field with an 3205 // empty value appearing in NullFields will be sent to the server as 3206 // null. It is an error if a field in this list has a non-empty value. 3207 // This may be used to include null fields in Patch requests. 3208 NullFields []string `json:"-"` 3209} 3210 3211func (s *RevisionCheckResponse) MarshalJSON() ([]byte, error) { 3212 type NoMethod RevisionCheckResponse 3213 raw := NoMethod(*s) 3214 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3215} 3216 3217// Room: This is a JSON template for a room resource object. 3218type Room struct { 3219 // ApplicationId: The ID of the application being played. 3220 ApplicationId string `json:"applicationId,omitempty"` 3221 3222 // AutoMatchingCriteria: Criteria for auto-matching players into this 3223 // room. 3224 AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` 3225 3226 // AutoMatchingStatus: Auto-matching status for this room. Not set if 3227 // the room is not currently in the auto-matching queue. 3228 AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"` 3229 3230 // CreationDetails: Details about the room creation. 3231 CreationDetails *RoomModification `json:"creationDetails,omitempty"` 3232 3233 // Description: This short description is generated by our servers and 3234 // worded relative to the player requesting the room. It is intended to 3235 // be displayed when the room is shown in a list (that is, an invitation 3236 // to a room.) 3237 Description string `json:"description,omitempty"` 3238 3239 // InviterId: The ID of the participant that invited the user to the 3240 // room. Not set if the user was not invited to the room. 3241 InviterId string `json:"inviterId,omitempty"` 3242 3243 // Kind: Uniquely identifies the type of this resource. Value is always 3244 // the fixed string games#room. 3245 Kind string `json:"kind,omitempty"` 3246 3247 // LastUpdateDetails: Details about the last update to the room. 3248 LastUpdateDetails *RoomModification `json:"lastUpdateDetails,omitempty"` 3249 3250 // Participants: The participants involved in the room, along with their 3251 // statuses. Includes participants who have left or declined 3252 // invitations. 3253 Participants []*RoomParticipant `json:"participants,omitempty"` 3254 3255 // RoomId: Globally unique ID for a room. 3256 RoomId string `json:"roomId,omitempty"` 3257 3258 // RoomStatusVersion: The version of the room status: an increasing 3259 // counter, used by the client to ignore out-of-order updates to room 3260 // status. 3261 RoomStatusVersion int64 `json:"roomStatusVersion,omitempty"` 3262 3263 // Status: The status of the room. 3264 // Possible values are: 3265 // - "ROOM_INVITING" - One or more players have been invited and not 3266 // responded. 3267 // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by 3268 // auto-matching. 3269 // - "ROOM_CONNECTING" - Players have joined and are connecting to each 3270 // other (either before or after auto-matching). 3271 // - "ROOM_ACTIVE" - All players have joined and connected to each 3272 // other. 3273 // - "ROOM_DELETED" - The room should no longer be shown on the client. 3274 // Returned in sync calls when a player joins a room (as a tombstone), 3275 // or for rooms where all joined participants have left. 3276 Status string `json:"status,omitempty"` 3277 3278 // Variant: The variant / mode of the application being played; can be 3279 // any integer value, or left blank. 3280 Variant int64 `json:"variant,omitempty"` 3281 3282 // ServerResponse contains the HTTP response code and headers from the 3283 // server. 3284 googleapi.ServerResponse `json:"-"` 3285 3286 // ForceSendFields is a list of field names (e.g. "ApplicationId") to 3287 // unconditionally include in API requests. By default, fields with 3288 // empty values are omitted from API requests. However, any non-pointer, 3289 // non-interface field appearing in ForceSendFields will be sent to the 3290 // server regardless of whether the field is empty or not. This may be 3291 // used to include empty fields in Patch requests. 3292 ForceSendFields []string `json:"-"` 3293 3294 // NullFields is a list of field names (e.g. "ApplicationId") to include 3295 // in API requests with the JSON null value. By default, fields with 3296 // empty values are omitted from API requests. However, any field with 3297 // an empty value appearing in NullFields will be sent to the server as 3298 // null. It is an error if a field in this list has a non-empty value. 3299 // This may be used to include null fields in Patch requests. 3300 NullFields []string `json:"-"` 3301} 3302 3303func (s *Room) MarshalJSON() ([]byte, error) { 3304 type NoMethod Room 3305 raw := NoMethod(*s) 3306 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3307} 3308 3309// RoomAutoMatchStatus: This is a JSON template for status of room 3310// automatching that is in progress. 3311type RoomAutoMatchStatus struct { 3312 // Kind: Uniquely identifies the type of this resource. Value is always 3313 // the fixed string games#roomAutoMatchStatus. 3314 Kind string `json:"kind,omitempty"` 3315 3316 // WaitEstimateSeconds: An estimate for the amount of time (in seconds) 3317 // that auto-matching is expected to take to complete. 3318 WaitEstimateSeconds int64 `json:"waitEstimateSeconds,omitempty"` 3319 3320 // ForceSendFields is a list of field names (e.g. "Kind") to 3321 // unconditionally include in API requests. By default, fields with 3322 // empty values are omitted from API requests. However, any non-pointer, 3323 // non-interface field appearing in ForceSendFields will be sent to the 3324 // server regardless of whether the field is empty or not. This may be 3325 // used to include empty fields in Patch requests. 3326 ForceSendFields []string `json:"-"` 3327 3328 // NullFields is a list of field names (e.g. "Kind") to include in API 3329 // requests with the JSON null value. By default, fields with empty 3330 // values are omitted from API requests. However, any field with an 3331 // empty value appearing in NullFields will be sent to the server as 3332 // null. It is an error if a field in this list has a non-empty value. 3333 // This may be used to include null fields in Patch requests. 3334 NullFields []string `json:"-"` 3335} 3336 3337func (s *RoomAutoMatchStatus) MarshalJSON() ([]byte, error) { 3338 type NoMethod RoomAutoMatchStatus 3339 raw := NoMethod(*s) 3340 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3341} 3342 3343// RoomAutoMatchingCriteria: This is a JSON template for a room 3344// auto-match criteria object. 3345type RoomAutoMatchingCriteria struct { 3346 // ExclusiveBitmask: A bitmask indicating when auto-matches are valid. 3347 // When ANDed with other exclusive bitmasks, the result must be zero. 3348 // Can be used to support exclusive roles within a game. 3349 ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"` 3350 3351 // Kind: Uniquely identifies the type of this resource. Value is always 3352 // the fixed string games#roomAutoMatchingCriteria. 3353 Kind string `json:"kind,omitempty"` 3354 3355 // MaxAutoMatchingPlayers: The maximum number of players that should be 3356 // added to the room by auto-matching. 3357 MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"` 3358 3359 // MinAutoMatchingPlayers: The minimum number of players that should be 3360 // added to the room by auto-matching. 3361 MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"` 3362 3363 // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to 3364 // unconditionally include in API requests. By default, fields with 3365 // empty values are omitted from API requests. However, any non-pointer, 3366 // non-interface field appearing in ForceSendFields will be sent to the 3367 // server regardless of whether the field is empty or not. This may be 3368 // used to include empty fields in Patch requests. 3369 ForceSendFields []string `json:"-"` 3370 3371 // NullFields is a list of field names (e.g. "ExclusiveBitmask") to 3372 // include in API requests with the JSON null value. By default, fields 3373 // with empty values are omitted from API requests. However, any field 3374 // with an empty value appearing in NullFields will be sent to the 3375 // server as null. It is an error if a field in this list has a 3376 // non-empty value. This may be used to include null fields in Patch 3377 // requests. 3378 NullFields []string `json:"-"` 3379} 3380 3381func (s *RoomAutoMatchingCriteria) MarshalJSON() ([]byte, error) { 3382 type NoMethod RoomAutoMatchingCriteria 3383 raw := NoMethod(*s) 3384 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3385} 3386 3387// RoomClientAddress: This is a JSON template for the client address 3388// when setting up a room. 3389type RoomClientAddress struct { 3390 // Kind: Uniquely identifies the type of this resource. Value is always 3391 // the fixed string games#roomClientAddress. 3392 Kind string `json:"kind,omitempty"` 3393 3394 // XmppAddress: The XMPP address of the client on the Google Games XMPP 3395 // network. 3396 XmppAddress string `json:"xmppAddress,omitempty"` 3397 3398 // ForceSendFields is a list of field names (e.g. "Kind") to 3399 // unconditionally include in API requests. By default, fields with 3400 // empty values are omitted from API requests. However, any non-pointer, 3401 // non-interface field appearing in ForceSendFields will be sent to the 3402 // server regardless of whether the field is empty or not. This may be 3403 // used to include empty fields in Patch requests. 3404 ForceSendFields []string `json:"-"` 3405 3406 // NullFields is a list of field names (e.g. "Kind") to include in API 3407 // requests with the JSON null value. By default, fields with empty 3408 // values are omitted from API requests. However, any field with an 3409 // empty value appearing in NullFields will be sent to the server as 3410 // null. It is an error if a field in this list has a non-empty value. 3411 // This may be used to include null fields in Patch requests. 3412 NullFields []string `json:"-"` 3413} 3414 3415func (s *RoomClientAddress) MarshalJSON() ([]byte, error) { 3416 type NoMethod RoomClientAddress 3417 raw := NoMethod(*s) 3418 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3419} 3420 3421// RoomCreateRequest: This is a JSON template for a room creation 3422// request. 3423type RoomCreateRequest struct { 3424 // AutoMatchingCriteria: Criteria for auto-matching players into this 3425 // room. 3426 AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` 3427 3428 // Capabilities: The capabilities that this client supports for realtime 3429 // communication. 3430 Capabilities []string `json:"capabilities,omitempty"` 3431 3432 // ClientAddress: Client address for the player creating the room. 3433 ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` 3434 3435 // InvitedPlayerIds: The player IDs to invite to the room. 3436 InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"` 3437 3438 // Kind: Uniquely identifies the type of this resource. Value is always 3439 // the fixed string games#roomCreateRequest. 3440 Kind string `json:"kind,omitempty"` 3441 3442 // NetworkDiagnostics: Network diagnostics for the client creating the 3443 // room. 3444 NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"` 3445 3446 // RequestId: A randomly generated numeric ID. This number is used at 3447 // the server to ensure that the request is handled correctly across 3448 // retries. 3449 RequestId int64 `json:"requestId,omitempty,string"` 3450 3451 // Variant: The variant / mode of the application to be played. This can 3452 // be any integer value, or left blank. You should use a small number of 3453 // variants to keep the auto-matching pool as large as possible. 3454 Variant int64 `json:"variant,omitempty"` 3455 3456 // ForceSendFields is a list of field names (e.g. 3457 // "AutoMatchingCriteria") 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. "AutoMatchingCriteria") 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 *RoomCreateRequest) MarshalJSON() ([]byte, error) { 3476 type NoMethod RoomCreateRequest 3477 raw := NoMethod(*s) 3478 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3479} 3480 3481// RoomJoinRequest: This is a JSON template for a join room request. 3482type RoomJoinRequest struct { 3483 // Capabilities: The capabilities that this client supports for realtime 3484 // communication. 3485 Capabilities []string `json:"capabilities,omitempty"` 3486 3487 // ClientAddress: Client address for the player joining the room. 3488 ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` 3489 3490 // Kind: Uniquely identifies the type of this resource. Value is always 3491 // the fixed string games#roomJoinRequest. 3492 Kind string `json:"kind,omitempty"` 3493 3494 // NetworkDiagnostics: Network diagnostics for the client joining the 3495 // room. 3496 NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"` 3497 3498 // ForceSendFields is a list of field names (e.g. "Capabilities") to 3499 // unconditionally include in API requests. By default, fields with 3500 // empty values are omitted from API requests. However, any non-pointer, 3501 // non-interface field appearing in ForceSendFields will be sent to the 3502 // server regardless of whether the field is empty or not. This may be 3503 // used to include empty fields in Patch requests. 3504 ForceSendFields []string `json:"-"` 3505 3506 // NullFields is a list of field names (e.g. "Capabilities") to include 3507 // in API requests with the JSON null value. By default, fields with 3508 // empty values are omitted from API requests. However, any field with 3509 // an empty value appearing in NullFields will be sent to the server as 3510 // null. It is an error if a field in this list has a non-empty value. 3511 // This may be used to include null fields in Patch requests. 3512 NullFields []string `json:"-"` 3513} 3514 3515func (s *RoomJoinRequest) MarshalJSON() ([]byte, error) { 3516 type NoMethod RoomJoinRequest 3517 raw := NoMethod(*s) 3518 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3519} 3520 3521// RoomLeaveDiagnostics: This is a JSON template for room leave 3522// diagnostics. 3523type RoomLeaveDiagnostics struct { 3524 // AndroidNetworkSubtype: Android network subtype. 3525 // http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype() 3526 AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"` 3527 3528 // AndroidNetworkType: Android network type. 3529 // http://developer.android.com/reference/android/net/NetworkInfo.html#getType() 3530 AndroidNetworkType int64 `json:"androidNetworkType,omitempty"` 3531 3532 // IosNetworkType: iOS network type as defined in Reachability.h. 3533 IosNetworkType int64 `json:"iosNetworkType,omitempty"` 3534 3535 // Kind: Uniquely identifies the type of this resource. Value is always 3536 // the fixed string games#roomLeaveDiagnostics. 3537 Kind string `json:"kind,omitempty"` 3538 3539 // NetworkOperatorCode: The MCC+MNC code for the client's network 3540 // connection. On Android: 3541 // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see: 3542 // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html 3543 NetworkOperatorCode string `json:"networkOperatorCode,omitempty"` 3544 3545 // NetworkOperatorName: The name of the carrier of the client's network 3546 // connection. On Android: 3547 // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS: 3548 // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName 3549 NetworkOperatorName string `json:"networkOperatorName,omitempty"` 3550 3551 // PeerSession: Diagnostics about all peer sessions. 3552 PeerSession []*PeerSessionDiagnostics `json:"peerSession,omitempty"` 3553 3554 // SocketsUsed: Whether or not sockets were used. 3555 SocketsUsed bool `json:"socketsUsed,omitempty"` 3556 3557 // ForceSendFields is a list of field names (e.g. 3558 // "AndroidNetworkSubtype") to unconditionally include in API requests. 3559 // By default, fields with empty values are omitted from API requests. 3560 // However, any non-pointer, non-interface field appearing in 3561 // ForceSendFields will be sent to the server regardless of whether the 3562 // field is empty or not. This may be used to include empty fields in 3563 // Patch requests. 3564 ForceSendFields []string `json:"-"` 3565 3566 // NullFields is a list of field names (e.g. "AndroidNetworkSubtype") to 3567 // include in API requests with the JSON null value. By default, fields 3568 // with empty values are omitted from API requests. However, any field 3569 // with an empty value appearing in NullFields will be sent to the 3570 // server as null. It is an error if a field in this list has a 3571 // non-empty value. This may be used to include null fields in Patch 3572 // requests. 3573 NullFields []string `json:"-"` 3574} 3575 3576func (s *RoomLeaveDiagnostics) MarshalJSON() ([]byte, error) { 3577 type NoMethod RoomLeaveDiagnostics 3578 raw := NoMethod(*s) 3579 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3580} 3581 3582// RoomLeaveRequest: This is a JSON template for a leave room request. 3583type RoomLeaveRequest struct { 3584 // Kind: Uniquely identifies the type of this resource. Value is always 3585 // the fixed string games#roomLeaveRequest. 3586 Kind string `json:"kind,omitempty"` 3587 3588 // LeaveDiagnostics: Diagnostics for a player leaving the room. 3589 LeaveDiagnostics *RoomLeaveDiagnostics `json:"leaveDiagnostics,omitempty"` 3590 3591 // Reason: Reason for leaving the match. 3592 // Possible values are: 3593 // - "PLAYER_LEFT" - The player chose to leave the room.. 3594 // - "GAME_LEFT" - The game chose to remove the player from the room. 3595 // - "REALTIME_ABANDONED" - The player switched to another application 3596 // and abandoned the room. 3597 // - "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to 3598 // establish a connection to other peer(s). 3599 // - "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to 3600 // communicate with the server. 3601 // - "REALTIME_SERVER_ERROR" - The client received an error response 3602 // when it tried to communicate with the server. 3603 // - "REALTIME_TIMEOUT" - The client timed out while waiting for a room. 3604 // 3605 // - "REALTIME_CLIENT_DISCONNECTING" - The client disconnects without 3606 // first calling Leave. 3607 // - "REALTIME_SIGN_OUT" - The user signed out of G+ while in the room. 3608 // 3609 // - "REALTIME_GAME_CRASHED" - The game crashed. 3610 // - "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed. 3611 // - "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is 3612 // trying to enter a room. 3613 // - "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is trying 3614 // to enter a new room. 3615 Reason string `json:"reason,omitempty"` 3616 3617 // ForceSendFields is a list of field names (e.g. "Kind") to 3618 // unconditionally include in API requests. By default, fields with 3619 // empty values are omitted from API requests. However, any non-pointer, 3620 // non-interface field appearing in ForceSendFields will be sent to the 3621 // server regardless of whether the field is empty or not. This may be 3622 // used to include empty fields in Patch requests. 3623 ForceSendFields []string `json:"-"` 3624 3625 // NullFields is a list of field names (e.g. "Kind") to include in API 3626 // requests with the JSON null value. By default, fields with empty 3627 // values are omitted from API requests. However, any field with an 3628 // empty value appearing in NullFields will be sent to the server as 3629 // null. It is an error if a field in this list has a non-empty value. 3630 // This may be used to include null fields in Patch requests. 3631 NullFields []string `json:"-"` 3632} 3633 3634func (s *RoomLeaveRequest) MarshalJSON() ([]byte, error) { 3635 type NoMethod RoomLeaveRequest 3636 raw := NoMethod(*s) 3637 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3638} 3639 3640// RoomList: This is a JSON template for a list of rooms. 3641type RoomList struct { 3642 // Items: The rooms. 3643 Items []*Room `json:"items,omitempty"` 3644 3645 // Kind: Uniquely identifies the type of this resource. Value is always 3646 // the fixed string games#roomList. 3647 Kind string `json:"kind,omitempty"` 3648 3649 // NextPageToken: The pagination token for the next page of results. 3650 NextPageToken string `json:"nextPageToken,omitempty"` 3651 3652 // ServerResponse contains the HTTP response code and headers from the 3653 // server. 3654 googleapi.ServerResponse `json:"-"` 3655 3656 // ForceSendFields is a list of field names (e.g. "Items") to 3657 // unconditionally include in API requests. By default, fields with 3658 // empty values are omitted from API requests. However, any non-pointer, 3659 // non-interface field appearing in ForceSendFields will be sent to the 3660 // server regardless of whether the field is empty or not. This may be 3661 // used to include empty fields in Patch requests. 3662 ForceSendFields []string `json:"-"` 3663 3664 // NullFields is a list of field names (e.g. "Items") to include in API 3665 // requests with the JSON null value. By default, fields with empty 3666 // values are omitted from API requests. However, any field with an 3667 // empty value appearing in NullFields will be sent to the server as 3668 // null. It is an error if a field in this list has a non-empty value. 3669 // This may be used to include null fields in Patch requests. 3670 NullFields []string `json:"-"` 3671} 3672 3673func (s *RoomList) MarshalJSON() ([]byte, error) { 3674 type NoMethod RoomList 3675 raw := NoMethod(*s) 3676 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3677} 3678 3679// RoomModification: This is a JSON template for room modification 3680// metadata. 3681type RoomModification struct { 3682 // Kind: Uniquely identifies the type of this resource. Value is always 3683 // the fixed string games#roomModification. 3684 Kind string `json:"kind,omitempty"` 3685 3686 // ModifiedTimestampMillis: The timestamp at which they modified the 3687 // room, in milliseconds since the epoch in UTC. 3688 ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"` 3689 3690 // ParticipantId: The ID of the participant that modified the room. 3691 ParticipantId string `json:"participantId,omitempty"` 3692 3693 // ForceSendFields is a list of field names (e.g. "Kind") to 3694 // unconditionally include in API requests. By default, fields with 3695 // empty values are omitted from API requests. However, any non-pointer, 3696 // non-interface field appearing in ForceSendFields will be sent to the 3697 // server regardless of whether the field is empty or not. This may be 3698 // used to include empty fields in Patch requests. 3699 ForceSendFields []string `json:"-"` 3700 3701 // NullFields is a list of field names (e.g. "Kind") to include in API 3702 // requests with the JSON null value. By default, fields with empty 3703 // values are omitted from API requests. However, any field with an 3704 // empty value appearing in NullFields will be sent to the server as 3705 // null. It is an error if a field in this list has a non-empty value. 3706 // This may be used to include null fields in Patch requests. 3707 NullFields []string `json:"-"` 3708} 3709 3710func (s *RoomModification) MarshalJSON() ([]byte, error) { 3711 type NoMethod RoomModification 3712 raw := NoMethod(*s) 3713 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3714} 3715 3716// RoomP2PStatus: This is a JSON template for an update on the status of 3717// a peer in a room. 3718type RoomP2PStatus struct { 3719 // ConnectionSetupLatencyMillis: The amount of time in milliseconds it 3720 // took to establish connections with this peer. 3721 ConnectionSetupLatencyMillis int64 `json:"connectionSetupLatencyMillis,omitempty"` 3722 3723 // Error: The error code in event of a failure. 3724 // Possible values are: 3725 // - "P2P_FAILED" - The client failed to establish a P2P connection with 3726 // the peer. 3727 // - "PRESENCE_FAILED" - The client failed to register to receive P2P 3728 // connections. 3729 // - "RELAY_SERVER_FAILED" - The client received an error when trying to 3730 // use the relay server to establish a P2P connection with the peer. 3731 Error string `json:"error,omitempty"` 3732 3733 // ErrorReason: More detailed diagnostic message returned in event of a 3734 // failure. 3735 ErrorReason string `json:"error_reason,omitempty"` 3736 3737 // Kind: Uniquely identifies the type of this resource. Value is always 3738 // the fixed string games#roomP2PStatus. 3739 Kind string `json:"kind,omitempty"` 3740 3741 // ParticipantId: The ID of the participant. 3742 ParticipantId string `json:"participantId,omitempty"` 3743 3744 // Status: The status of the peer in the room. 3745 // Possible values are: 3746 // - "CONNECTION_ESTABLISHED" - The client established a P2P connection 3747 // with the peer. 3748 // - "CONNECTION_FAILED" - The client failed to establish directed 3749 // presence with the peer. 3750 Status string `json:"status,omitempty"` 3751 3752 // UnreliableRoundtripLatencyMillis: The amount of time in milliseconds 3753 // it took to send packets back and forth on the unreliable channel with 3754 // this peer. 3755 UnreliableRoundtripLatencyMillis int64 `json:"unreliableRoundtripLatencyMillis,omitempty"` 3756 3757 // ForceSendFields is a list of field names (e.g. 3758 // "ConnectionSetupLatencyMillis") to unconditionally include in API 3759 // requests. By default, fields with empty values are omitted from API 3760 // requests. However, any non-pointer, non-interface field appearing in 3761 // ForceSendFields will be sent to the server regardless of whether the 3762 // field is empty or not. This may be used to include empty fields in 3763 // Patch requests. 3764 ForceSendFields []string `json:"-"` 3765 3766 // NullFields is a list of field names (e.g. 3767 // "ConnectionSetupLatencyMillis") to include in API requests with the 3768 // JSON null value. By default, fields with empty values are omitted 3769 // from API requests. However, any field with an empty value appearing 3770 // in NullFields will be sent to the server as null. It is an error if a 3771 // field in this list has a non-empty value. This may be used to include 3772 // null fields in Patch requests. 3773 NullFields []string `json:"-"` 3774} 3775 3776func (s *RoomP2PStatus) MarshalJSON() ([]byte, error) { 3777 type NoMethod RoomP2PStatus 3778 raw := NoMethod(*s) 3779 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3780} 3781 3782// RoomP2PStatuses: This is a JSON template for an update on the status 3783// of peers in a room. 3784type RoomP2PStatuses struct { 3785 // Kind: Uniquely identifies the type of this resource. Value is always 3786 // the fixed string games#roomP2PStatuses. 3787 Kind string `json:"kind,omitempty"` 3788 3789 // Updates: The updates for the peers. 3790 Updates []*RoomP2PStatus `json:"updates,omitempty"` 3791 3792 // ForceSendFields is a list of field names (e.g. "Kind") to 3793 // unconditionally include in API requests. By default, fields with 3794 // empty values are omitted from API requests. However, any non-pointer, 3795 // non-interface field appearing in ForceSendFields will be sent to the 3796 // server regardless of whether the field is empty or not. This may be 3797 // used to include empty fields in Patch requests. 3798 ForceSendFields []string `json:"-"` 3799 3800 // NullFields is a list of field names (e.g. "Kind") to include in API 3801 // requests with the JSON null value. By default, fields with empty 3802 // values are omitted from API requests. However, any field with an 3803 // empty value appearing in NullFields will be sent to the server as 3804 // null. It is an error if a field in this list has a non-empty value. 3805 // This may be used to include null fields in Patch requests. 3806 NullFields []string `json:"-"` 3807} 3808 3809func (s *RoomP2PStatuses) MarshalJSON() ([]byte, error) { 3810 type NoMethod RoomP2PStatuses 3811 raw := NoMethod(*s) 3812 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3813} 3814 3815// RoomParticipant: This is a JSON template for a participant in a room. 3816type RoomParticipant struct { 3817 // AutoMatched: True if this participant was auto-matched with the 3818 // requesting player. 3819 AutoMatched bool `json:"autoMatched,omitempty"` 3820 3821 // AutoMatchedPlayer: Information about a player that has been 3822 // anonymously auto-matched against the requesting player. (Either 3823 // player or autoMatchedPlayer will be set.) 3824 AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"` 3825 3826 // Capabilities: The capabilities which can be used when communicating 3827 // with this participant. 3828 Capabilities []string `json:"capabilities,omitempty"` 3829 3830 // ClientAddress: Client address for the participant. 3831 ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"` 3832 3833 // Connected: True if this participant is in the fully connected set of 3834 // peers in the room. 3835 Connected bool `json:"connected,omitempty"` 3836 3837 // Id: An identifier for the participant in the scope of the room. 3838 // Cannot be used to identify a player across rooms or in other 3839 // contexts. 3840 Id string `json:"id,omitempty"` 3841 3842 // Kind: Uniquely identifies the type of this resource. Value is always 3843 // the fixed string games#roomParticipant. 3844 Kind string `json:"kind,omitempty"` 3845 3846 // LeaveReason: The reason the participant left the room; populated if 3847 // the participant status is PARTICIPANT_LEFT. 3848 // Possible values are: 3849 // - "PLAYER_LEFT" - The player explicitly chose to leave the room. 3850 // - "GAME_LEFT" - The game chose to remove the player from the room. 3851 // - "ABANDONED" - The player switched to another application and 3852 // abandoned the room. 3853 // - "PEER_CONNECTION_FAILURE" - The client was unable to establish or 3854 // maintain a connection to other peer(s) in the room. 3855 // - "SERVER_ERROR" - The client received an error response when it 3856 // tried to communicate with the server. 3857 // - "TIMEOUT" - The client timed out while waiting for players to join 3858 // and connect. 3859 // - "PRESENCE_FAILURE" - The client's XMPP connection ended abruptly. 3860 LeaveReason string `json:"leaveReason,omitempty"` 3861 3862 // Player: Information about the player. Not populated if this player 3863 // was anonymously auto-matched against the requesting player. (Either 3864 // player or autoMatchedPlayer will be set.) 3865 Player *Player `json:"player,omitempty"` 3866 3867 // Status: The status of the participant with respect to the 3868 // room. 3869 // Possible values are: 3870 // - "PARTICIPANT_INVITED" - The participant has been invited to join 3871 // the room, but has not yet responded. 3872 // - "PARTICIPANT_JOINED" - The participant has joined the room (either 3873 // after creating it or accepting an invitation.) 3874 // - "PARTICIPANT_DECLINED" - The participant declined an invitation to 3875 // join the room. 3876 // - "PARTICIPANT_LEFT" - The participant joined the room and then left 3877 // it. 3878 Status string `json:"status,omitempty"` 3879 3880 // ForceSendFields is a list of field names (e.g. "AutoMatched") to 3881 // unconditionally include in API requests. By default, fields with 3882 // empty values are omitted from API requests. However, any non-pointer, 3883 // non-interface field appearing in ForceSendFields will be sent to the 3884 // server regardless of whether the field is empty or not. This may be 3885 // used to include empty fields in Patch requests. 3886 ForceSendFields []string `json:"-"` 3887 3888 // NullFields is a list of field names (e.g. "AutoMatched") to include 3889 // in API requests with the JSON null value. By default, fields with 3890 // empty values are omitted from API requests. However, any field with 3891 // an empty value appearing in NullFields will be sent to the server as 3892 // null. It is an error if a field in this list has a non-empty value. 3893 // This may be used to include null fields in Patch requests. 3894 NullFields []string `json:"-"` 3895} 3896 3897func (s *RoomParticipant) MarshalJSON() ([]byte, error) { 3898 type NoMethod RoomParticipant 3899 raw := NoMethod(*s) 3900 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3901} 3902 3903// RoomStatus: This is a JSON template for the status of a room that the 3904// player has joined. 3905type RoomStatus struct { 3906 // AutoMatchingStatus: Auto-matching status for this room. Not set if 3907 // the room is not currently in the automatching queue. 3908 AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"` 3909 3910 // Kind: Uniquely identifies the type of this resource. Value is always 3911 // the fixed string games#roomStatus. 3912 Kind string `json:"kind,omitempty"` 3913 3914 // Participants: The participants involved in the room, along with their 3915 // statuses. Includes participants who have left or declined 3916 // invitations. 3917 Participants []*RoomParticipant `json:"participants,omitempty"` 3918 3919 // RoomId: Globally unique ID for a room. 3920 RoomId string `json:"roomId,omitempty"` 3921 3922 // Status: The status of the room. 3923 // Possible values are: 3924 // - "ROOM_INVITING" - One or more players have been invited and not 3925 // responded. 3926 // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by 3927 // auto-matching. 3928 // - "ROOM_CONNECTING" - Players have joined are connecting to each 3929 // other (either before or after auto-matching). 3930 // - "ROOM_ACTIVE" - All players have joined and connected to each 3931 // other. 3932 // - "ROOM_DELETED" - All joined players have left. 3933 Status string `json:"status,omitempty"` 3934 3935 // StatusVersion: The version of the status for the room: an increasing 3936 // counter, used by the client to ignore out-of-order updates to room 3937 // status. 3938 StatusVersion int64 `json:"statusVersion,omitempty"` 3939 3940 // ServerResponse contains the HTTP response code and headers from the 3941 // server. 3942 googleapi.ServerResponse `json:"-"` 3943 3944 // ForceSendFields is a list of field names (e.g. "AutoMatchingStatus") 3945 // to unconditionally include in API requests. By default, fields with 3946 // empty values are omitted from API requests. However, any non-pointer, 3947 // non-interface field appearing in ForceSendFields will be sent to the 3948 // server regardless of whether the field is empty or not. This may be 3949 // used to include empty fields in Patch requests. 3950 ForceSendFields []string `json:"-"` 3951 3952 // NullFields is a list of field names (e.g. "AutoMatchingStatus") to 3953 // include in API requests with the JSON null value. By default, fields 3954 // with empty values are omitted from API requests. However, any field 3955 // with an empty value appearing in NullFields will be sent to the 3956 // server as null. It is an error if a field in this list has a 3957 // non-empty value. This may be used to include null fields in Patch 3958 // requests. 3959 NullFields []string `json:"-"` 3960} 3961 3962func (s *RoomStatus) MarshalJSON() ([]byte, error) { 3963 type NoMethod RoomStatus 3964 raw := NoMethod(*s) 3965 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3966} 3967 3968// ScoreSubmission: This is a JSON template for a request to submit a 3969// score to leaderboards. 3970type ScoreSubmission struct { 3971 // Kind: Uniquely identifies the type of this resource. Value is always 3972 // the fixed string games#scoreSubmission. 3973 Kind string `json:"kind,omitempty"` 3974 3975 // LeaderboardId: The leaderboard this score is being submitted to. 3976 LeaderboardId string `json:"leaderboardId,omitempty"` 3977 3978 // Score: The new score being submitted. 3979 Score int64 `json:"score,omitempty,string"` 3980 3981 // ScoreTag: Additional information about this score. Values will 3982 // contain no more than 64 URI-safe characters as defined by section 2.3 3983 // of RFC 3986. 3984 ScoreTag string `json:"scoreTag,omitempty"` 3985 3986 // Signature: Signature Values will contain URI-safe characters as 3987 // defined by section 2.3 of RFC 3986. 3988 Signature string `json:"signature,omitempty"` 3989 3990 // ForceSendFields is a list of field names (e.g. "Kind") to 3991 // unconditionally include in API requests. By default, fields with 3992 // empty values are omitted from API requests. However, any non-pointer, 3993 // non-interface field appearing in ForceSendFields will be sent to the 3994 // server regardless of whether the field is empty or not. This may be 3995 // used to include empty fields in Patch requests. 3996 ForceSendFields []string `json:"-"` 3997 3998 // NullFields is a list of field names (e.g. "Kind") to include in API 3999 // requests with the JSON null value. By default, fields with empty 4000 // values are omitted from API requests. However, any field with an 4001 // empty value appearing in NullFields will be sent to the server as 4002 // null. It is an error if a field in this list has a non-empty value. 4003 // This may be used to include null fields in Patch requests. 4004 NullFields []string `json:"-"` 4005} 4006 4007func (s *ScoreSubmission) MarshalJSON() ([]byte, error) { 4008 type NoMethod ScoreSubmission 4009 raw := NoMethod(*s) 4010 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4011} 4012 4013// Snapshot: This is a JSON template for an snapshot object. 4014type Snapshot struct { 4015 // CoverImage: The cover image of this snapshot. May be absent if there 4016 // is no image. 4017 CoverImage *SnapshotImage `json:"coverImage,omitempty"` 4018 4019 // Description: The description of this snapshot. 4020 Description string `json:"description,omitempty"` 4021 4022 // DriveId: The ID of the file underlying this snapshot in the Drive 4023 // API. Only present if the snapshot is a view on a Drive file and the 4024 // file is owned by the caller. 4025 DriveId string `json:"driveId,omitempty"` 4026 4027 // DurationMillis: The duration associated with this snapshot, in 4028 // millis. 4029 DurationMillis int64 `json:"durationMillis,omitempty,string"` 4030 4031 // Id: The ID of the snapshot. 4032 Id string `json:"id,omitempty"` 4033 4034 // Kind: Uniquely identifies the type of this resource. Value is always 4035 // the fixed string games#snapshot. 4036 Kind string `json:"kind,omitempty"` 4037 4038 // LastModifiedMillis: The timestamp (in millis since Unix epoch) of the 4039 // last modification to this snapshot. 4040 LastModifiedMillis int64 `json:"lastModifiedMillis,omitempty,string"` 4041 4042 // ProgressValue: The progress value (64-bit integer set by developer) 4043 // associated with this snapshot. 4044 ProgressValue int64 `json:"progressValue,omitempty,string"` 4045 4046 // Title: The title of this snapshot. 4047 Title string `json:"title,omitempty"` 4048 4049 // Type: The type of this snapshot. 4050 // Possible values are: 4051 // - "SAVE_GAME" - A snapshot representing a save game. 4052 Type string `json:"type,omitempty"` 4053 4054 // UniqueName: The unique name provided when the snapshot was created. 4055 UniqueName string `json:"uniqueName,omitempty"` 4056 4057 // ServerResponse contains the HTTP response code and headers from the 4058 // server. 4059 googleapi.ServerResponse `json:"-"` 4060 4061 // ForceSendFields is a list of field names (e.g. "CoverImage") to 4062 // unconditionally include in API requests. By default, fields with 4063 // empty values are omitted from API requests. However, any non-pointer, 4064 // non-interface field appearing in ForceSendFields will be sent to the 4065 // server regardless of whether the field is empty or not. This may be 4066 // used to include empty fields in Patch requests. 4067 ForceSendFields []string `json:"-"` 4068 4069 // NullFields is a list of field names (e.g. "CoverImage") to include in 4070 // API requests with the JSON null value. By default, fields with empty 4071 // values are omitted from API requests. However, any field with an 4072 // empty value appearing in NullFields will be sent to the server as 4073 // null. It is an error if a field in this list has a non-empty value. 4074 // This may be used to include null fields in Patch requests. 4075 NullFields []string `json:"-"` 4076} 4077 4078func (s *Snapshot) MarshalJSON() ([]byte, error) { 4079 type NoMethod Snapshot 4080 raw := NoMethod(*s) 4081 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4082} 4083 4084// SnapshotImage: This is a JSON template for an image of a snapshot. 4085type SnapshotImage struct { 4086 // Height: The height of the image. 4087 Height int64 `json:"height,omitempty"` 4088 4089 // Kind: Uniquely identifies the type of this resource. Value is always 4090 // the fixed string games#snapshotImage. 4091 Kind string `json:"kind,omitempty"` 4092 4093 // MimeType: The MIME type of the image. 4094 MimeType string `json:"mime_type,omitempty"` 4095 4096 // Url: The URL of the image. This URL may be invalidated at any time 4097 // and should not be cached. 4098 Url string `json:"url,omitempty"` 4099 4100 // Width: The width of the image. 4101 Width int64 `json:"width,omitempty"` 4102 4103 // ForceSendFields is a list of field names (e.g. "Height") 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. "Height") 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 *SnapshotImage) MarshalJSON() ([]byte, error) { 4121 type NoMethod SnapshotImage 4122 raw := NoMethod(*s) 4123 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4124} 4125 4126// SnapshotListResponse: This is a JSON template for a list of snapshot 4127// objects. 4128type SnapshotListResponse struct { 4129 // Items: The snapshots. 4130 Items []*Snapshot `json:"items,omitempty"` 4131 4132 // Kind: Uniquely identifies the type of this resource. Value is always 4133 // the fixed string games#snapshotListResponse. 4134 Kind string `json:"kind,omitempty"` 4135 4136 // NextPageToken: Token corresponding to the next page of results. If 4137 // there are no more results, the token is omitted. 4138 NextPageToken string `json:"nextPageToken,omitempty"` 4139 4140 // ServerResponse contains the HTTP response code and headers from the 4141 // server. 4142 googleapi.ServerResponse `json:"-"` 4143 4144 // ForceSendFields is a list of field names (e.g. "Items") to 4145 // unconditionally include in API requests. By default, fields with 4146 // empty values are omitted from API requests. However, any non-pointer, 4147 // non-interface field appearing in ForceSendFields will be sent to the 4148 // server regardless of whether the field is empty or not. This may be 4149 // used to include empty fields in Patch requests. 4150 ForceSendFields []string `json:"-"` 4151 4152 // NullFields is a list of field names (e.g. "Items") to include in API 4153 // requests with the JSON null value. By default, fields with empty 4154 // values are omitted from API requests. However, any field with an 4155 // empty value appearing in NullFields will be sent to the server as 4156 // null. It is an error if a field in this list has a non-empty value. 4157 // This may be used to include null fields in Patch requests. 4158 NullFields []string `json:"-"` 4159} 4160 4161func (s *SnapshotListResponse) MarshalJSON() ([]byte, error) { 4162 type NoMethod SnapshotListResponse 4163 raw := NoMethod(*s) 4164 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4165} 4166 4167// TurnBasedAutoMatchingCriteria: This is a JSON template for an 4168// turn-based auto-match criteria object. 4169type TurnBasedAutoMatchingCriteria struct { 4170 // ExclusiveBitmask: A bitmask indicating when auto-matches are valid. 4171 // When ANDed with other exclusive bitmasks, the result must be zero. 4172 // Can be used to support exclusive roles within a game. 4173 ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"` 4174 4175 // Kind: Uniquely identifies the type of this resource. Value is always 4176 // the fixed string games#turnBasedAutoMatchingCriteria. 4177 Kind string `json:"kind,omitempty"` 4178 4179 // MaxAutoMatchingPlayers: The maximum number of players that should be 4180 // added to the match by auto-matching. 4181 MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"` 4182 4183 // MinAutoMatchingPlayers: The minimum number of players that should be 4184 // added to the match by auto-matching. 4185 MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"` 4186 4187 // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to 4188 // unconditionally include in API requests. By default, fields with 4189 // empty values are omitted from API requests. However, any non-pointer, 4190 // non-interface field appearing in ForceSendFields will be sent to the 4191 // server regardless of whether the field is empty or not. This may be 4192 // used to include empty fields in Patch requests. 4193 ForceSendFields []string `json:"-"` 4194 4195 // NullFields is a list of field names (e.g. "ExclusiveBitmask") to 4196 // include in API requests with the JSON null value. By default, fields 4197 // with empty values are omitted from API requests. However, any field 4198 // with an empty value appearing in NullFields will be sent to the 4199 // server as null. It is an error if a field in this list has a 4200 // non-empty value. This may be used to include null fields in Patch 4201 // requests. 4202 NullFields []string `json:"-"` 4203} 4204 4205func (s *TurnBasedAutoMatchingCriteria) MarshalJSON() ([]byte, error) { 4206 type NoMethod TurnBasedAutoMatchingCriteria 4207 raw := NoMethod(*s) 4208 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4209} 4210 4211// TurnBasedMatch: This is a JSON template for a turn-based match 4212// resource object. 4213type TurnBasedMatch struct { 4214 // ApplicationId: The ID of the application being played. 4215 ApplicationId string `json:"applicationId,omitempty"` 4216 4217 // AutoMatchingCriteria: Criteria for auto-matching players into this 4218 // match. 4219 AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` 4220 4221 // CreationDetails: Details about the match creation. 4222 CreationDetails *TurnBasedMatchModification `json:"creationDetails,omitempty"` 4223 4224 // Data: The data / game state for this match. 4225 Data *TurnBasedMatchData `json:"data,omitempty"` 4226 4227 // Description: This short description is generated by our servers based 4228 // on turn state and is localized and worded relative to the player 4229 // requesting the match. It is intended to be displayed when the match 4230 // is shown in a list. 4231 Description string `json:"description,omitempty"` 4232 4233 // InviterId: The ID of the participant that invited the user to the 4234 // match. Not set if the user was not invited to the match. 4235 InviterId string `json:"inviterId,omitempty"` 4236 4237 // Kind: Uniquely identifies the type of this resource. Value is always 4238 // the fixed string games#turnBasedMatch. 4239 Kind string `json:"kind,omitempty"` 4240 4241 // LastUpdateDetails: Details about the last update to the match. 4242 LastUpdateDetails *TurnBasedMatchModification `json:"lastUpdateDetails,omitempty"` 4243 4244 // MatchId: Globally unique ID for a turn-based match. 4245 MatchId string `json:"matchId,omitempty"` 4246 4247 // MatchNumber: The number of the match in a chain of rematches. Will be 4248 // set to 1 for the first match and incremented by 1 for each rematch. 4249 MatchNumber int64 `json:"matchNumber,omitempty"` 4250 4251 // MatchVersion: The version of this match: an increasing counter, used 4252 // to avoid out-of-date updates to the match. 4253 MatchVersion int64 `json:"matchVersion,omitempty"` 4254 4255 // Participants: The participants involved in the match, along with 4256 // their statuses. Includes participants who have left or declined 4257 // invitations. 4258 Participants []*TurnBasedMatchParticipant `json:"participants,omitempty"` 4259 4260 // PendingParticipantId: The ID of the participant that is taking a 4261 // turn. 4262 PendingParticipantId string `json:"pendingParticipantId,omitempty"` 4263 4264 // PreviousMatchData: The data / game state for the previous match; set 4265 // for the first turn of rematches only. 4266 PreviousMatchData *TurnBasedMatchData `json:"previousMatchData,omitempty"` 4267 4268 // RematchId: The ID of a rematch of this match. Only set for completed 4269 // matches that have been rematched. 4270 RematchId string `json:"rematchId,omitempty"` 4271 4272 // Results: The results reported for this match. 4273 Results []*ParticipantResult `json:"results,omitempty"` 4274 4275 // Status: The status of the match. 4276 // Possible values are: 4277 // - "MATCH_AUTO_MATCHING" - One or more slots need to be filled by 4278 // auto-matching; the match cannot be established until they are filled. 4279 // 4280 // - "MATCH_ACTIVE" - The match has started. 4281 // - "MATCH_COMPLETE" - The match has finished. 4282 // - "MATCH_CANCELED" - The match was canceled. 4283 // - "MATCH_EXPIRED" - The match expired due to inactivity. 4284 // - "MATCH_DELETED" - The match should no longer be shown on the 4285 // client. Returned only for tombstones for matches when sync is called. 4286 Status string `json:"status,omitempty"` 4287 4288 // UserMatchStatus: The status of the current user in the match. Derived 4289 // from the match type, match status, the user's participant status, and 4290 // the pending participant for the match. 4291 // Possible values are: 4292 // - "USER_INVITED" - The user has been invited to join the match and 4293 // has not responded yet. 4294 // - "USER_AWAITING_TURN" - The user is waiting for their turn. 4295 // - "USER_TURN" - The user has an action to take in the match. 4296 // - "USER_MATCH_COMPLETED" - The match has ended (it is completed, 4297 // canceled, or expired.) 4298 UserMatchStatus string `json:"userMatchStatus,omitempty"` 4299 4300 // Variant: The variant / mode of the application being played; can be 4301 // any integer value, or left blank. 4302 Variant int64 `json:"variant,omitempty"` 4303 4304 // WithParticipantId: The ID of another participant in the match that 4305 // can be used when describing the participants the user is playing 4306 // with. 4307 WithParticipantId string `json:"withParticipantId,omitempty"` 4308 4309 // ServerResponse contains the HTTP response code and headers from the 4310 // server. 4311 googleapi.ServerResponse `json:"-"` 4312 4313 // ForceSendFields is a list of field names (e.g. "ApplicationId") to 4314 // unconditionally include in API requests. By default, fields with 4315 // empty values are omitted from API requests. However, any non-pointer, 4316 // non-interface field appearing in ForceSendFields will be sent to the 4317 // server regardless of whether the field is empty or not. This may be 4318 // used to include empty fields in Patch requests. 4319 ForceSendFields []string `json:"-"` 4320 4321 // NullFields is a list of field names (e.g. "ApplicationId") to include 4322 // in API requests with the JSON null value. By default, fields with 4323 // empty values are omitted from API requests. However, any field with 4324 // an empty value appearing in NullFields will be sent to the server as 4325 // null. It is an error if a field in this list has a non-empty value. 4326 // This may be used to include null fields in Patch requests. 4327 NullFields []string `json:"-"` 4328} 4329 4330func (s *TurnBasedMatch) MarshalJSON() ([]byte, error) { 4331 type NoMethod TurnBasedMatch 4332 raw := NoMethod(*s) 4333 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4334} 4335 4336// TurnBasedMatchCreateRequest: This is a JSON template for a turn-based 4337// match creation request. 4338type TurnBasedMatchCreateRequest struct { 4339 // AutoMatchingCriteria: Criteria for auto-matching players into this 4340 // match. 4341 AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"` 4342 4343 // InvitedPlayerIds: The player ids to invite to the match. 4344 InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"` 4345 4346 // Kind: Uniquely identifies the type of this resource. Value is always 4347 // the fixed string games#turnBasedMatchCreateRequest. 4348 Kind string `json:"kind,omitempty"` 4349 4350 // RequestId: A randomly generated numeric ID. This number is used at 4351 // the server to ensure that the request is handled correctly across 4352 // retries. 4353 RequestId int64 `json:"requestId,omitempty,string"` 4354 4355 // Variant: The variant / mode of the application to be played. This can 4356 // be any integer value, or left blank. You should use a small number of 4357 // variants to keep the auto-matching pool as large as possible. 4358 Variant int64 `json:"variant,omitempty"` 4359 4360 // ForceSendFields is a list of field names (e.g. 4361 // "AutoMatchingCriteria") to unconditionally include in API requests. 4362 // By default, fields with empty values are omitted from API requests. 4363 // However, any non-pointer, non-interface field appearing in 4364 // ForceSendFields will be sent to the server regardless of whether the 4365 // field is empty or not. This may be used to include empty fields in 4366 // Patch requests. 4367 ForceSendFields []string `json:"-"` 4368 4369 // NullFields is a list of field names (e.g. "AutoMatchingCriteria") to 4370 // include in API requests with the JSON null value. By default, fields 4371 // with empty values are omitted from API requests. However, any field 4372 // with an empty value appearing in NullFields will be sent to the 4373 // server as null. It is an error if a field in this list has a 4374 // non-empty value. This may be used to include null fields in Patch 4375 // requests. 4376 NullFields []string `json:"-"` 4377} 4378 4379func (s *TurnBasedMatchCreateRequest) MarshalJSON() ([]byte, error) { 4380 type NoMethod TurnBasedMatchCreateRequest 4381 raw := NoMethod(*s) 4382 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4383} 4384 4385// TurnBasedMatchData: This is a JSON template for a turn-based match 4386// data object. 4387type TurnBasedMatchData struct { 4388 // Data: The byte representation of the data (limited to 128 kB), as a 4389 // Base64-encoded string with the URL_SAFE encoding option. 4390 Data string `json:"data,omitempty"` 4391 4392 // DataAvailable: True if this match has data available but it wasn't 4393 // returned in a list response; fetching the match individually will 4394 // retrieve this data. 4395 DataAvailable bool `json:"dataAvailable,omitempty"` 4396 4397 // Kind: Uniquely identifies the type of this resource. Value is always 4398 // the fixed string games#turnBasedMatchData. 4399 Kind string `json:"kind,omitempty"` 4400 4401 // ForceSendFields is a list of field names (e.g. "Data") to 4402 // unconditionally include in API requests. By default, fields with 4403 // empty values are omitted from API requests. However, any non-pointer, 4404 // non-interface field appearing in ForceSendFields will be sent to the 4405 // server regardless of whether the field is empty or not. This may be 4406 // used to include empty fields in Patch requests. 4407 ForceSendFields []string `json:"-"` 4408 4409 // NullFields is a list of field names (e.g. "Data") to include in API 4410 // requests with the JSON null value. By default, fields with empty 4411 // values are omitted from API requests. However, any field with an 4412 // empty value appearing in NullFields will be sent to the server as 4413 // null. It is an error if a field in this list has a non-empty value. 4414 // This may be used to include null fields in Patch requests. 4415 NullFields []string `json:"-"` 4416} 4417 4418func (s *TurnBasedMatchData) MarshalJSON() ([]byte, error) { 4419 type NoMethod TurnBasedMatchData 4420 raw := NoMethod(*s) 4421 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4422} 4423 4424// TurnBasedMatchDataRequest: This is a JSON template for sending a 4425// turn-based match data object. 4426type TurnBasedMatchDataRequest struct { 4427 // Data: The byte representation of the data (limited to 128 kB), as a 4428 // Base64-encoded string with the URL_SAFE encoding option. 4429 Data string `json:"data,omitempty"` 4430 4431 // Kind: Uniquely identifies the type of this resource. Value is always 4432 // the fixed string games#turnBasedMatchDataRequest. 4433 Kind string `json:"kind,omitempty"` 4434 4435 // ForceSendFields is a list of field names (e.g. "Data") to 4436 // unconditionally include in API requests. By default, fields with 4437 // empty values are omitted from API requests. However, any non-pointer, 4438 // non-interface field appearing in ForceSendFields will be sent to the 4439 // server regardless of whether the field is empty or not. This may be 4440 // used to include empty fields in Patch requests. 4441 ForceSendFields []string `json:"-"` 4442 4443 // NullFields is a list of field names (e.g. "Data") to include in API 4444 // requests with the JSON null value. By default, fields with empty 4445 // values are omitted from API requests. However, any field with an 4446 // empty value appearing in NullFields will be sent to the server as 4447 // null. It is an error if a field in this list has a non-empty value. 4448 // This may be used to include null fields in Patch requests. 4449 NullFields []string `json:"-"` 4450} 4451 4452func (s *TurnBasedMatchDataRequest) MarshalJSON() ([]byte, error) { 4453 type NoMethod TurnBasedMatchDataRequest 4454 raw := NoMethod(*s) 4455 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4456} 4457 4458// TurnBasedMatchList: This is a JSON template for a list of turn-based 4459// matches. 4460type TurnBasedMatchList struct { 4461 // Items: The matches. 4462 Items []*TurnBasedMatch `json:"items,omitempty"` 4463 4464 // Kind: Uniquely identifies the type of this resource. Value is always 4465 // the fixed string games#turnBasedMatchList. 4466 Kind string `json:"kind,omitempty"` 4467 4468 // NextPageToken: The pagination token for the next page of results. 4469 NextPageToken string `json:"nextPageToken,omitempty"` 4470 4471 // ServerResponse contains the HTTP response code and headers from the 4472 // server. 4473 googleapi.ServerResponse `json:"-"` 4474 4475 // ForceSendFields is a list of field names (e.g. "Items") to 4476 // unconditionally include in API requests. By default, fields with 4477 // empty values are omitted from API requests. However, any non-pointer, 4478 // non-interface field appearing in ForceSendFields will be sent to the 4479 // server regardless of whether the field is empty or not. This may be 4480 // used to include empty fields in Patch requests. 4481 ForceSendFields []string `json:"-"` 4482 4483 // NullFields is a list of field names (e.g. "Items") to include in API 4484 // requests with the JSON null value. By default, fields with empty 4485 // values are omitted from API requests. However, any field with an 4486 // empty value appearing in NullFields will be sent to the server as 4487 // null. It is an error if a field in this list has a non-empty value. 4488 // This may be used to include null fields in Patch requests. 4489 NullFields []string `json:"-"` 4490} 4491 4492func (s *TurnBasedMatchList) MarshalJSON() ([]byte, error) { 4493 type NoMethod TurnBasedMatchList 4494 raw := NoMethod(*s) 4495 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4496} 4497 4498// TurnBasedMatchModification: This is a JSON template for turn-based 4499// match modification metadata. 4500type TurnBasedMatchModification struct { 4501 // Kind: Uniquely identifies the type of this resource. Value is always 4502 // the fixed string games#turnBasedMatchModification. 4503 Kind string `json:"kind,omitempty"` 4504 4505 // ModifiedTimestampMillis: The timestamp at which they modified the 4506 // match, in milliseconds since the epoch in UTC. 4507 ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"` 4508 4509 // ParticipantId: The ID of the participant that modified the match. 4510 ParticipantId string `json:"participantId,omitempty"` 4511 4512 // ForceSendFields is a list of field names (e.g. "Kind") to 4513 // unconditionally include in API requests. By default, fields with 4514 // empty values are omitted from API requests. However, any non-pointer, 4515 // non-interface field appearing in ForceSendFields will be sent to the 4516 // server regardless of whether the field is empty or not. This may be 4517 // used to include empty fields in Patch requests. 4518 ForceSendFields []string `json:"-"` 4519 4520 // NullFields is a list of field names (e.g. "Kind") to include in API 4521 // requests with the JSON null value. By default, fields with empty 4522 // values are omitted from API requests. However, any field with an 4523 // empty value appearing in NullFields will be sent to the server as 4524 // null. It is an error if a field in this list has a non-empty value. 4525 // This may be used to include null fields in Patch requests. 4526 NullFields []string `json:"-"` 4527} 4528 4529func (s *TurnBasedMatchModification) MarshalJSON() ([]byte, error) { 4530 type NoMethod TurnBasedMatchModification 4531 raw := NoMethod(*s) 4532 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4533} 4534 4535// TurnBasedMatchParticipant: This is a JSON template for a participant 4536// in a turn-based match. 4537type TurnBasedMatchParticipant struct { 4538 // AutoMatched: True if this participant was auto-matched with the 4539 // requesting player. 4540 AutoMatched bool `json:"autoMatched,omitempty"` 4541 4542 // AutoMatchedPlayer: Information about a player that has been 4543 // anonymously auto-matched against the requesting player. (Either 4544 // player or autoMatchedPlayer will be set.) 4545 AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"` 4546 4547 // Id: An identifier for the participant in the scope of the match. 4548 // Cannot be used to identify a player across matches or in other 4549 // contexts. 4550 Id string `json:"id,omitempty"` 4551 4552 // Kind: Uniquely identifies the type of this resource. Value is always 4553 // the fixed string games#turnBasedMatchParticipant. 4554 Kind string `json:"kind,omitempty"` 4555 4556 // Player: Information about the player. Not populated if this player 4557 // was anonymously auto-matched against the requesting player. (Either 4558 // player or autoMatchedPlayer will be set.) 4559 Player *Player `json:"player,omitempty"` 4560 4561 // Status: The status of the participant with respect to the 4562 // match. 4563 // Possible values are: 4564 // - "PARTICIPANT_NOT_INVITED_YET" - The participant is slated to be 4565 // invited to the match, but the invitation has not been sent; the 4566 // invite will be sent when it becomes their turn. 4567 // - "PARTICIPANT_INVITED" - The participant has been invited to join 4568 // the match, but has not yet responded. 4569 // - "PARTICIPANT_JOINED" - The participant has joined the match (either 4570 // after creating it or accepting an invitation.) 4571 // - "PARTICIPANT_DECLINED" - The participant declined an invitation to 4572 // join the match. 4573 // - "PARTICIPANT_LEFT" - The participant joined the match and then left 4574 // it. 4575 // - "PARTICIPANT_FINISHED" - The participant finished playing in the 4576 // match. 4577 // - "PARTICIPANT_UNRESPONSIVE" - The participant did not take their 4578 // turn in the allotted time. 4579 Status string `json:"status,omitempty"` 4580 4581 // ForceSendFields is a list of field names (e.g. "AutoMatched") to 4582 // unconditionally include in API requests. By default, fields with 4583 // empty values are omitted from API requests. However, any non-pointer, 4584 // non-interface field appearing in ForceSendFields will be sent to the 4585 // server regardless of whether the field is empty or not. This may be 4586 // used to include empty fields in Patch requests. 4587 ForceSendFields []string `json:"-"` 4588 4589 // NullFields is a list of field names (e.g. "AutoMatched") to include 4590 // in API requests with the JSON null value. By default, fields with 4591 // empty values are omitted from API requests. However, any field with 4592 // an empty value appearing in NullFields will be sent to the server as 4593 // null. It is an error if a field in this list has a non-empty value. 4594 // This may be used to include null fields in Patch requests. 4595 NullFields []string `json:"-"` 4596} 4597 4598func (s *TurnBasedMatchParticipant) MarshalJSON() ([]byte, error) { 4599 type NoMethod TurnBasedMatchParticipant 4600 raw := NoMethod(*s) 4601 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4602} 4603 4604// TurnBasedMatchRematch: This is a JSON template for a rematch 4605// response. 4606type TurnBasedMatchRematch struct { 4607 // Kind: Uniquely identifies the type of this resource. Value is always 4608 // the fixed string games#turnBasedMatchRematch. 4609 Kind string `json:"kind,omitempty"` 4610 4611 // PreviousMatch: The old match that the rematch was created from; will 4612 // be updated such that the rematchId field will point at the new match. 4613 PreviousMatch *TurnBasedMatch `json:"previousMatch,omitempty"` 4614 4615 // Rematch: The newly created match; a rematch of the old match with the 4616 // same participants. 4617 Rematch *TurnBasedMatch `json:"rematch,omitempty"` 4618 4619 // ServerResponse contains the HTTP response code and headers from the 4620 // server. 4621 googleapi.ServerResponse `json:"-"` 4622 4623 // ForceSendFields is a list of field names (e.g. "Kind") to 4624 // unconditionally include in API requests. By default, fields with 4625 // empty values are omitted from API requests. However, any non-pointer, 4626 // non-interface field appearing in ForceSendFields will be sent to the 4627 // server regardless of whether the field is empty or not. This may be 4628 // used to include empty fields in Patch requests. 4629 ForceSendFields []string `json:"-"` 4630 4631 // NullFields is a list of field names (e.g. "Kind") to include in API 4632 // requests with the JSON null value. By default, fields with empty 4633 // values are omitted from API requests. However, any field with an 4634 // empty value appearing in NullFields will be sent to the server as 4635 // null. It is an error if a field in this list has a non-empty value. 4636 // This may be used to include null fields in Patch requests. 4637 NullFields []string `json:"-"` 4638} 4639 4640func (s *TurnBasedMatchRematch) MarshalJSON() ([]byte, error) { 4641 type NoMethod TurnBasedMatchRematch 4642 raw := NoMethod(*s) 4643 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4644} 4645 4646// TurnBasedMatchResults: This is a JSON template for a turn-based match 4647// results object. 4648type TurnBasedMatchResults struct { 4649 // Data: The final match data. 4650 Data *TurnBasedMatchDataRequest `json:"data,omitempty"` 4651 4652 // Kind: Uniquely identifies the type of this resource. Value is always 4653 // the fixed string games#turnBasedMatchResults. 4654 Kind string `json:"kind,omitempty"` 4655 4656 // MatchVersion: The version of the match being updated. 4657 MatchVersion int64 `json:"matchVersion,omitempty"` 4658 4659 // Results: The match results for the participants in the match. 4660 Results []*ParticipantResult `json:"results,omitempty"` 4661 4662 // ForceSendFields is a list of field names (e.g. "Data") to 4663 // unconditionally include in API requests. By default, fields with 4664 // empty values are omitted from API requests. However, any non-pointer, 4665 // non-interface field appearing in ForceSendFields will be sent to the 4666 // server regardless of whether the field is empty or not. This may be 4667 // used to include empty fields in Patch requests. 4668 ForceSendFields []string `json:"-"` 4669 4670 // NullFields is a list of field names (e.g. "Data") to include in API 4671 // requests with the JSON null value. By default, fields with empty 4672 // values are omitted from API requests. However, any field with an 4673 // empty value appearing in NullFields will be sent to the server as 4674 // null. It is an error if a field in this list has a non-empty value. 4675 // This may be used to include null fields in Patch requests. 4676 NullFields []string `json:"-"` 4677} 4678 4679func (s *TurnBasedMatchResults) MarshalJSON() ([]byte, error) { 4680 type NoMethod TurnBasedMatchResults 4681 raw := NoMethod(*s) 4682 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4683} 4684 4685// TurnBasedMatchSync: This is a JSON template for a list of turn-based 4686// matches returned from a sync. 4687type TurnBasedMatchSync struct { 4688 // Items: The matches. 4689 Items []*TurnBasedMatch `json:"items,omitempty"` 4690 4691 // Kind: Uniquely identifies the type of this resource. Value is always 4692 // the fixed string games#turnBasedMatchSync. 4693 Kind string `json:"kind,omitempty"` 4694 4695 // MoreAvailable: True if there were more matches available to fetch at 4696 // the time the response was generated (which were not returned due to 4697 // page size limits.) 4698 MoreAvailable bool `json:"moreAvailable,omitempty"` 4699 4700 // NextPageToken: The pagination token for the next page of results. 4701 NextPageToken string `json:"nextPageToken,omitempty"` 4702 4703 // ServerResponse contains the HTTP response code and headers from the 4704 // server. 4705 googleapi.ServerResponse `json:"-"` 4706 4707 // ForceSendFields is a list of field names (e.g. "Items") to 4708 // unconditionally include in API requests. By default, fields with 4709 // empty values are omitted from API requests. However, any non-pointer, 4710 // non-interface field appearing in ForceSendFields will be sent to the 4711 // server regardless of whether the field is empty or not. This may be 4712 // used to include empty fields in Patch requests. 4713 ForceSendFields []string `json:"-"` 4714 4715 // NullFields is a list of field names (e.g. "Items") to include in API 4716 // requests with the JSON null value. By default, fields with empty 4717 // values are omitted from API requests. However, any field with an 4718 // empty value appearing in NullFields will be sent to the server as 4719 // null. It is an error if a field in this list has a non-empty value. 4720 // This may be used to include null fields in Patch requests. 4721 NullFields []string `json:"-"` 4722} 4723 4724func (s *TurnBasedMatchSync) MarshalJSON() ([]byte, error) { 4725 type NoMethod TurnBasedMatchSync 4726 raw := NoMethod(*s) 4727 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4728} 4729 4730// TurnBasedMatchTurn: This is a JSON template for the object 4731// representing a turn. 4732type TurnBasedMatchTurn struct { 4733 // Data: The shared game state data after the turn is over. 4734 Data *TurnBasedMatchDataRequest `json:"data,omitempty"` 4735 4736 // Kind: Uniquely identifies the type of this resource. Value is always 4737 // the fixed string games#turnBasedMatchTurn. 4738 Kind string `json:"kind,omitempty"` 4739 4740 // MatchVersion: The version of this match: an increasing counter, used 4741 // to avoid out-of-date updates to the match. 4742 MatchVersion int64 `json:"matchVersion,omitempty"` 4743 4744 // PendingParticipantId: The ID of the participant who should take their 4745 // turn next. May be set to the current player's participant ID to 4746 // update match state without changing the turn. If not set, the match 4747 // will wait for other player(s) to join via automatching; this is only 4748 // valid if automatch criteria is set on the match with remaining slots 4749 // for automatched players. 4750 PendingParticipantId string `json:"pendingParticipantId,omitempty"` 4751 4752 // Results: The match results for the participants in the match. 4753 Results []*ParticipantResult `json:"results,omitempty"` 4754 4755 // ForceSendFields is a list of field names (e.g. "Data") to 4756 // unconditionally include in API requests. By default, fields with 4757 // empty values are omitted from API requests. However, any non-pointer, 4758 // non-interface field appearing in ForceSendFields will be sent to the 4759 // server regardless of whether the field is empty or not. This may be 4760 // used to include empty fields in Patch requests. 4761 ForceSendFields []string `json:"-"` 4762 4763 // NullFields is a list of field names (e.g. "Data") to include in API 4764 // requests with the JSON null value. By default, fields with empty 4765 // values are omitted from API requests. However, any field with an 4766 // empty value appearing in NullFields will be sent to the server as 4767 // null. It is an error if a field in this list has a non-empty value. 4768 // This may be used to include null fields in Patch requests. 4769 NullFields []string `json:"-"` 4770} 4771 4772func (s *TurnBasedMatchTurn) MarshalJSON() ([]byte, error) { 4773 type NoMethod TurnBasedMatchTurn 4774 raw := NoMethod(*s) 4775 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4776} 4777 4778// method id "games.achievementDefinitions.list": 4779 4780type AchievementDefinitionsListCall struct { 4781 s *Service 4782 urlParams_ gensupport.URLParams 4783 ifNoneMatch_ string 4784 ctx_ context.Context 4785 header_ http.Header 4786} 4787 4788// List: Lists all the achievement definitions for your application. 4789func (r *AchievementDefinitionsService) List() *AchievementDefinitionsListCall { 4790 c := &AchievementDefinitionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4791 return c 4792} 4793 4794// Language sets the optional parameter "language": The preferred 4795// language to use for strings returned by this method. 4796func (c *AchievementDefinitionsListCall) Language(language string) *AchievementDefinitionsListCall { 4797 c.urlParams_.Set("language", language) 4798 return c 4799} 4800 4801// MaxResults sets the optional parameter "maxResults": The maximum 4802// number of achievement resources to return in the response, used for 4803// paging. For any response, the actual number of achievement resources 4804// returned may be less than the specified maxResults. 4805func (c *AchievementDefinitionsListCall) MaxResults(maxResults int64) *AchievementDefinitionsListCall { 4806 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4807 return c 4808} 4809 4810// PageToken sets the optional parameter "pageToken": The token returned 4811// by the previous request. 4812func (c *AchievementDefinitionsListCall) PageToken(pageToken string) *AchievementDefinitionsListCall { 4813 c.urlParams_.Set("pageToken", pageToken) 4814 return c 4815} 4816 4817// Fields allows partial responses to be retrieved. See 4818// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4819// for more information. 4820func (c *AchievementDefinitionsListCall) Fields(s ...googleapi.Field) *AchievementDefinitionsListCall { 4821 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4822 return c 4823} 4824 4825// IfNoneMatch sets the optional parameter which makes the operation 4826// fail if the object's ETag matches the given value. This is useful for 4827// getting updates only after the object has changed since the last 4828// request. Use googleapi.IsNotModified to check whether the response 4829// error from Do is the result of In-None-Match. 4830func (c *AchievementDefinitionsListCall) IfNoneMatch(entityTag string) *AchievementDefinitionsListCall { 4831 c.ifNoneMatch_ = entityTag 4832 return c 4833} 4834 4835// Context sets the context to be used in this call's Do method. Any 4836// pending HTTP request will be aborted if the provided context is 4837// canceled. 4838func (c *AchievementDefinitionsListCall) Context(ctx context.Context) *AchievementDefinitionsListCall { 4839 c.ctx_ = ctx 4840 return c 4841} 4842 4843// Header returns an http.Header that can be modified by the caller to 4844// add HTTP headers to the request. 4845func (c *AchievementDefinitionsListCall) Header() http.Header { 4846 if c.header_ == nil { 4847 c.header_ = make(http.Header) 4848 } 4849 return c.header_ 4850} 4851 4852func (c *AchievementDefinitionsListCall) doRequest(alt string) (*http.Response, error) { 4853 reqHeaders := make(http.Header) 4854 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 4855 for k, v := range c.header_ { 4856 reqHeaders[k] = v 4857 } 4858 reqHeaders.Set("User-Agent", c.s.userAgent()) 4859 if c.ifNoneMatch_ != "" { 4860 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4861 } 4862 var body io.Reader = nil 4863 c.urlParams_.Set("alt", alt) 4864 c.urlParams_.Set("prettyPrint", "false") 4865 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements") 4866 urls += "?" + c.urlParams_.Encode() 4867 req, err := http.NewRequest("GET", urls, body) 4868 if err != nil { 4869 return nil, err 4870 } 4871 req.Header = reqHeaders 4872 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4873} 4874 4875// Do executes the "games.achievementDefinitions.list" call. 4876// Exactly one of *AchievementDefinitionsListResponse or error will be 4877// non-nil. Any non-2xx status code is an error. Response headers are in 4878// either *AchievementDefinitionsListResponse.ServerResponse.Header or 4879// (if a response was returned at all) in 4880// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4881// whether the returned error was because http.StatusNotModified was 4882// returned. 4883func (c *AchievementDefinitionsListCall) Do(opts ...googleapi.CallOption) (*AchievementDefinitionsListResponse, error) { 4884 gensupport.SetOptions(c.urlParams_, opts...) 4885 res, err := c.doRequest("json") 4886 if res != nil && res.StatusCode == http.StatusNotModified { 4887 if res.Body != nil { 4888 res.Body.Close() 4889 } 4890 return nil, &googleapi.Error{ 4891 Code: res.StatusCode, 4892 Header: res.Header, 4893 } 4894 } 4895 if err != nil { 4896 return nil, err 4897 } 4898 defer googleapi.CloseBody(res) 4899 if err := googleapi.CheckResponse(res); err != nil { 4900 return nil, err 4901 } 4902 ret := &AchievementDefinitionsListResponse{ 4903 ServerResponse: googleapi.ServerResponse{ 4904 Header: res.Header, 4905 HTTPStatusCode: res.StatusCode, 4906 }, 4907 } 4908 target := &ret 4909 if err := gensupport.DecodeResponse(target, res); err != nil { 4910 return nil, err 4911 } 4912 return ret, nil 4913 // { 4914 // "description": "Lists all the achievement definitions for your application.", 4915 // "httpMethod": "GET", 4916 // "id": "games.achievementDefinitions.list", 4917 // "parameters": { 4918 // "language": { 4919 // "description": "The preferred language to use for strings returned by this method.", 4920 // "location": "query", 4921 // "type": "string" 4922 // }, 4923 // "maxResults": { 4924 // "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.", 4925 // "format": "int32", 4926 // "location": "query", 4927 // "maximum": "200", 4928 // "minimum": "1", 4929 // "type": "integer" 4930 // }, 4931 // "pageToken": { 4932 // "description": "The token returned by the previous request.", 4933 // "location": "query", 4934 // "type": "string" 4935 // } 4936 // }, 4937 // "path": "achievements", 4938 // "response": { 4939 // "$ref": "AchievementDefinitionsListResponse" 4940 // }, 4941 // "scopes": [ 4942 // "https://www.googleapis.com/auth/games" 4943 // ] 4944 // } 4945 4946} 4947 4948// Pages invokes f for each page of results. 4949// A non-nil error returned from f will halt the iteration. 4950// The provided context supersedes any context provided to the Context method. 4951func (c *AchievementDefinitionsListCall) Pages(ctx context.Context, f func(*AchievementDefinitionsListResponse) error) error { 4952 c.ctx_ = ctx 4953 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4954 for { 4955 x, err := c.Do() 4956 if err != nil { 4957 return err 4958 } 4959 if err := f(x); err != nil { 4960 return err 4961 } 4962 if x.NextPageToken == "" { 4963 return nil 4964 } 4965 c.PageToken(x.NextPageToken) 4966 } 4967} 4968 4969// method id "games.achievements.increment": 4970 4971type AchievementsIncrementCall struct { 4972 s *Service 4973 achievementId string 4974 urlParams_ gensupport.URLParams 4975 ctx_ context.Context 4976 header_ http.Header 4977} 4978 4979// Increment: Increments the steps of the achievement with the given ID 4980// for the currently authenticated player. 4981func (r *AchievementsService) Increment(achievementId string, stepsToIncrement int64) *AchievementsIncrementCall { 4982 c := &AchievementsIncrementCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4983 c.achievementId = achievementId 4984 c.urlParams_.Set("stepsToIncrement", fmt.Sprint(stepsToIncrement)) 4985 return c 4986} 4987 4988// RequestId sets the optional parameter "requestId": A randomly 4989// generated numeric ID for each request specified by the caller. This 4990// number is used at the server to ensure that the request is handled 4991// correctly across retries. 4992func (c *AchievementsIncrementCall) RequestId(requestId int64) *AchievementsIncrementCall { 4993 c.urlParams_.Set("requestId", fmt.Sprint(requestId)) 4994 return c 4995} 4996 4997// Fields allows partial responses to be retrieved. See 4998// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4999// for more information. 5000func (c *AchievementsIncrementCall) Fields(s ...googleapi.Field) *AchievementsIncrementCall { 5001 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5002 return c 5003} 5004 5005// Context sets the context to be used in this call's Do method. Any 5006// pending HTTP request will be aborted if the provided context is 5007// canceled. 5008func (c *AchievementsIncrementCall) Context(ctx context.Context) *AchievementsIncrementCall { 5009 c.ctx_ = ctx 5010 return c 5011} 5012 5013// Header returns an http.Header that can be modified by the caller to 5014// add HTTP headers to the request. 5015func (c *AchievementsIncrementCall) Header() http.Header { 5016 if c.header_ == nil { 5017 c.header_ = make(http.Header) 5018 } 5019 return c.header_ 5020} 5021 5022func (c *AchievementsIncrementCall) doRequest(alt string) (*http.Response, error) { 5023 reqHeaders := make(http.Header) 5024 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5025 for k, v := range c.header_ { 5026 reqHeaders[k] = v 5027 } 5028 reqHeaders.Set("User-Agent", c.s.userAgent()) 5029 var body io.Reader = nil 5030 c.urlParams_.Set("alt", alt) 5031 c.urlParams_.Set("prettyPrint", "false") 5032 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/increment") 5033 urls += "?" + c.urlParams_.Encode() 5034 req, err := http.NewRequest("POST", urls, body) 5035 if err != nil { 5036 return nil, err 5037 } 5038 req.Header = reqHeaders 5039 googleapi.Expand(req.URL, map[string]string{ 5040 "achievementId": c.achievementId, 5041 }) 5042 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5043} 5044 5045// Do executes the "games.achievements.increment" call. 5046// Exactly one of *AchievementIncrementResponse or error will be 5047// non-nil. Any non-2xx status code is an error. Response headers are in 5048// either *AchievementIncrementResponse.ServerResponse.Header or (if a 5049// response was returned at all) in error.(*googleapi.Error).Header. Use 5050// googleapi.IsNotModified to check whether the returned error was 5051// because http.StatusNotModified was returned. 5052func (c *AchievementsIncrementCall) Do(opts ...googleapi.CallOption) (*AchievementIncrementResponse, error) { 5053 gensupport.SetOptions(c.urlParams_, opts...) 5054 res, err := c.doRequest("json") 5055 if res != nil && res.StatusCode == http.StatusNotModified { 5056 if res.Body != nil { 5057 res.Body.Close() 5058 } 5059 return nil, &googleapi.Error{ 5060 Code: res.StatusCode, 5061 Header: res.Header, 5062 } 5063 } 5064 if err != nil { 5065 return nil, err 5066 } 5067 defer googleapi.CloseBody(res) 5068 if err := googleapi.CheckResponse(res); err != nil { 5069 return nil, err 5070 } 5071 ret := &AchievementIncrementResponse{ 5072 ServerResponse: googleapi.ServerResponse{ 5073 Header: res.Header, 5074 HTTPStatusCode: res.StatusCode, 5075 }, 5076 } 5077 target := &ret 5078 if err := gensupport.DecodeResponse(target, res); err != nil { 5079 return nil, err 5080 } 5081 return ret, nil 5082 // { 5083 // "description": "Increments the steps of the achievement with the given ID for the currently authenticated player.", 5084 // "httpMethod": "POST", 5085 // "id": "games.achievements.increment", 5086 // "parameterOrder": [ 5087 // "achievementId", 5088 // "stepsToIncrement" 5089 // ], 5090 // "parameters": { 5091 // "achievementId": { 5092 // "description": "The ID of the achievement used by this method.", 5093 // "location": "path", 5094 // "required": true, 5095 // "type": "string" 5096 // }, 5097 // "requestId": { 5098 // "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.", 5099 // "format": "int64", 5100 // "location": "query", 5101 // "type": "string" 5102 // }, 5103 // "stepsToIncrement": { 5104 // "description": "The number of steps to increment.", 5105 // "format": "int32", 5106 // "location": "query", 5107 // "minimum": "1", 5108 // "required": true, 5109 // "type": "integer" 5110 // } 5111 // }, 5112 // "path": "achievements/{achievementId}/increment", 5113 // "response": { 5114 // "$ref": "AchievementIncrementResponse" 5115 // }, 5116 // "scopes": [ 5117 // "https://www.googleapis.com/auth/games" 5118 // ] 5119 // } 5120 5121} 5122 5123// method id "games.achievements.list": 5124 5125type AchievementsListCall struct { 5126 s *Service 5127 playerId string 5128 urlParams_ gensupport.URLParams 5129 ifNoneMatch_ string 5130 ctx_ context.Context 5131 header_ http.Header 5132} 5133 5134// List: Lists the progress for all your application's achievements for 5135// the currently authenticated player. 5136func (r *AchievementsService) List(playerId string) *AchievementsListCall { 5137 c := &AchievementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5138 c.playerId = playerId 5139 return c 5140} 5141 5142// Language sets the optional parameter "language": The preferred 5143// language to use for strings returned by this method. 5144func (c *AchievementsListCall) Language(language string) *AchievementsListCall { 5145 c.urlParams_.Set("language", language) 5146 return c 5147} 5148 5149// MaxResults sets the optional parameter "maxResults": The maximum 5150// number of achievement resources to return in the response, used for 5151// paging. For any response, the actual number of achievement resources 5152// returned may be less than the specified maxResults. 5153func (c *AchievementsListCall) MaxResults(maxResults int64) *AchievementsListCall { 5154 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5155 return c 5156} 5157 5158// PageToken sets the optional parameter "pageToken": The token returned 5159// by the previous request. 5160func (c *AchievementsListCall) PageToken(pageToken string) *AchievementsListCall { 5161 c.urlParams_.Set("pageToken", pageToken) 5162 return c 5163} 5164 5165// State sets the optional parameter "state": Tells the server to return 5166// only achievements with the specified state. If this parameter isn't 5167// specified, all achievements are returned. 5168// 5169// Possible values: 5170// "ALL" - List all achievements. This is the default. 5171// "HIDDEN" - List only hidden achievements. 5172// "REVEALED" - List only revealed achievements. 5173// "UNLOCKED" - List only unlocked achievements. 5174func (c *AchievementsListCall) State(state string) *AchievementsListCall { 5175 c.urlParams_.Set("state", state) 5176 return c 5177} 5178 5179// Fields allows partial responses to be retrieved. See 5180// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5181// for more information. 5182func (c *AchievementsListCall) Fields(s ...googleapi.Field) *AchievementsListCall { 5183 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5184 return c 5185} 5186 5187// IfNoneMatch sets the optional parameter which makes the operation 5188// fail if the object's ETag matches the given value. This is useful for 5189// getting updates only after the object has changed since the last 5190// request. Use googleapi.IsNotModified to check whether the response 5191// error from Do is the result of In-None-Match. 5192func (c *AchievementsListCall) IfNoneMatch(entityTag string) *AchievementsListCall { 5193 c.ifNoneMatch_ = entityTag 5194 return c 5195} 5196 5197// Context sets the context to be used in this call's Do method. Any 5198// pending HTTP request will be aborted if the provided context is 5199// canceled. 5200func (c *AchievementsListCall) Context(ctx context.Context) *AchievementsListCall { 5201 c.ctx_ = ctx 5202 return c 5203} 5204 5205// Header returns an http.Header that can be modified by the caller to 5206// add HTTP headers to the request. 5207func (c *AchievementsListCall) Header() http.Header { 5208 if c.header_ == nil { 5209 c.header_ = make(http.Header) 5210 } 5211 return c.header_ 5212} 5213 5214func (c *AchievementsListCall) doRequest(alt string) (*http.Response, error) { 5215 reqHeaders := make(http.Header) 5216 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5217 for k, v := range c.header_ { 5218 reqHeaders[k] = v 5219 } 5220 reqHeaders.Set("User-Agent", c.s.userAgent()) 5221 if c.ifNoneMatch_ != "" { 5222 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5223 } 5224 var body io.Reader = nil 5225 c.urlParams_.Set("alt", alt) 5226 c.urlParams_.Set("prettyPrint", "false") 5227 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/achievements") 5228 urls += "?" + c.urlParams_.Encode() 5229 req, err := http.NewRequest("GET", urls, body) 5230 if err != nil { 5231 return nil, err 5232 } 5233 req.Header = reqHeaders 5234 googleapi.Expand(req.URL, map[string]string{ 5235 "playerId": c.playerId, 5236 }) 5237 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5238} 5239 5240// Do executes the "games.achievements.list" call. 5241// Exactly one of *PlayerAchievementListResponse or error will be 5242// non-nil. Any non-2xx status code is an error. Response headers are in 5243// either *PlayerAchievementListResponse.ServerResponse.Header or (if a 5244// response was returned at all) in error.(*googleapi.Error).Header. Use 5245// googleapi.IsNotModified to check whether the returned error was 5246// because http.StatusNotModified was returned. 5247func (c *AchievementsListCall) Do(opts ...googleapi.CallOption) (*PlayerAchievementListResponse, error) { 5248 gensupport.SetOptions(c.urlParams_, opts...) 5249 res, err := c.doRequest("json") 5250 if res != nil && res.StatusCode == http.StatusNotModified { 5251 if res.Body != nil { 5252 res.Body.Close() 5253 } 5254 return nil, &googleapi.Error{ 5255 Code: res.StatusCode, 5256 Header: res.Header, 5257 } 5258 } 5259 if err != nil { 5260 return nil, err 5261 } 5262 defer googleapi.CloseBody(res) 5263 if err := googleapi.CheckResponse(res); err != nil { 5264 return nil, err 5265 } 5266 ret := &PlayerAchievementListResponse{ 5267 ServerResponse: googleapi.ServerResponse{ 5268 Header: res.Header, 5269 HTTPStatusCode: res.StatusCode, 5270 }, 5271 } 5272 target := &ret 5273 if err := gensupport.DecodeResponse(target, res); err != nil { 5274 return nil, err 5275 } 5276 return ret, nil 5277 // { 5278 // "description": "Lists the progress for all your application's achievements for the currently authenticated player.", 5279 // "httpMethod": "GET", 5280 // "id": "games.achievements.list", 5281 // "parameterOrder": [ 5282 // "playerId" 5283 // ], 5284 // "parameters": { 5285 // "language": { 5286 // "description": "The preferred language to use for strings returned by this method.", 5287 // "location": "query", 5288 // "type": "string" 5289 // }, 5290 // "maxResults": { 5291 // "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.", 5292 // "format": "int32", 5293 // "location": "query", 5294 // "maximum": "200", 5295 // "minimum": "1", 5296 // "type": "integer" 5297 // }, 5298 // "pageToken": { 5299 // "description": "The token returned by the previous request.", 5300 // "location": "query", 5301 // "type": "string" 5302 // }, 5303 // "playerId": { 5304 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 5305 // "location": "path", 5306 // "required": true, 5307 // "type": "string" 5308 // }, 5309 // "state": { 5310 // "description": "Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.", 5311 // "enum": [ 5312 // "ALL", 5313 // "HIDDEN", 5314 // "REVEALED", 5315 // "UNLOCKED" 5316 // ], 5317 // "enumDescriptions": [ 5318 // "List all achievements. This is the default.", 5319 // "List only hidden achievements.", 5320 // "List only revealed achievements.", 5321 // "List only unlocked achievements." 5322 // ], 5323 // "location": "query", 5324 // "type": "string" 5325 // } 5326 // }, 5327 // "path": "players/{playerId}/achievements", 5328 // "response": { 5329 // "$ref": "PlayerAchievementListResponse" 5330 // }, 5331 // "scopes": [ 5332 // "https://www.googleapis.com/auth/games" 5333 // ] 5334 // } 5335 5336} 5337 5338// Pages invokes f for each page of results. 5339// A non-nil error returned from f will halt the iteration. 5340// The provided context supersedes any context provided to the Context method. 5341func (c *AchievementsListCall) Pages(ctx context.Context, f func(*PlayerAchievementListResponse) error) error { 5342 c.ctx_ = ctx 5343 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5344 for { 5345 x, err := c.Do() 5346 if err != nil { 5347 return err 5348 } 5349 if err := f(x); err != nil { 5350 return err 5351 } 5352 if x.NextPageToken == "" { 5353 return nil 5354 } 5355 c.PageToken(x.NextPageToken) 5356 } 5357} 5358 5359// method id "games.achievements.reveal": 5360 5361type AchievementsRevealCall struct { 5362 s *Service 5363 achievementId string 5364 urlParams_ gensupport.URLParams 5365 ctx_ context.Context 5366 header_ http.Header 5367} 5368 5369// Reveal: Sets the state of the achievement with the given ID to 5370// REVEALED for the currently authenticated player. 5371func (r *AchievementsService) Reveal(achievementId string) *AchievementsRevealCall { 5372 c := &AchievementsRevealCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5373 c.achievementId = achievementId 5374 return c 5375} 5376 5377// Fields allows partial responses to be retrieved. See 5378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5379// for more information. 5380func (c *AchievementsRevealCall) Fields(s ...googleapi.Field) *AchievementsRevealCall { 5381 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5382 return c 5383} 5384 5385// Context sets the context to be used in this call's Do method. Any 5386// pending HTTP request will be aborted if the provided context is 5387// canceled. 5388func (c *AchievementsRevealCall) Context(ctx context.Context) *AchievementsRevealCall { 5389 c.ctx_ = ctx 5390 return c 5391} 5392 5393// Header returns an http.Header that can be modified by the caller to 5394// add HTTP headers to the request. 5395func (c *AchievementsRevealCall) Header() http.Header { 5396 if c.header_ == nil { 5397 c.header_ = make(http.Header) 5398 } 5399 return c.header_ 5400} 5401 5402func (c *AchievementsRevealCall) doRequest(alt string) (*http.Response, error) { 5403 reqHeaders := make(http.Header) 5404 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5405 for k, v := range c.header_ { 5406 reqHeaders[k] = v 5407 } 5408 reqHeaders.Set("User-Agent", c.s.userAgent()) 5409 var body io.Reader = nil 5410 c.urlParams_.Set("alt", alt) 5411 c.urlParams_.Set("prettyPrint", "false") 5412 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reveal") 5413 urls += "?" + c.urlParams_.Encode() 5414 req, err := http.NewRequest("POST", urls, body) 5415 if err != nil { 5416 return nil, err 5417 } 5418 req.Header = reqHeaders 5419 googleapi.Expand(req.URL, map[string]string{ 5420 "achievementId": c.achievementId, 5421 }) 5422 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5423} 5424 5425// Do executes the "games.achievements.reveal" call. 5426// Exactly one of *AchievementRevealResponse or error will be non-nil. 5427// Any non-2xx status code is an error. Response headers are in either 5428// *AchievementRevealResponse.ServerResponse.Header or (if a response 5429// was returned at all) in error.(*googleapi.Error).Header. Use 5430// googleapi.IsNotModified to check whether the returned error was 5431// because http.StatusNotModified was returned. 5432func (c *AchievementsRevealCall) Do(opts ...googleapi.CallOption) (*AchievementRevealResponse, error) { 5433 gensupport.SetOptions(c.urlParams_, opts...) 5434 res, err := c.doRequest("json") 5435 if res != nil && res.StatusCode == http.StatusNotModified { 5436 if res.Body != nil { 5437 res.Body.Close() 5438 } 5439 return nil, &googleapi.Error{ 5440 Code: res.StatusCode, 5441 Header: res.Header, 5442 } 5443 } 5444 if err != nil { 5445 return nil, err 5446 } 5447 defer googleapi.CloseBody(res) 5448 if err := googleapi.CheckResponse(res); err != nil { 5449 return nil, err 5450 } 5451 ret := &AchievementRevealResponse{ 5452 ServerResponse: googleapi.ServerResponse{ 5453 Header: res.Header, 5454 HTTPStatusCode: res.StatusCode, 5455 }, 5456 } 5457 target := &ret 5458 if err := gensupport.DecodeResponse(target, res); err != nil { 5459 return nil, err 5460 } 5461 return ret, nil 5462 // { 5463 // "description": "Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.", 5464 // "httpMethod": "POST", 5465 // "id": "games.achievements.reveal", 5466 // "parameterOrder": [ 5467 // "achievementId" 5468 // ], 5469 // "parameters": { 5470 // "achievementId": { 5471 // "description": "The ID of the achievement used by this method.", 5472 // "location": "path", 5473 // "required": true, 5474 // "type": "string" 5475 // } 5476 // }, 5477 // "path": "achievements/{achievementId}/reveal", 5478 // "response": { 5479 // "$ref": "AchievementRevealResponse" 5480 // }, 5481 // "scopes": [ 5482 // "https://www.googleapis.com/auth/games" 5483 // ] 5484 // } 5485 5486} 5487 5488// method id "games.achievements.setStepsAtLeast": 5489 5490type AchievementsSetStepsAtLeastCall struct { 5491 s *Service 5492 achievementId string 5493 urlParams_ gensupport.URLParams 5494 ctx_ context.Context 5495 header_ http.Header 5496} 5497 5498// SetStepsAtLeast: Sets the steps for the currently authenticated 5499// player towards unlocking an achievement. If the steps parameter is 5500// less than the current number of steps that the player already gained 5501// for the achievement, the achievement is not modified. 5502func (r *AchievementsService) SetStepsAtLeast(achievementId string, steps int64) *AchievementsSetStepsAtLeastCall { 5503 c := &AchievementsSetStepsAtLeastCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5504 c.achievementId = achievementId 5505 c.urlParams_.Set("steps", fmt.Sprint(steps)) 5506 return c 5507} 5508 5509// Fields allows partial responses to be retrieved. See 5510// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5511// for more information. 5512func (c *AchievementsSetStepsAtLeastCall) Fields(s ...googleapi.Field) *AchievementsSetStepsAtLeastCall { 5513 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5514 return c 5515} 5516 5517// Context sets the context to be used in this call's Do method. Any 5518// pending HTTP request will be aborted if the provided context is 5519// canceled. 5520func (c *AchievementsSetStepsAtLeastCall) Context(ctx context.Context) *AchievementsSetStepsAtLeastCall { 5521 c.ctx_ = ctx 5522 return c 5523} 5524 5525// Header returns an http.Header that can be modified by the caller to 5526// add HTTP headers to the request. 5527func (c *AchievementsSetStepsAtLeastCall) Header() http.Header { 5528 if c.header_ == nil { 5529 c.header_ = make(http.Header) 5530 } 5531 return c.header_ 5532} 5533 5534func (c *AchievementsSetStepsAtLeastCall) doRequest(alt string) (*http.Response, error) { 5535 reqHeaders := make(http.Header) 5536 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5537 for k, v := range c.header_ { 5538 reqHeaders[k] = v 5539 } 5540 reqHeaders.Set("User-Agent", c.s.userAgent()) 5541 var body io.Reader = nil 5542 c.urlParams_.Set("alt", alt) 5543 c.urlParams_.Set("prettyPrint", "false") 5544 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/setStepsAtLeast") 5545 urls += "?" + c.urlParams_.Encode() 5546 req, err := http.NewRequest("POST", urls, body) 5547 if err != nil { 5548 return nil, err 5549 } 5550 req.Header = reqHeaders 5551 googleapi.Expand(req.URL, map[string]string{ 5552 "achievementId": c.achievementId, 5553 }) 5554 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5555} 5556 5557// Do executes the "games.achievements.setStepsAtLeast" call. 5558// Exactly one of *AchievementSetStepsAtLeastResponse or error will be 5559// non-nil. Any non-2xx status code is an error. Response headers are in 5560// either *AchievementSetStepsAtLeastResponse.ServerResponse.Header or 5561// (if a response was returned at all) in 5562// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5563// whether the returned error was because http.StatusNotModified was 5564// returned. 5565func (c *AchievementsSetStepsAtLeastCall) Do(opts ...googleapi.CallOption) (*AchievementSetStepsAtLeastResponse, error) { 5566 gensupport.SetOptions(c.urlParams_, opts...) 5567 res, err := c.doRequest("json") 5568 if res != nil && res.StatusCode == http.StatusNotModified { 5569 if res.Body != nil { 5570 res.Body.Close() 5571 } 5572 return nil, &googleapi.Error{ 5573 Code: res.StatusCode, 5574 Header: res.Header, 5575 } 5576 } 5577 if err != nil { 5578 return nil, err 5579 } 5580 defer googleapi.CloseBody(res) 5581 if err := googleapi.CheckResponse(res); err != nil { 5582 return nil, err 5583 } 5584 ret := &AchievementSetStepsAtLeastResponse{ 5585 ServerResponse: googleapi.ServerResponse{ 5586 Header: res.Header, 5587 HTTPStatusCode: res.StatusCode, 5588 }, 5589 } 5590 target := &ret 5591 if err := gensupport.DecodeResponse(target, res); err != nil { 5592 return nil, err 5593 } 5594 return ret, nil 5595 // { 5596 // "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.", 5597 // "httpMethod": "POST", 5598 // "id": "games.achievements.setStepsAtLeast", 5599 // "parameterOrder": [ 5600 // "achievementId", 5601 // "steps" 5602 // ], 5603 // "parameters": { 5604 // "achievementId": { 5605 // "description": "The ID of the achievement used by this method.", 5606 // "location": "path", 5607 // "required": true, 5608 // "type": "string" 5609 // }, 5610 // "steps": { 5611 // "description": "The minimum value to set the steps to.", 5612 // "format": "int32", 5613 // "location": "query", 5614 // "minimum": "1", 5615 // "required": true, 5616 // "type": "integer" 5617 // } 5618 // }, 5619 // "path": "achievements/{achievementId}/setStepsAtLeast", 5620 // "response": { 5621 // "$ref": "AchievementSetStepsAtLeastResponse" 5622 // }, 5623 // "scopes": [ 5624 // "https://www.googleapis.com/auth/games" 5625 // ] 5626 // } 5627 5628} 5629 5630// method id "games.achievements.unlock": 5631 5632type AchievementsUnlockCall struct { 5633 s *Service 5634 achievementId string 5635 urlParams_ gensupport.URLParams 5636 ctx_ context.Context 5637 header_ http.Header 5638} 5639 5640// Unlock: Unlocks this achievement for the currently authenticated 5641// player. 5642func (r *AchievementsService) Unlock(achievementId string) *AchievementsUnlockCall { 5643 c := &AchievementsUnlockCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5644 c.achievementId = achievementId 5645 return c 5646} 5647 5648// BuiltinGameId sets the optional parameter "builtinGameId": Override 5649// used only by built-in games in Play Games application. 5650func (c *AchievementsUnlockCall) BuiltinGameId(builtinGameId string) *AchievementsUnlockCall { 5651 c.urlParams_.Set("builtinGameId", builtinGameId) 5652 return c 5653} 5654 5655// Fields allows partial responses to be retrieved. See 5656// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5657// for more information. 5658func (c *AchievementsUnlockCall) Fields(s ...googleapi.Field) *AchievementsUnlockCall { 5659 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5660 return c 5661} 5662 5663// Context sets the context to be used in this call's Do method. Any 5664// pending HTTP request will be aborted if the provided context is 5665// canceled. 5666func (c *AchievementsUnlockCall) Context(ctx context.Context) *AchievementsUnlockCall { 5667 c.ctx_ = ctx 5668 return c 5669} 5670 5671// Header returns an http.Header that can be modified by the caller to 5672// add HTTP headers to the request. 5673func (c *AchievementsUnlockCall) Header() http.Header { 5674 if c.header_ == nil { 5675 c.header_ = make(http.Header) 5676 } 5677 return c.header_ 5678} 5679 5680func (c *AchievementsUnlockCall) doRequest(alt string) (*http.Response, error) { 5681 reqHeaders := make(http.Header) 5682 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5683 for k, v := range c.header_ { 5684 reqHeaders[k] = v 5685 } 5686 reqHeaders.Set("User-Agent", c.s.userAgent()) 5687 var body io.Reader = nil 5688 c.urlParams_.Set("alt", alt) 5689 c.urlParams_.Set("prettyPrint", "false") 5690 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/unlock") 5691 urls += "?" + c.urlParams_.Encode() 5692 req, err := http.NewRequest("POST", urls, body) 5693 if err != nil { 5694 return nil, err 5695 } 5696 req.Header = reqHeaders 5697 googleapi.Expand(req.URL, map[string]string{ 5698 "achievementId": c.achievementId, 5699 }) 5700 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5701} 5702 5703// Do executes the "games.achievements.unlock" call. 5704// Exactly one of *AchievementUnlockResponse or error will be non-nil. 5705// Any non-2xx status code is an error. Response headers are in either 5706// *AchievementUnlockResponse.ServerResponse.Header or (if a response 5707// was returned at all) in error.(*googleapi.Error).Header. Use 5708// googleapi.IsNotModified to check whether the returned error was 5709// because http.StatusNotModified was returned. 5710func (c *AchievementsUnlockCall) Do(opts ...googleapi.CallOption) (*AchievementUnlockResponse, error) { 5711 gensupport.SetOptions(c.urlParams_, opts...) 5712 res, err := c.doRequest("json") 5713 if res != nil && res.StatusCode == http.StatusNotModified { 5714 if res.Body != nil { 5715 res.Body.Close() 5716 } 5717 return nil, &googleapi.Error{ 5718 Code: res.StatusCode, 5719 Header: res.Header, 5720 } 5721 } 5722 if err != nil { 5723 return nil, err 5724 } 5725 defer googleapi.CloseBody(res) 5726 if err := googleapi.CheckResponse(res); err != nil { 5727 return nil, err 5728 } 5729 ret := &AchievementUnlockResponse{ 5730 ServerResponse: googleapi.ServerResponse{ 5731 Header: res.Header, 5732 HTTPStatusCode: res.StatusCode, 5733 }, 5734 } 5735 target := &ret 5736 if err := gensupport.DecodeResponse(target, res); err != nil { 5737 return nil, err 5738 } 5739 return ret, nil 5740 // { 5741 // "description": "Unlocks this achievement for the currently authenticated player.", 5742 // "httpMethod": "POST", 5743 // "id": "games.achievements.unlock", 5744 // "parameterOrder": [ 5745 // "achievementId" 5746 // ], 5747 // "parameters": { 5748 // "achievementId": { 5749 // "description": "The ID of the achievement used by this method.", 5750 // "location": "path", 5751 // "required": true, 5752 // "type": "string" 5753 // }, 5754 // "builtinGameId": { 5755 // "description": "Override used only by built-in games in Play Games application.", 5756 // "location": "query", 5757 // "type": "string" 5758 // } 5759 // }, 5760 // "path": "achievements/{achievementId}/unlock", 5761 // "response": { 5762 // "$ref": "AchievementUnlockResponse" 5763 // }, 5764 // "scopes": [ 5765 // "https://www.googleapis.com/auth/games" 5766 // ] 5767 // } 5768 5769} 5770 5771// method id "games.achievements.updateMultiple": 5772 5773type AchievementsUpdateMultipleCall struct { 5774 s *Service 5775 achievementupdatemultiplerequest *AchievementUpdateMultipleRequest 5776 urlParams_ gensupport.URLParams 5777 ctx_ context.Context 5778 header_ http.Header 5779} 5780 5781// UpdateMultiple: Updates multiple achievements for the currently 5782// authenticated player. 5783func (r *AchievementsService) UpdateMultiple(achievementupdatemultiplerequest *AchievementUpdateMultipleRequest) *AchievementsUpdateMultipleCall { 5784 c := &AchievementsUpdateMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5785 c.achievementupdatemultiplerequest = achievementupdatemultiplerequest 5786 return c 5787} 5788 5789// BuiltinGameId sets the optional parameter "builtinGameId": Override 5790// used only by built-in games in Play Games application. 5791func (c *AchievementsUpdateMultipleCall) BuiltinGameId(builtinGameId string) *AchievementsUpdateMultipleCall { 5792 c.urlParams_.Set("builtinGameId", builtinGameId) 5793 return c 5794} 5795 5796// Fields allows partial responses to be retrieved. See 5797// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5798// for more information. 5799func (c *AchievementsUpdateMultipleCall) Fields(s ...googleapi.Field) *AchievementsUpdateMultipleCall { 5800 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5801 return c 5802} 5803 5804// Context sets the context to be used in this call's Do method. Any 5805// pending HTTP request will be aborted if the provided context is 5806// canceled. 5807func (c *AchievementsUpdateMultipleCall) Context(ctx context.Context) *AchievementsUpdateMultipleCall { 5808 c.ctx_ = ctx 5809 return c 5810} 5811 5812// Header returns an http.Header that can be modified by the caller to 5813// add HTTP headers to the request. 5814func (c *AchievementsUpdateMultipleCall) Header() http.Header { 5815 if c.header_ == nil { 5816 c.header_ = make(http.Header) 5817 } 5818 return c.header_ 5819} 5820 5821func (c *AchievementsUpdateMultipleCall) doRequest(alt string) (*http.Response, error) { 5822 reqHeaders := make(http.Header) 5823 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5824 for k, v := range c.header_ { 5825 reqHeaders[k] = v 5826 } 5827 reqHeaders.Set("User-Agent", c.s.userAgent()) 5828 var body io.Reader = nil 5829 body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementupdatemultiplerequest) 5830 if err != nil { 5831 return nil, err 5832 } 5833 reqHeaders.Set("Content-Type", "application/json") 5834 c.urlParams_.Set("alt", alt) 5835 c.urlParams_.Set("prettyPrint", "false") 5836 urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/updateMultiple") 5837 urls += "?" + c.urlParams_.Encode() 5838 req, err := http.NewRequest("POST", urls, body) 5839 if err != nil { 5840 return nil, err 5841 } 5842 req.Header = reqHeaders 5843 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5844} 5845 5846// Do executes the "games.achievements.updateMultiple" call. 5847// Exactly one of *AchievementUpdateMultipleResponse or error will be 5848// non-nil. Any non-2xx status code is an error. Response headers are in 5849// either *AchievementUpdateMultipleResponse.ServerResponse.Header or 5850// (if a response was returned at all) in 5851// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5852// whether the returned error was because http.StatusNotModified was 5853// returned. 5854func (c *AchievementsUpdateMultipleCall) Do(opts ...googleapi.CallOption) (*AchievementUpdateMultipleResponse, error) { 5855 gensupport.SetOptions(c.urlParams_, opts...) 5856 res, err := c.doRequest("json") 5857 if res != nil && res.StatusCode == http.StatusNotModified { 5858 if res.Body != nil { 5859 res.Body.Close() 5860 } 5861 return nil, &googleapi.Error{ 5862 Code: res.StatusCode, 5863 Header: res.Header, 5864 } 5865 } 5866 if err != nil { 5867 return nil, err 5868 } 5869 defer googleapi.CloseBody(res) 5870 if err := googleapi.CheckResponse(res); err != nil { 5871 return nil, err 5872 } 5873 ret := &AchievementUpdateMultipleResponse{ 5874 ServerResponse: googleapi.ServerResponse{ 5875 Header: res.Header, 5876 HTTPStatusCode: res.StatusCode, 5877 }, 5878 } 5879 target := &ret 5880 if err := gensupport.DecodeResponse(target, res); err != nil { 5881 return nil, err 5882 } 5883 return ret, nil 5884 // { 5885 // "description": "Updates multiple achievements for the currently authenticated player.", 5886 // "httpMethod": "POST", 5887 // "id": "games.achievements.updateMultiple", 5888 // "parameters": { 5889 // "builtinGameId": { 5890 // "description": "Override used only by built-in games in Play Games application.", 5891 // "location": "query", 5892 // "type": "string" 5893 // } 5894 // }, 5895 // "path": "achievements/updateMultiple", 5896 // "request": { 5897 // "$ref": "AchievementUpdateMultipleRequest" 5898 // }, 5899 // "response": { 5900 // "$ref": "AchievementUpdateMultipleResponse" 5901 // }, 5902 // "scopes": [ 5903 // "https://www.googleapis.com/auth/games" 5904 // ] 5905 // } 5906 5907} 5908 5909// method id "games.applications.get": 5910 5911type ApplicationsGetCall struct { 5912 s *Service 5913 applicationId string 5914 urlParams_ gensupport.URLParams 5915 ifNoneMatch_ string 5916 ctx_ context.Context 5917 header_ http.Header 5918} 5919 5920// Get: Retrieves the metadata of the application with the given ID. If 5921// the requested application is not available for the specified 5922// platformType, the returned response will not include any instance 5923// data. 5924func (r *ApplicationsService) Get(applicationId string) *ApplicationsGetCall { 5925 c := &ApplicationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5926 c.applicationId = applicationId 5927 return c 5928} 5929 5930// Language sets the optional parameter "language": The preferred 5931// language to use for strings returned by this method. 5932func (c *ApplicationsGetCall) Language(language string) *ApplicationsGetCall { 5933 c.urlParams_.Set("language", language) 5934 return c 5935} 5936 5937// PlatformType sets the optional parameter "platformType": Restrict 5938// application details returned to the specific platform. 5939// 5940// Possible values: 5941// "ANDROID" - Retrieve applications that can be played on Android. 5942// "IOS" - Retrieve applications that can be played on iOS. 5943// "WEB_APP" - Retrieve applications that can be played on desktop 5944// web. 5945func (c *ApplicationsGetCall) PlatformType(platformType string) *ApplicationsGetCall { 5946 c.urlParams_.Set("platformType", platformType) 5947 return c 5948} 5949 5950// Fields allows partial responses to be retrieved. See 5951// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5952// for more information. 5953func (c *ApplicationsGetCall) Fields(s ...googleapi.Field) *ApplicationsGetCall { 5954 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5955 return c 5956} 5957 5958// IfNoneMatch sets the optional parameter which makes the operation 5959// fail if the object's ETag matches the given value. This is useful for 5960// getting updates only after the object has changed since the last 5961// request. Use googleapi.IsNotModified to check whether the response 5962// error from Do is the result of In-None-Match. 5963func (c *ApplicationsGetCall) IfNoneMatch(entityTag string) *ApplicationsGetCall { 5964 c.ifNoneMatch_ = entityTag 5965 return c 5966} 5967 5968// Context sets the context to be used in this call's Do method. Any 5969// pending HTTP request will be aborted if the provided context is 5970// canceled. 5971func (c *ApplicationsGetCall) Context(ctx context.Context) *ApplicationsGetCall { 5972 c.ctx_ = ctx 5973 return c 5974} 5975 5976// Header returns an http.Header that can be modified by the caller to 5977// add HTTP headers to the request. 5978func (c *ApplicationsGetCall) Header() http.Header { 5979 if c.header_ == nil { 5980 c.header_ = make(http.Header) 5981 } 5982 return c.header_ 5983} 5984 5985func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) { 5986 reqHeaders := make(http.Header) 5987 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 5988 for k, v := range c.header_ { 5989 reqHeaders[k] = v 5990 } 5991 reqHeaders.Set("User-Agent", c.s.userAgent()) 5992 if c.ifNoneMatch_ != "" { 5993 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5994 } 5995 var body io.Reader = nil 5996 c.urlParams_.Set("alt", alt) 5997 c.urlParams_.Set("prettyPrint", "false") 5998 urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}") 5999 urls += "?" + c.urlParams_.Encode() 6000 req, err := http.NewRequest("GET", urls, body) 6001 if err != nil { 6002 return nil, err 6003 } 6004 req.Header = reqHeaders 6005 googleapi.Expand(req.URL, map[string]string{ 6006 "applicationId": c.applicationId, 6007 }) 6008 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6009} 6010 6011// Do executes the "games.applications.get" call. 6012// Exactly one of *Application or error will be non-nil. Any non-2xx 6013// status code is an error. Response headers are in either 6014// *Application.ServerResponse.Header or (if a response was returned at 6015// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6016// to check whether the returned error was because 6017// http.StatusNotModified was returned. 6018func (c *ApplicationsGetCall) Do(opts ...googleapi.CallOption) (*Application, error) { 6019 gensupport.SetOptions(c.urlParams_, opts...) 6020 res, err := c.doRequest("json") 6021 if res != nil && res.StatusCode == http.StatusNotModified { 6022 if res.Body != nil { 6023 res.Body.Close() 6024 } 6025 return nil, &googleapi.Error{ 6026 Code: res.StatusCode, 6027 Header: res.Header, 6028 } 6029 } 6030 if err != nil { 6031 return nil, err 6032 } 6033 defer googleapi.CloseBody(res) 6034 if err := googleapi.CheckResponse(res); err != nil { 6035 return nil, err 6036 } 6037 ret := &Application{ 6038 ServerResponse: googleapi.ServerResponse{ 6039 Header: res.Header, 6040 HTTPStatusCode: res.StatusCode, 6041 }, 6042 } 6043 target := &ret 6044 if err := gensupport.DecodeResponse(target, res); err != nil { 6045 return nil, err 6046 } 6047 return ret, nil 6048 // { 6049 // "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.", 6050 // "httpMethod": "GET", 6051 // "id": "games.applications.get", 6052 // "parameterOrder": [ 6053 // "applicationId" 6054 // ], 6055 // "parameters": { 6056 // "applicationId": { 6057 // "description": "The application ID from the Google Play developer console.", 6058 // "location": "path", 6059 // "required": true, 6060 // "type": "string" 6061 // }, 6062 // "language": { 6063 // "description": "The preferred language to use for strings returned by this method.", 6064 // "location": "query", 6065 // "type": "string" 6066 // }, 6067 // "platformType": { 6068 // "description": "Restrict application details returned to the specific platform.", 6069 // "enum": [ 6070 // "ANDROID", 6071 // "IOS", 6072 // "WEB_APP" 6073 // ], 6074 // "enumDescriptions": [ 6075 // "Retrieve applications that can be played on Android.", 6076 // "Retrieve applications that can be played on iOS.", 6077 // "Retrieve applications that can be played on desktop web." 6078 // ], 6079 // "location": "query", 6080 // "type": "string" 6081 // } 6082 // }, 6083 // "path": "applications/{applicationId}", 6084 // "response": { 6085 // "$ref": "Application" 6086 // }, 6087 // "scopes": [ 6088 // "https://www.googleapis.com/auth/games" 6089 // ] 6090 // } 6091 6092} 6093 6094// method id "games.applications.played": 6095 6096type ApplicationsPlayedCall struct { 6097 s *Service 6098 urlParams_ gensupport.URLParams 6099 ctx_ context.Context 6100 header_ http.Header 6101} 6102 6103// Played: Indicate that the the currently authenticated user is playing 6104// your application. 6105func (r *ApplicationsService) Played() *ApplicationsPlayedCall { 6106 c := &ApplicationsPlayedCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6107 return c 6108} 6109 6110// BuiltinGameId sets the optional parameter "builtinGameId": Override 6111// used only by built-in games in Play Games application. 6112func (c *ApplicationsPlayedCall) BuiltinGameId(builtinGameId string) *ApplicationsPlayedCall { 6113 c.urlParams_.Set("builtinGameId", builtinGameId) 6114 return c 6115} 6116 6117// Fields allows partial responses to be retrieved. See 6118// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6119// for more information. 6120func (c *ApplicationsPlayedCall) Fields(s ...googleapi.Field) *ApplicationsPlayedCall { 6121 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6122 return c 6123} 6124 6125// Context sets the context to be used in this call's Do method. Any 6126// pending HTTP request will be aborted if the provided context is 6127// canceled. 6128func (c *ApplicationsPlayedCall) Context(ctx context.Context) *ApplicationsPlayedCall { 6129 c.ctx_ = ctx 6130 return c 6131} 6132 6133// Header returns an http.Header that can be modified by the caller to 6134// add HTTP headers to the request. 6135func (c *ApplicationsPlayedCall) Header() http.Header { 6136 if c.header_ == nil { 6137 c.header_ = make(http.Header) 6138 } 6139 return c.header_ 6140} 6141 6142func (c *ApplicationsPlayedCall) doRequest(alt string) (*http.Response, error) { 6143 reqHeaders := make(http.Header) 6144 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6145 for k, v := range c.header_ { 6146 reqHeaders[k] = v 6147 } 6148 reqHeaders.Set("User-Agent", c.s.userAgent()) 6149 var body io.Reader = nil 6150 c.urlParams_.Set("alt", alt) 6151 c.urlParams_.Set("prettyPrint", "false") 6152 urls := googleapi.ResolveRelative(c.s.BasePath, "applications/played") 6153 urls += "?" + c.urlParams_.Encode() 6154 req, err := http.NewRequest("POST", urls, body) 6155 if err != nil { 6156 return nil, err 6157 } 6158 req.Header = reqHeaders 6159 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6160} 6161 6162// Do executes the "games.applications.played" call. 6163func (c *ApplicationsPlayedCall) Do(opts ...googleapi.CallOption) error { 6164 gensupport.SetOptions(c.urlParams_, opts...) 6165 res, err := c.doRequest("json") 6166 if err != nil { 6167 return err 6168 } 6169 defer googleapi.CloseBody(res) 6170 if err := googleapi.CheckResponse(res); err != nil { 6171 return err 6172 } 6173 return nil 6174 // { 6175 // "description": "Indicate that the the currently authenticated user is playing your application.", 6176 // "httpMethod": "POST", 6177 // "id": "games.applications.played", 6178 // "parameters": { 6179 // "builtinGameId": { 6180 // "description": "Override used only by built-in games in Play Games application.", 6181 // "location": "query", 6182 // "type": "string" 6183 // } 6184 // }, 6185 // "path": "applications/played", 6186 // "scopes": [ 6187 // "https://www.googleapis.com/auth/games" 6188 // ] 6189 // } 6190 6191} 6192 6193// method id "games.applications.verify": 6194 6195type ApplicationsVerifyCall struct { 6196 s *Service 6197 applicationId string 6198 urlParams_ gensupport.URLParams 6199 ifNoneMatch_ string 6200 ctx_ context.Context 6201 header_ http.Header 6202} 6203 6204// Verify: Verifies the auth token provided with this request is for the 6205// application with the specified ID, and returns the ID of the player 6206// it was granted for. 6207func (r *ApplicationsService) Verify(applicationId string) *ApplicationsVerifyCall { 6208 c := &ApplicationsVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6209 c.applicationId = applicationId 6210 return c 6211} 6212 6213// Fields allows partial responses to be retrieved. See 6214// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6215// for more information. 6216func (c *ApplicationsVerifyCall) Fields(s ...googleapi.Field) *ApplicationsVerifyCall { 6217 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6218 return c 6219} 6220 6221// IfNoneMatch sets the optional parameter which makes the operation 6222// fail if the object's ETag matches the given value. This is useful for 6223// getting updates only after the object has changed since the last 6224// request. Use googleapi.IsNotModified to check whether the response 6225// error from Do is the result of In-None-Match. 6226func (c *ApplicationsVerifyCall) IfNoneMatch(entityTag string) *ApplicationsVerifyCall { 6227 c.ifNoneMatch_ = entityTag 6228 return c 6229} 6230 6231// Context sets the context to be used in this call's Do method. Any 6232// pending HTTP request will be aborted if the provided context is 6233// canceled. 6234func (c *ApplicationsVerifyCall) Context(ctx context.Context) *ApplicationsVerifyCall { 6235 c.ctx_ = ctx 6236 return c 6237} 6238 6239// Header returns an http.Header that can be modified by the caller to 6240// add HTTP headers to the request. 6241func (c *ApplicationsVerifyCall) Header() http.Header { 6242 if c.header_ == nil { 6243 c.header_ = make(http.Header) 6244 } 6245 return c.header_ 6246} 6247 6248func (c *ApplicationsVerifyCall) doRequest(alt string) (*http.Response, error) { 6249 reqHeaders := make(http.Header) 6250 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6251 for k, v := range c.header_ { 6252 reqHeaders[k] = v 6253 } 6254 reqHeaders.Set("User-Agent", c.s.userAgent()) 6255 if c.ifNoneMatch_ != "" { 6256 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6257 } 6258 var body io.Reader = nil 6259 c.urlParams_.Set("alt", alt) 6260 c.urlParams_.Set("prettyPrint", "false") 6261 urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/verify") 6262 urls += "?" + c.urlParams_.Encode() 6263 req, err := http.NewRequest("GET", urls, body) 6264 if err != nil { 6265 return nil, err 6266 } 6267 req.Header = reqHeaders 6268 googleapi.Expand(req.URL, map[string]string{ 6269 "applicationId": c.applicationId, 6270 }) 6271 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6272} 6273 6274// Do executes the "games.applications.verify" call. 6275// Exactly one of *ApplicationVerifyResponse or error will be non-nil. 6276// Any non-2xx status code is an error. Response headers are in either 6277// *ApplicationVerifyResponse.ServerResponse.Header or (if a response 6278// was returned at all) in error.(*googleapi.Error).Header. Use 6279// googleapi.IsNotModified to check whether the returned error was 6280// because http.StatusNotModified was returned. 6281func (c *ApplicationsVerifyCall) Do(opts ...googleapi.CallOption) (*ApplicationVerifyResponse, error) { 6282 gensupport.SetOptions(c.urlParams_, opts...) 6283 res, err := c.doRequest("json") 6284 if res != nil && res.StatusCode == http.StatusNotModified { 6285 if res.Body != nil { 6286 res.Body.Close() 6287 } 6288 return nil, &googleapi.Error{ 6289 Code: res.StatusCode, 6290 Header: res.Header, 6291 } 6292 } 6293 if err != nil { 6294 return nil, err 6295 } 6296 defer googleapi.CloseBody(res) 6297 if err := googleapi.CheckResponse(res); err != nil { 6298 return nil, err 6299 } 6300 ret := &ApplicationVerifyResponse{ 6301 ServerResponse: googleapi.ServerResponse{ 6302 Header: res.Header, 6303 HTTPStatusCode: res.StatusCode, 6304 }, 6305 } 6306 target := &ret 6307 if err := gensupport.DecodeResponse(target, res); err != nil { 6308 return nil, err 6309 } 6310 return ret, nil 6311 // { 6312 // "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.", 6313 // "httpMethod": "GET", 6314 // "id": "games.applications.verify", 6315 // "parameterOrder": [ 6316 // "applicationId" 6317 // ], 6318 // "parameters": { 6319 // "applicationId": { 6320 // "description": "The application ID from the Google Play developer console.", 6321 // "location": "path", 6322 // "required": true, 6323 // "type": "string" 6324 // } 6325 // }, 6326 // "path": "applications/{applicationId}/verify", 6327 // "response": { 6328 // "$ref": "ApplicationVerifyResponse" 6329 // }, 6330 // "scopes": [ 6331 // "https://www.googleapis.com/auth/games" 6332 // ] 6333 // } 6334 6335} 6336 6337// method id "games.events.listByPlayer": 6338 6339type EventsListByPlayerCall struct { 6340 s *Service 6341 urlParams_ gensupport.URLParams 6342 ifNoneMatch_ string 6343 ctx_ context.Context 6344 header_ http.Header 6345} 6346 6347// ListByPlayer: Returns a list showing the current progress on events 6348// in this application for the currently authenticated user. 6349func (r *EventsService) ListByPlayer() *EventsListByPlayerCall { 6350 c := &EventsListByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6351 return c 6352} 6353 6354// Language sets the optional parameter "language": The preferred 6355// language to use for strings returned by this method. 6356func (c *EventsListByPlayerCall) Language(language string) *EventsListByPlayerCall { 6357 c.urlParams_.Set("language", language) 6358 return c 6359} 6360 6361// MaxResults sets the optional parameter "maxResults": The maximum 6362// number of events to return in the response, used for paging. For any 6363// response, the actual number of events to return may be less than the 6364// specified maxResults. 6365func (c *EventsListByPlayerCall) MaxResults(maxResults int64) *EventsListByPlayerCall { 6366 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6367 return c 6368} 6369 6370// PageToken sets the optional parameter "pageToken": The token returned 6371// by the previous request. 6372func (c *EventsListByPlayerCall) PageToken(pageToken string) *EventsListByPlayerCall { 6373 c.urlParams_.Set("pageToken", pageToken) 6374 return c 6375} 6376 6377// Fields allows partial responses to be retrieved. See 6378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6379// for more information. 6380func (c *EventsListByPlayerCall) Fields(s ...googleapi.Field) *EventsListByPlayerCall { 6381 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6382 return c 6383} 6384 6385// IfNoneMatch sets the optional parameter which makes the operation 6386// fail if the object's ETag matches the given value. This is useful for 6387// getting updates only after the object has changed since the last 6388// request. Use googleapi.IsNotModified to check whether the response 6389// error from Do is the result of In-None-Match. 6390func (c *EventsListByPlayerCall) IfNoneMatch(entityTag string) *EventsListByPlayerCall { 6391 c.ifNoneMatch_ = entityTag 6392 return c 6393} 6394 6395// Context sets the context to be used in this call's Do method. Any 6396// pending HTTP request will be aborted if the provided context is 6397// canceled. 6398func (c *EventsListByPlayerCall) Context(ctx context.Context) *EventsListByPlayerCall { 6399 c.ctx_ = ctx 6400 return c 6401} 6402 6403// Header returns an http.Header that can be modified by the caller to 6404// add HTTP headers to the request. 6405func (c *EventsListByPlayerCall) Header() http.Header { 6406 if c.header_ == nil { 6407 c.header_ = make(http.Header) 6408 } 6409 return c.header_ 6410} 6411 6412func (c *EventsListByPlayerCall) doRequest(alt string) (*http.Response, error) { 6413 reqHeaders := make(http.Header) 6414 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6415 for k, v := range c.header_ { 6416 reqHeaders[k] = v 6417 } 6418 reqHeaders.Set("User-Agent", c.s.userAgent()) 6419 if c.ifNoneMatch_ != "" { 6420 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6421 } 6422 var body io.Reader = nil 6423 c.urlParams_.Set("alt", alt) 6424 c.urlParams_.Set("prettyPrint", "false") 6425 urls := googleapi.ResolveRelative(c.s.BasePath, "events") 6426 urls += "?" + c.urlParams_.Encode() 6427 req, err := http.NewRequest("GET", urls, body) 6428 if err != nil { 6429 return nil, err 6430 } 6431 req.Header = reqHeaders 6432 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6433} 6434 6435// Do executes the "games.events.listByPlayer" call. 6436// Exactly one of *PlayerEventListResponse or error will be non-nil. Any 6437// non-2xx status code is an error. Response headers are in either 6438// *PlayerEventListResponse.ServerResponse.Header or (if a response was 6439// returned at all) in error.(*googleapi.Error).Header. Use 6440// googleapi.IsNotModified to check whether the returned error was 6441// because http.StatusNotModified was returned. 6442func (c *EventsListByPlayerCall) Do(opts ...googleapi.CallOption) (*PlayerEventListResponse, error) { 6443 gensupport.SetOptions(c.urlParams_, opts...) 6444 res, err := c.doRequest("json") 6445 if res != nil && res.StatusCode == http.StatusNotModified { 6446 if res.Body != nil { 6447 res.Body.Close() 6448 } 6449 return nil, &googleapi.Error{ 6450 Code: res.StatusCode, 6451 Header: res.Header, 6452 } 6453 } 6454 if err != nil { 6455 return nil, err 6456 } 6457 defer googleapi.CloseBody(res) 6458 if err := googleapi.CheckResponse(res); err != nil { 6459 return nil, err 6460 } 6461 ret := &PlayerEventListResponse{ 6462 ServerResponse: googleapi.ServerResponse{ 6463 Header: res.Header, 6464 HTTPStatusCode: res.StatusCode, 6465 }, 6466 } 6467 target := &ret 6468 if err := gensupport.DecodeResponse(target, res); err != nil { 6469 return nil, err 6470 } 6471 return ret, nil 6472 // { 6473 // "description": "Returns a list showing the current progress on events in this application for the currently authenticated user.", 6474 // "httpMethod": "GET", 6475 // "id": "games.events.listByPlayer", 6476 // "parameters": { 6477 // "language": { 6478 // "description": "The preferred language to use for strings returned by this method.", 6479 // "location": "query", 6480 // "type": "string" 6481 // }, 6482 // "maxResults": { 6483 // "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.", 6484 // "format": "int32", 6485 // "location": "query", 6486 // "maximum": "100", 6487 // "minimum": "1", 6488 // "type": "integer" 6489 // }, 6490 // "pageToken": { 6491 // "description": "The token returned by the previous request.", 6492 // "location": "query", 6493 // "type": "string" 6494 // } 6495 // }, 6496 // "path": "events", 6497 // "response": { 6498 // "$ref": "PlayerEventListResponse" 6499 // }, 6500 // "scopes": [ 6501 // "https://www.googleapis.com/auth/games" 6502 // ] 6503 // } 6504 6505} 6506 6507// Pages invokes f for each page of results. 6508// A non-nil error returned from f will halt the iteration. 6509// The provided context supersedes any context provided to the Context method. 6510func (c *EventsListByPlayerCall) Pages(ctx context.Context, f func(*PlayerEventListResponse) error) error { 6511 c.ctx_ = ctx 6512 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6513 for { 6514 x, err := c.Do() 6515 if err != nil { 6516 return err 6517 } 6518 if err := f(x); err != nil { 6519 return err 6520 } 6521 if x.NextPageToken == "" { 6522 return nil 6523 } 6524 c.PageToken(x.NextPageToken) 6525 } 6526} 6527 6528// method id "games.events.listDefinitions": 6529 6530type EventsListDefinitionsCall struct { 6531 s *Service 6532 urlParams_ gensupport.URLParams 6533 ifNoneMatch_ string 6534 ctx_ context.Context 6535 header_ http.Header 6536} 6537 6538// ListDefinitions: Returns a list of the event definitions in this 6539// application. 6540func (r *EventsService) ListDefinitions() *EventsListDefinitionsCall { 6541 c := &EventsListDefinitionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6542 return c 6543} 6544 6545// Language sets the optional parameter "language": The preferred 6546// language to use for strings returned by this method. 6547func (c *EventsListDefinitionsCall) Language(language string) *EventsListDefinitionsCall { 6548 c.urlParams_.Set("language", language) 6549 return c 6550} 6551 6552// MaxResults sets the optional parameter "maxResults": The maximum 6553// number of event definitions to return in the response, used for 6554// paging. For any response, the actual number of event definitions to 6555// return may be less than the specified maxResults. 6556func (c *EventsListDefinitionsCall) MaxResults(maxResults int64) *EventsListDefinitionsCall { 6557 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6558 return c 6559} 6560 6561// PageToken sets the optional parameter "pageToken": The token returned 6562// by the previous request. 6563func (c *EventsListDefinitionsCall) PageToken(pageToken string) *EventsListDefinitionsCall { 6564 c.urlParams_.Set("pageToken", pageToken) 6565 return c 6566} 6567 6568// Fields allows partial responses to be retrieved. See 6569// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6570// for more information. 6571func (c *EventsListDefinitionsCall) Fields(s ...googleapi.Field) *EventsListDefinitionsCall { 6572 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6573 return c 6574} 6575 6576// IfNoneMatch sets the optional parameter which makes the operation 6577// fail if the object's ETag matches the given value. This is useful for 6578// getting updates only after the object has changed since the last 6579// request. Use googleapi.IsNotModified to check whether the response 6580// error from Do is the result of In-None-Match. 6581func (c *EventsListDefinitionsCall) IfNoneMatch(entityTag string) *EventsListDefinitionsCall { 6582 c.ifNoneMatch_ = entityTag 6583 return c 6584} 6585 6586// Context sets the context to be used in this call's Do method. Any 6587// pending HTTP request will be aborted if the provided context is 6588// canceled. 6589func (c *EventsListDefinitionsCall) Context(ctx context.Context) *EventsListDefinitionsCall { 6590 c.ctx_ = ctx 6591 return c 6592} 6593 6594// Header returns an http.Header that can be modified by the caller to 6595// add HTTP headers to the request. 6596func (c *EventsListDefinitionsCall) Header() http.Header { 6597 if c.header_ == nil { 6598 c.header_ = make(http.Header) 6599 } 6600 return c.header_ 6601} 6602 6603func (c *EventsListDefinitionsCall) doRequest(alt string) (*http.Response, error) { 6604 reqHeaders := make(http.Header) 6605 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6606 for k, v := range c.header_ { 6607 reqHeaders[k] = v 6608 } 6609 reqHeaders.Set("User-Agent", c.s.userAgent()) 6610 if c.ifNoneMatch_ != "" { 6611 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6612 } 6613 var body io.Reader = nil 6614 c.urlParams_.Set("alt", alt) 6615 c.urlParams_.Set("prettyPrint", "false") 6616 urls := googleapi.ResolveRelative(c.s.BasePath, "eventDefinitions") 6617 urls += "?" + c.urlParams_.Encode() 6618 req, err := http.NewRequest("GET", urls, body) 6619 if err != nil { 6620 return nil, err 6621 } 6622 req.Header = reqHeaders 6623 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6624} 6625 6626// Do executes the "games.events.listDefinitions" call. 6627// Exactly one of *EventDefinitionListResponse or error will be non-nil. 6628// Any non-2xx status code is an error. Response headers are in either 6629// *EventDefinitionListResponse.ServerResponse.Header or (if a response 6630// was returned at all) in error.(*googleapi.Error).Header. Use 6631// googleapi.IsNotModified to check whether the returned error was 6632// because http.StatusNotModified was returned. 6633func (c *EventsListDefinitionsCall) Do(opts ...googleapi.CallOption) (*EventDefinitionListResponse, error) { 6634 gensupport.SetOptions(c.urlParams_, opts...) 6635 res, err := c.doRequest("json") 6636 if res != nil && res.StatusCode == http.StatusNotModified { 6637 if res.Body != nil { 6638 res.Body.Close() 6639 } 6640 return nil, &googleapi.Error{ 6641 Code: res.StatusCode, 6642 Header: res.Header, 6643 } 6644 } 6645 if err != nil { 6646 return nil, err 6647 } 6648 defer googleapi.CloseBody(res) 6649 if err := googleapi.CheckResponse(res); err != nil { 6650 return nil, err 6651 } 6652 ret := &EventDefinitionListResponse{ 6653 ServerResponse: googleapi.ServerResponse{ 6654 Header: res.Header, 6655 HTTPStatusCode: res.StatusCode, 6656 }, 6657 } 6658 target := &ret 6659 if err := gensupport.DecodeResponse(target, res); err != nil { 6660 return nil, err 6661 } 6662 return ret, nil 6663 // { 6664 // "description": "Returns a list of the event definitions in this application.", 6665 // "httpMethod": "GET", 6666 // "id": "games.events.listDefinitions", 6667 // "parameters": { 6668 // "language": { 6669 // "description": "The preferred language to use for strings returned by this method.", 6670 // "location": "query", 6671 // "type": "string" 6672 // }, 6673 // "maxResults": { 6674 // "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.", 6675 // "format": "int32", 6676 // "location": "query", 6677 // "maximum": "100", 6678 // "minimum": "1", 6679 // "type": "integer" 6680 // }, 6681 // "pageToken": { 6682 // "description": "The token returned by the previous request.", 6683 // "location": "query", 6684 // "type": "string" 6685 // } 6686 // }, 6687 // "path": "eventDefinitions", 6688 // "response": { 6689 // "$ref": "EventDefinitionListResponse" 6690 // }, 6691 // "scopes": [ 6692 // "https://www.googleapis.com/auth/games" 6693 // ] 6694 // } 6695 6696} 6697 6698// Pages invokes f for each page of results. 6699// A non-nil error returned from f will halt the iteration. 6700// The provided context supersedes any context provided to the Context method. 6701func (c *EventsListDefinitionsCall) Pages(ctx context.Context, f func(*EventDefinitionListResponse) error) error { 6702 c.ctx_ = ctx 6703 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6704 for { 6705 x, err := c.Do() 6706 if err != nil { 6707 return err 6708 } 6709 if err := f(x); err != nil { 6710 return err 6711 } 6712 if x.NextPageToken == "" { 6713 return nil 6714 } 6715 c.PageToken(x.NextPageToken) 6716 } 6717} 6718 6719// method id "games.events.record": 6720 6721type EventsRecordCall struct { 6722 s *Service 6723 eventrecordrequest *EventRecordRequest 6724 urlParams_ gensupport.URLParams 6725 ctx_ context.Context 6726 header_ http.Header 6727} 6728 6729// Record: Records a batch of changes to the number of times events have 6730// occurred for the currently authenticated user of this application. 6731func (r *EventsService) Record(eventrecordrequest *EventRecordRequest) *EventsRecordCall { 6732 c := &EventsRecordCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6733 c.eventrecordrequest = eventrecordrequest 6734 return c 6735} 6736 6737// Language sets the optional parameter "language": The preferred 6738// language to use for strings returned by this method. 6739func (c *EventsRecordCall) Language(language string) *EventsRecordCall { 6740 c.urlParams_.Set("language", language) 6741 return c 6742} 6743 6744// Fields allows partial responses to be retrieved. See 6745// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6746// for more information. 6747func (c *EventsRecordCall) Fields(s ...googleapi.Field) *EventsRecordCall { 6748 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6749 return c 6750} 6751 6752// Context sets the context to be used in this call's Do method. Any 6753// pending HTTP request will be aborted if the provided context is 6754// canceled. 6755func (c *EventsRecordCall) Context(ctx context.Context) *EventsRecordCall { 6756 c.ctx_ = ctx 6757 return c 6758} 6759 6760// Header returns an http.Header that can be modified by the caller to 6761// add HTTP headers to the request. 6762func (c *EventsRecordCall) Header() http.Header { 6763 if c.header_ == nil { 6764 c.header_ = make(http.Header) 6765 } 6766 return c.header_ 6767} 6768 6769func (c *EventsRecordCall) doRequest(alt string) (*http.Response, error) { 6770 reqHeaders := make(http.Header) 6771 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6772 for k, v := range c.header_ { 6773 reqHeaders[k] = v 6774 } 6775 reqHeaders.Set("User-Agent", c.s.userAgent()) 6776 var body io.Reader = nil 6777 body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventrecordrequest) 6778 if err != nil { 6779 return nil, err 6780 } 6781 reqHeaders.Set("Content-Type", "application/json") 6782 c.urlParams_.Set("alt", alt) 6783 c.urlParams_.Set("prettyPrint", "false") 6784 urls := googleapi.ResolveRelative(c.s.BasePath, "events") 6785 urls += "?" + c.urlParams_.Encode() 6786 req, err := http.NewRequest("POST", urls, body) 6787 if err != nil { 6788 return nil, err 6789 } 6790 req.Header = reqHeaders 6791 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6792} 6793 6794// Do executes the "games.events.record" call. 6795// Exactly one of *EventUpdateResponse or error will be non-nil. Any 6796// non-2xx status code is an error. Response headers are in either 6797// *EventUpdateResponse.ServerResponse.Header or (if a response was 6798// returned at all) in error.(*googleapi.Error).Header. Use 6799// googleapi.IsNotModified to check whether the returned error was 6800// because http.StatusNotModified was returned. 6801func (c *EventsRecordCall) Do(opts ...googleapi.CallOption) (*EventUpdateResponse, error) { 6802 gensupport.SetOptions(c.urlParams_, opts...) 6803 res, err := c.doRequest("json") 6804 if res != nil && res.StatusCode == http.StatusNotModified { 6805 if res.Body != nil { 6806 res.Body.Close() 6807 } 6808 return nil, &googleapi.Error{ 6809 Code: res.StatusCode, 6810 Header: res.Header, 6811 } 6812 } 6813 if err != nil { 6814 return nil, err 6815 } 6816 defer googleapi.CloseBody(res) 6817 if err := googleapi.CheckResponse(res); err != nil { 6818 return nil, err 6819 } 6820 ret := &EventUpdateResponse{ 6821 ServerResponse: googleapi.ServerResponse{ 6822 Header: res.Header, 6823 HTTPStatusCode: res.StatusCode, 6824 }, 6825 } 6826 target := &ret 6827 if err := gensupport.DecodeResponse(target, res); err != nil { 6828 return nil, err 6829 } 6830 return ret, nil 6831 // { 6832 // "description": "Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.", 6833 // "httpMethod": "POST", 6834 // "id": "games.events.record", 6835 // "parameters": { 6836 // "language": { 6837 // "description": "The preferred language to use for strings returned by this method.", 6838 // "location": "query", 6839 // "type": "string" 6840 // } 6841 // }, 6842 // "path": "events", 6843 // "request": { 6844 // "$ref": "EventRecordRequest" 6845 // }, 6846 // "response": { 6847 // "$ref": "EventUpdateResponse" 6848 // }, 6849 // "scopes": [ 6850 // "https://www.googleapis.com/auth/games" 6851 // ] 6852 // } 6853 6854} 6855 6856// method id "games.leaderboards.get": 6857 6858type LeaderboardsGetCall struct { 6859 s *Service 6860 leaderboardId string 6861 urlParams_ gensupport.URLParams 6862 ifNoneMatch_ string 6863 ctx_ context.Context 6864 header_ http.Header 6865} 6866 6867// Get: Retrieves the metadata of the leaderboard with the given ID. 6868func (r *LeaderboardsService) Get(leaderboardId string) *LeaderboardsGetCall { 6869 c := &LeaderboardsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6870 c.leaderboardId = leaderboardId 6871 return c 6872} 6873 6874// Language sets the optional parameter "language": The preferred 6875// language to use for strings returned by this method. 6876func (c *LeaderboardsGetCall) Language(language string) *LeaderboardsGetCall { 6877 c.urlParams_.Set("language", language) 6878 return c 6879} 6880 6881// Fields allows partial responses to be retrieved. See 6882// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6883// for more information. 6884func (c *LeaderboardsGetCall) Fields(s ...googleapi.Field) *LeaderboardsGetCall { 6885 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6886 return c 6887} 6888 6889// IfNoneMatch sets the optional parameter which makes the operation 6890// fail if the object's ETag matches the given value. This is useful for 6891// getting updates only after the object has changed since the last 6892// request. Use googleapi.IsNotModified to check whether the response 6893// error from Do is the result of In-None-Match. 6894func (c *LeaderboardsGetCall) IfNoneMatch(entityTag string) *LeaderboardsGetCall { 6895 c.ifNoneMatch_ = entityTag 6896 return c 6897} 6898 6899// Context sets the context to be used in this call's Do method. Any 6900// pending HTTP request will be aborted if the provided context is 6901// canceled. 6902func (c *LeaderboardsGetCall) Context(ctx context.Context) *LeaderboardsGetCall { 6903 c.ctx_ = ctx 6904 return c 6905} 6906 6907// Header returns an http.Header that can be modified by the caller to 6908// add HTTP headers to the request. 6909func (c *LeaderboardsGetCall) Header() http.Header { 6910 if c.header_ == nil { 6911 c.header_ = make(http.Header) 6912 } 6913 return c.header_ 6914} 6915 6916func (c *LeaderboardsGetCall) doRequest(alt string) (*http.Response, error) { 6917 reqHeaders := make(http.Header) 6918 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 6919 for k, v := range c.header_ { 6920 reqHeaders[k] = v 6921 } 6922 reqHeaders.Set("User-Agent", c.s.userAgent()) 6923 if c.ifNoneMatch_ != "" { 6924 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6925 } 6926 var body io.Reader = nil 6927 c.urlParams_.Set("alt", alt) 6928 c.urlParams_.Set("prettyPrint", "false") 6929 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}") 6930 urls += "?" + c.urlParams_.Encode() 6931 req, err := http.NewRequest("GET", urls, body) 6932 if err != nil { 6933 return nil, err 6934 } 6935 req.Header = reqHeaders 6936 googleapi.Expand(req.URL, map[string]string{ 6937 "leaderboardId": c.leaderboardId, 6938 }) 6939 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6940} 6941 6942// Do executes the "games.leaderboards.get" call. 6943// Exactly one of *Leaderboard or error will be non-nil. Any non-2xx 6944// status code is an error. Response headers are in either 6945// *Leaderboard.ServerResponse.Header or (if a response was returned at 6946// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6947// to check whether the returned error was because 6948// http.StatusNotModified was returned. 6949func (c *LeaderboardsGetCall) Do(opts ...googleapi.CallOption) (*Leaderboard, error) { 6950 gensupport.SetOptions(c.urlParams_, opts...) 6951 res, err := c.doRequest("json") 6952 if res != nil && res.StatusCode == http.StatusNotModified { 6953 if res.Body != nil { 6954 res.Body.Close() 6955 } 6956 return nil, &googleapi.Error{ 6957 Code: res.StatusCode, 6958 Header: res.Header, 6959 } 6960 } 6961 if err != nil { 6962 return nil, err 6963 } 6964 defer googleapi.CloseBody(res) 6965 if err := googleapi.CheckResponse(res); err != nil { 6966 return nil, err 6967 } 6968 ret := &Leaderboard{ 6969 ServerResponse: googleapi.ServerResponse{ 6970 Header: res.Header, 6971 HTTPStatusCode: res.StatusCode, 6972 }, 6973 } 6974 target := &ret 6975 if err := gensupport.DecodeResponse(target, res); err != nil { 6976 return nil, err 6977 } 6978 return ret, nil 6979 // { 6980 // "description": "Retrieves the metadata of the leaderboard with the given ID.", 6981 // "httpMethod": "GET", 6982 // "id": "games.leaderboards.get", 6983 // "parameterOrder": [ 6984 // "leaderboardId" 6985 // ], 6986 // "parameters": { 6987 // "language": { 6988 // "description": "The preferred language to use for strings returned by this method.", 6989 // "location": "query", 6990 // "type": "string" 6991 // }, 6992 // "leaderboardId": { 6993 // "description": "The ID of the leaderboard.", 6994 // "location": "path", 6995 // "required": true, 6996 // "type": "string" 6997 // } 6998 // }, 6999 // "path": "leaderboards/{leaderboardId}", 7000 // "response": { 7001 // "$ref": "Leaderboard" 7002 // }, 7003 // "scopes": [ 7004 // "https://www.googleapis.com/auth/games" 7005 // ] 7006 // } 7007 7008} 7009 7010// method id "games.leaderboards.list": 7011 7012type LeaderboardsListCall struct { 7013 s *Service 7014 urlParams_ gensupport.URLParams 7015 ifNoneMatch_ string 7016 ctx_ context.Context 7017 header_ http.Header 7018} 7019 7020// List: Lists all the leaderboard metadata for your application. 7021func (r *LeaderboardsService) List() *LeaderboardsListCall { 7022 c := &LeaderboardsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7023 return c 7024} 7025 7026// Language sets the optional parameter "language": The preferred 7027// language to use for strings returned by this method. 7028func (c *LeaderboardsListCall) Language(language string) *LeaderboardsListCall { 7029 c.urlParams_.Set("language", language) 7030 return c 7031} 7032 7033// MaxResults sets the optional parameter "maxResults": The maximum 7034// number of leaderboards to return in the response. For any response, 7035// the actual number of leaderboards returned may be less than the 7036// specified maxResults. 7037func (c *LeaderboardsListCall) MaxResults(maxResults int64) *LeaderboardsListCall { 7038 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7039 return c 7040} 7041 7042// PageToken sets the optional parameter "pageToken": The token returned 7043// by the previous request. 7044func (c *LeaderboardsListCall) PageToken(pageToken string) *LeaderboardsListCall { 7045 c.urlParams_.Set("pageToken", pageToken) 7046 return c 7047} 7048 7049// Fields allows partial responses to be retrieved. See 7050// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7051// for more information. 7052func (c *LeaderboardsListCall) Fields(s ...googleapi.Field) *LeaderboardsListCall { 7053 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7054 return c 7055} 7056 7057// IfNoneMatch sets the optional parameter which makes the operation 7058// fail if the object's ETag matches the given value. This is useful for 7059// getting updates only after the object has changed since the last 7060// request. Use googleapi.IsNotModified to check whether the response 7061// error from Do is the result of In-None-Match. 7062func (c *LeaderboardsListCall) IfNoneMatch(entityTag string) *LeaderboardsListCall { 7063 c.ifNoneMatch_ = entityTag 7064 return c 7065} 7066 7067// Context sets the context to be used in this call's Do method. Any 7068// pending HTTP request will be aborted if the provided context is 7069// canceled. 7070func (c *LeaderboardsListCall) Context(ctx context.Context) *LeaderboardsListCall { 7071 c.ctx_ = ctx 7072 return c 7073} 7074 7075// Header returns an http.Header that can be modified by the caller to 7076// add HTTP headers to the request. 7077func (c *LeaderboardsListCall) Header() http.Header { 7078 if c.header_ == nil { 7079 c.header_ = make(http.Header) 7080 } 7081 return c.header_ 7082} 7083 7084func (c *LeaderboardsListCall) doRequest(alt string) (*http.Response, error) { 7085 reqHeaders := make(http.Header) 7086 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7087 for k, v := range c.header_ { 7088 reqHeaders[k] = v 7089 } 7090 reqHeaders.Set("User-Agent", c.s.userAgent()) 7091 if c.ifNoneMatch_ != "" { 7092 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7093 } 7094 var body io.Reader = nil 7095 c.urlParams_.Set("alt", alt) 7096 c.urlParams_.Set("prettyPrint", "false") 7097 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards") 7098 urls += "?" + c.urlParams_.Encode() 7099 req, err := http.NewRequest("GET", urls, body) 7100 if err != nil { 7101 return nil, err 7102 } 7103 req.Header = reqHeaders 7104 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7105} 7106 7107// Do executes the "games.leaderboards.list" call. 7108// Exactly one of *LeaderboardListResponse or error will be non-nil. Any 7109// non-2xx status code is an error. Response headers are in either 7110// *LeaderboardListResponse.ServerResponse.Header or (if a response was 7111// returned at all) in error.(*googleapi.Error).Header. Use 7112// googleapi.IsNotModified to check whether the returned error was 7113// because http.StatusNotModified was returned. 7114func (c *LeaderboardsListCall) Do(opts ...googleapi.CallOption) (*LeaderboardListResponse, error) { 7115 gensupport.SetOptions(c.urlParams_, opts...) 7116 res, err := c.doRequest("json") 7117 if res != nil && res.StatusCode == http.StatusNotModified { 7118 if res.Body != nil { 7119 res.Body.Close() 7120 } 7121 return nil, &googleapi.Error{ 7122 Code: res.StatusCode, 7123 Header: res.Header, 7124 } 7125 } 7126 if err != nil { 7127 return nil, err 7128 } 7129 defer googleapi.CloseBody(res) 7130 if err := googleapi.CheckResponse(res); err != nil { 7131 return nil, err 7132 } 7133 ret := &LeaderboardListResponse{ 7134 ServerResponse: googleapi.ServerResponse{ 7135 Header: res.Header, 7136 HTTPStatusCode: res.StatusCode, 7137 }, 7138 } 7139 target := &ret 7140 if err := gensupport.DecodeResponse(target, res); err != nil { 7141 return nil, err 7142 } 7143 return ret, nil 7144 // { 7145 // "description": "Lists all the leaderboard metadata for your application.", 7146 // "httpMethod": "GET", 7147 // "id": "games.leaderboards.list", 7148 // "parameters": { 7149 // "language": { 7150 // "description": "The preferred language to use for strings returned by this method.", 7151 // "location": "query", 7152 // "type": "string" 7153 // }, 7154 // "maxResults": { 7155 // "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.", 7156 // "format": "int32", 7157 // "location": "query", 7158 // "maximum": "200", 7159 // "minimum": "1", 7160 // "type": "integer" 7161 // }, 7162 // "pageToken": { 7163 // "description": "The token returned by the previous request.", 7164 // "location": "query", 7165 // "type": "string" 7166 // } 7167 // }, 7168 // "path": "leaderboards", 7169 // "response": { 7170 // "$ref": "LeaderboardListResponse" 7171 // }, 7172 // "scopes": [ 7173 // "https://www.googleapis.com/auth/games" 7174 // ] 7175 // } 7176 7177} 7178 7179// Pages invokes f for each page of results. 7180// A non-nil error returned from f will halt the iteration. 7181// The provided context supersedes any context provided to the Context method. 7182func (c *LeaderboardsListCall) Pages(ctx context.Context, f func(*LeaderboardListResponse) error) error { 7183 c.ctx_ = ctx 7184 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7185 for { 7186 x, err := c.Do() 7187 if err != nil { 7188 return err 7189 } 7190 if err := f(x); err != nil { 7191 return err 7192 } 7193 if x.NextPageToken == "" { 7194 return nil 7195 } 7196 c.PageToken(x.NextPageToken) 7197 } 7198} 7199 7200// method id "games.metagame.getMetagameConfig": 7201 7202type MetagameGetMetagameConfigCall struct { 7203 s *Service 7204 urlParams_ gensupport.URLParams 7205 ifNoneMatch_ string 7206 ctx_ context.Context 7207 header_ http.Header 7208} 7209 7210// GetMetagameConfig: Return the metagame configuration data for the 7211// calling application. 7212func (r *MetagameService) GetMetagameConfig() *MetagameGetMetagameConfigCall { 7213 c := &MetagameGetMetagameConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7214 return c 7215} 7216 7217// Fields allows partial responses to be retrieved. See 7218// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7219// for more information. 7220func (c *MetagameGetMetagameConfigCall) Fields(s ...googleapi.Field) *MetagameGetMetagameConfigCall { 7221 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7222 return c 7223} 7224 7225// IfNoneMatch sets the optional parameter which makes the operation 7226// fail if the object's ETag matches the given value. This is useful for 7227// getting updates only after the object has changed since the last 7228// request. Use googleapi.IsNotModified to check whether the response 7229// error from Do is the result of In-None-Match. 7230func (c *MetagameGetMetagameConfigCall) IfNoneMatch(entityTag string) *MetagameGetMetagameConfigCall { 7231 c.ifNoneMatch_ = entityTag 7232 return c 7233} 7234 7235// Context sets the context to be used in this call's Do method. Any 7236// pending HTTP request will be aborted if the provided context is 7237// canceled. 7238func (c *MetagameGetMetagameConfigCall) Context(ctx context.Context) *MetagameGetMetagameConfigCall { 7239 c.ctx_ = ctx 7240 return c 7241} 7242 7243// Header returns an http.Header that can be modified by the caller to 7244// add HTTP headers to the request. 7245func (c *MetagameGetMetagameConfigCall) Header() http.Header { 7246 if c.header_ == nil { 7247 c.header_ = make(http.Header) 7248 } 7249 return c.header_ 7250} 7251 7252func (c *MetagameGetMetagameConfigCall) doRequest(alt string) (*http.Response, error) { 7253 reqHeaders := make(http.Header) 7254 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7255 for k, v := range c.header_ { 7256 reqHeaders[k] = v 7257 } 7258 reqHeaders.Set("User-Agent", c.s.userAgent()) 7259 if c.ifNoneMatch_ != "" { 7260 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7261 } 7262 var body io.Reader = nil 7263 c.urlParams_.Set("alt", alt) 7264 c.urlParams_.Set("prettyPrint", "false") 7265 urls := googleapi.ResolveRelative(c.s.BasePath, "metagameConfig") 7266 urls += "?" + c.urlParams_.Encode() 7267 req, err := http.NewRequest("GET", urls, body) 7268 if err != nil { 7269 return nil, err 7270 } 7271 req.Header = reqHeaders 7272 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7273} 7274 7275// Do executes the "games.metagame.getMetagameConfig" call. 7276// Exactly one of *MetagameConfig or error will be non-nil. Any non-2xx 7277// status code is an error. Response headers are in either 7278// *MetagameConfig.ServerResponse.Header or (if a response was returned 7279// at all) in error.(*googleapi.Error).Header. Use 7280// googleapi.IsNotModified to check whether the returned error was 7281// because http.StatusNotModified was returned. 7282func (c *MetagameGetMetagameConfigCall) Do(opts ...googleapi.CallOption) (*MetagameConfig, error) { 7283 gensupport.SetOptions(c.urlParams_, opts...) 7284 res, err := c.doRequest("json") 7285 if res != nil && res.StatusCode == http.StatusNotModified { 7286 if res.Body != nil { 7287 res.Body.Close() 7288 } 7289 return nil, &googleapi.Error{ 7290 Code: res.StatusCode, 7291 Header: res.Header, 7292 } 7293 } 7294 if err != nil { 7295 return nil, err 7296 } 7297 defer googleapi.CloseBody(res) 7298 if err := googleapi.CheckResponse(res); err != nil { 7299 return nil, err 7300 } 7301 ret := &MetagameConfig{ 7302 ServerResponse: googleapi.ServerResponse{ 7303 Header: res.Header, 7304 HTTPStatusCode: res.StatusCode, 7305 }, 7306 } 7307 target := &ret 7308 if err := gensupport.DecodeResponse(target, res); err != nil { 7309 return nil, err 7310 } 7311 return ret, nil 7312 // { 7313 // "description": "Return the metagame configuration data for the calling application.", 7314 // "httpMethod": "GET", 7315 // "id": "games.metagame.getMetagameConfig", 7316 // "path": "metagameConfig", 7317 // "response": { 7318 // "$ref": "MetagameConfig" 7319 // }, 7320 // "scopes": [ 7321 // "https://www.googleapis.com/auth/games" 7322 // ] 7323 // } 7324 7325} 7326 7327// method id "games.metagame.listCategoriesByPlayer": 7328 7329type MetagameListCategoriesByPlayerCall struct { 7330 s *Service 7331 playerId string 7332 collection string 7333 urlParams_ gensupport.URLParams 7334 ifNoneMatch_ string 7335 ctx_ context.Context 7336 header_ http.Header 7337} 7338 7339// ListCategoriesByPlayer: List play data aggregated per category for 7340// the player corresponding to playerId. 7341func (r *MetagameService) ListCategoriesByPlayer(playerId string, collection string) *MetagameListCategoriesByPlayerCall { 7342 c := &MetagameListCategoriesByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7343 c.playerId = playerId 7344 c.collection = collection 7345 return c 7346} 7347 7348// Language sets the optional parameter "language": The preferred 7349// language to use for strings returned by this method. 7350func (c *MetagameListCategoriesByPlayerCall) Language(language string) *MetagameListCategoriesByPlayerCall { 7351 c.urlParams_.Set("language", language) 7352 return c 7353} 7354 7355// MaxResults sets the optional parameter "maxResults": The maximum 7356// number of category resources to return in the response, used for 7357// paging. For any response, the actual number of category resources 7358// returned may be less than the specified maxResults. 7359func (c *MetagameListCategoriesByPlayerCall) MaxResults(maxResults int64) *MetagameListCategoriesByPlayerCall { 7360 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7361 return c 7362} 7363 7364// PageToken sets the optional parameter "pageToken": The token returned 7365// by the previous request. 7366func (c *MetagameListCategoriesByPlayerCall) PageToken(pageToken string) *MetagameListCategoriesByPlayerCall { 7367 c.urlParams_.Set("pageToken", pageToken) 7368 return c 7369} 7370 7371// Fields allows partial responses to be retrieved. See 7372// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7373// for more information. 7374func (c *MetagameListCategoriesByPlayerCall) Fields(s ...googleapi.Field) *MetagameListCategoriesByPlayerCall { 7375 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7376 return c 7377} 7378 7379// IfNoneMatch sets the optional parameter which makes the operation 7380// fail if the object's ETag matches the given value. This is useful for 7381// getting updates only after the object has changed since the last 7382// request. Use googleapi.IsNotModified to check whether the response 7383// error from Do is the result of In-None-Match. 7384func (c *MetagameListCategoriesByPlayerCall) IfNoneMatch(entityTag string) *MetagameListCategoriesByPlayerCall { 7385 c.ifNoneMatch_ = entityTag 7386 return c 7387} 7388 7389// Context sets the context to be used in this call's Do method. Any 7390// pending HTTP request will be aborted if the provided context is 7391// canceled. 7392func (c *MetagameListCategoriesByPlayerCall) Context(ctx context.Context) *MetagameListCategoriesByPlayerCall { 7393 c.ctx_ = ctx 7394 return c 7395} 7396 7397// Header returns an http.Header that can be modified by the caller to 7398// add HTTP headers to the request. 7399func (c *MetagameListCategoriesByPlayerCall) Header() http.Header { 7400 if c.header_ == nil { 7401 c.header_ = make(http.Header) 7402 } 7403 return c.header_ 7404} 7405 7406func (c *MetagameListCategoriesByPlayerCall) doRequest(alt string) (*http.Response, error) { 7407 reqHeaders := make(http.Header) 7408 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7409 for k, v := range c.header_ { 7410 reqHeaders[k] = v 7411 } 7412 reqHeaders.Set("User-Agent", c.s.userAgent()) 7413 if c.ifNoneMatch_ != "" { 7414 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7415 } 7416 var body io.Reader = nil 7417 c.urlParams_.Set("alt", alt) 7418 c.urlParams_.Set("prettyPrint", "false") 7419 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/categories/{collection}") 7420 urls += "?" + c.urlParams_.Encode() 7421 req, err := http.NewRequest("GET", urls, body) 7422 if err != nil { 7423 return nil, err 7424 } 7425 req.Header = reqHeaders 7426 googleapi.Expand(req.URL, map[string]string{ 7427 "playerId": c.playerId, 7428 "collection": c.collection, 7429 }) 7430 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7431} 7432 7433// Do executes the "games.metagame.listCategoriesByPlayer" call. 7434// Exactly one of *CategoryListResponse or error will be non-nil. Any 7435// non-2xx status code is an error. Response headers are in either 7436// *CategoryListResponse.ServerResponse.Header or (if a response was 7437// returned at all) in error.(*googleapi.Error).Header. Use 7438// googleapi.IsNotModified to check whether the returned error was 7439// because http.StatusNotModified was returned. 7440func (c *MetagameListCategoriesByPlayerCall) Do(opts ...googleapi.CallOption) (*CategoryListResponse, error) { 7441 gensupport.SetOptions(c.urlParams_, opts...) 7442 res, err := c.doRequest("json") 7443 if res != nil && res.StatusCode == http.StatusNotModified { 7444 if res.Body != nil { 7445 res.Body.Close() 7446 } 7447 return nil, &googleapi.Error{ 7448 Code: res.StatusCode, 7449 Header: res.Header, 7450 } 7451 } 7452 if err != nil { 7453 return nil, err 7454 } 7455 defer googleapi.CloseBody(res) 7456 if err := googleapi.CheckResponse(res); err != nil { 7457 return nil, err 7458 } 7459 ret := &CategoryListResponse{ 7460 ServerResponse: googleapi.ServerResponse{ 7461 Header: res.Header, 7462 HTTPStatusCode: res.StatusCode, 7463 }, 7464 } 7465 target := &ret 7466 if err := gensupport.DecodeResponse(target, res); err != nil { 7467 return nil, err 7468 } 7469 return ret, nil 7470 // { 7471 // "description": "List play data aggregated per category for the player corresponding to playerId.", 7472 // "httpMethod": "GET", 7473 // "id": "games.metagame.listCategoriesByPlayer", 7474 // "parameterOrder": [ 7475 // "playerId", 7476 // "collection" 7477 // ], 7478 // "parameters": { 7479 // "collection": { 7480 // "description": "The collection of categories for which data will be returned.", 7481 // "enum": [ 7482 // "all" 7483 // ], 7484 // "enumDescriptions": [ 7485 // "Retrieve data for all categories. This is the default." 7486 // ], 7487 // "location": "path", 7488 // "required": true, 7489 // "type": "string" 7490 // }, 7491 // "language": { 7492 // "description": "The preferred language to use for strings returned by this method.", 7493 // "location": "query", 7494 // "type": "string" 7495 // }, 7496 // "maxResults": { 7497 // "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.", 7498 // "format": "int32", 7499 // "location": "query", 7500 // "maximum": "100", 7501 // "minimum": "1", 7502 // "type": "integer" 7503 // }, 7504 // "pageToken": { 7505 // "description": "The token returned by the previous request.", 7506 // "location": "query", 7507 // "type": "string" 7508 // }, 7509 // "playerId": { 7510 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 7511 // "location": "path", 7512 // "required": true, 7513 // "type": "string" 7514 // } 7515 // }, 7516 // "path": "players/{playerId}/categories/{collection}", 7517 // "response": { 7518 // "$ref": "CategoryListResponse" 7519 // }, 7520 // "scopes": [ 7521 // "https://www.googleapis.com/auth/games" 7522 // ] 7523 // } 7524 7525} 7526 7527// Pages invokes f for each page of results. 7528// A non-nil error returned from f will halt the iteration. 7529// The provided context supersedes any context provided to the Context method. 7530func (c *MetagameListCategoriesByPlayerCall) Pages(ctx context.Context, f func(*CategoryListResponse) error) error { 7531 c.ctx_ = ctx 7532 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7533 for { 7534 x, err := c.Do() 7535 if err != nil { 7536 return err 7537 } 7538 if err := f(x); err != nil { 7539 return err 7540 } 7541 if x.NextPageToken == "" { 7542 return nil 7543 } 7544 c.PageToken(x.NextPageToken) 7545 } 7546} 7547 7548// method id "games.players.get": 7549 7550type PlayersGetCall struct { 7551 s *Service 7552 playerId string 7553 urlParams_ gensupport.URLParams 7554 ifNoneMatch_ string 7555 ctx_ context.Context 7556 header_ http.Header 7557} 7558 7559// Get: Retrieves the Player resource with the given ID. To retrieve the 7560// player for the currently authenticated user, set playerId to me. 7561func (r *PlayersService) Get(playerId string) *PlayersGetCall { 7562 c := &PlayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7563 c.playerId = playerId 7564 return c 7565} 7566 7567// Language sets the optional parameter "language": The preferred 7568// language to use for strings returned by this method. 7569func (c *PlayersGetCall) Language(language string) *PlayersGetCall { 7570 c.urlParams_.Set("language", language) 7571 return c 7572} 7573 7574// Fields allows partial responses to be retrieved. See 7575// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7576// for more information. 7577func (c *PlayersGetCall) Fields(s ...googleapi.Field) *PlayersGetCall { 7578 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7579 return c 7580} 7581 7582// IfNoneMatch sets the optional parameter which makes the operation 7583// fail if the object's ETag matches the given value. This is useful for 7584// getting updates only after the object has changed since the last 7585// request. Use googleapi.IsNotModified to check whether the response 7586// error from Do is the result of In-None-Match. 7587func (c *PlayersGetCall) IfNoneMatch(entityTag string) *PlayersGetCall { 7588 c.ifNoneMatch_ = entityTag 7589 return c 7590} 7591 7592// Context sets the context to be used in this call's Do method. Any 7593// pending HTTP request will be aborted if the provided context is 7594// canceled. 7595func (c *PlayersGetCall) Context(ctx context.Context) *PlayersGetCall { 7596 c.ctx_ = ctx 7597 return c 7598} 7599 7600// Header returns an http.Header that can be modified by the caller to 7601// add HTTP headers to the request. 7602func (c *PlayersGetCall) Header() http.Header { 7603 if c.header_ == nil { 7604 c.header_ = make(http.Header) 7605 } 7606 return c.header_ 7607} 7608 7609func (c *PlayersGetCall) doRequest(alt string) (*http.Response, error) { 7610 reqHeaders := make(http.Header) 7611 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7612 for k, v := range c.header_ { 7613 reqHeaders[k] = v 7614 } 7615 reqHeaders.Set("User-Agent", c.s.userAgent()) 7616 if c.ifNoneMatch_ != "" { 7617 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7618 } 7619 var body io.Reader = nil 7620 c.urlParams_.Set("alt", alt) 7621 c.urlParams_.Set("prettyPrint", "false") 7622 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}") 7623 urls += "?" + c.urlParams_.Encode() 7624 req, err := http.NewRequest("GET", urls, body) 7625 if err != nil { 7626 return nil, err 7627 } 7628 req.Header = reqHeaders 7629 googleapi.Expand(req.URL, map[string]string{ 7630 "playerId": c.playerId, 7631 }) 7632 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7633} 7634 7635// Do executes the "games.players.get" call. 7636// Exactly one of *Player or error will be non-nil. Any non-2xx status 7637// code is an error. Response headers are in either 7638// *Player.ServerResponse.Header or (if a response was returned at all) 7639// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7640// check whether the returned error was because http.StatusNotModified 7641// was returned. 7642func (c *PlayersGetCall) Do(opts ...googleapi.CallOption) (*Player, error) { 7643 gensupport.SetOptions(c.urlParams_, opts...) 7644 res, err := c.doRequest("json") 7645 if res != nil && res.StatusCode == http.StatusNotModified { 7646 if res.Body != nil { 7647 res.Body.Close() 7648 } 7649 return nil, &googleapi.Error{ 7650 Code: res.StatusCode, 7651 Header: res.Header, 7652 } 7653 } 7654 if err != nil { 7655 return nil, err 7656 } 7657 defer googleapi.CloseBody(res) 7658 if err := googleapi.CheckResponse(res); err != nil { 7659 return nil, err 7660 } 7661 ret := &Player{ 7662 ServerResponse: googleapi.ServerResponse{ 7663 Header: res.Header, 7664 HTTPStatusCode: res.StatusCode, 7665 }, 7666 } 7667 target := &ret 7668 if err := gensupport.DecodeResponse(target, res); err != nil { 7669 return nil, err 7670 } 7671 return ret, nil 7672 // { 7673 // "description": "Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.", 7674 // "httpMethod": "GET", 7675 // "id": "games.players.get", 7676 // "parameterOrder": [ 7677 // "playerId" 7678 // ], 7679 // "parameters": { 7680 // "language": { 7681 // "description": "The preferred language to use for strings returned by this method.", 7682 // "location": "query", 7683 // "type": "string" 7684 // }, 7685 // "playerId": { 7686 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 7687 // "location": "path", 7688 // "required": true, 7689 // "type": "string" 7690 // } 7691 // }, 7692 // "path": "players/{playerId}", 7693 // "response": { 7694 // "$ref": "Player" 7695 // }, 7696 // "scopes": [ 7697 // "https://www.googleapis.com/auth/games" 7698 // ] 7699 // } 7700 7701} 7702 7703// method id "games.players.list": 7704 7705type PlayersListCall struct { 7706 s *Service 7707 collection string 7708 urlParams_ gensupport.URLParams 7709 ifNoneMatch_ string 7710 ctx_ context.Context 7711 header_ http.Header 7712} 7713 7714// List: Get the collection of players for the currently authenticated 7715// user. 7716func (r *PlayersService) List(collection string) *PlayersListCall { 7717 c := &PlayersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7718 c.collection = collection 7719 return c 7720} 7721 7722// Language sets the optional parameter "language": The preferred 7723// language to use for strings returned by this method. 7724func (c *PlayersListCall) Language(language string) *PlayersListCall { 7725 c.urlParams_.Set("language", language) 7726 return c 7727} 7728 7729// MaxResults sets the optional parameter "maxResults": The maximum 7730// number of player resources to return in the response, used for 7731// paging. For any response, the actual number of player resources 7732// returned may be less than the specified maxResults. 7733func (c *PlayersListCall) MaxResults(maxResults int64) *PlayersListCall { 7734 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7735 return c 7736} 7737 7738// PageToken sets the optional parameter "pageToken": The token returned 7739// by the previous request. 7740func (c *PlayersListCall) PageToken(pageToken string) *PlayersListCall { 7741 c.urlParams_.Set("pageToken", pageToken) 7742 return c 7743} 7744 7745// Fields allows partial responses to be retrieved. See 7746// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7747// for more information. 7748func (c *PlayersListCall) Fields(s ...googleapi.Field) *PlayersListCall { 7749 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7750 return c 7751} 7752 7753// IfNoneMatch sets the optional parameter which makes the operation 7754// fail if the object's ETag matches the given value. This is useful for 7755// getting updates only after the object has changed since the last 7756// request. Use googleapi.IsNotModified to check whether the response 7757// error from Do is the result of In-None-Match. 7758func (c *PlayersListCall) IfNoneMatch(entityTag string) *PlayersListCall { 7759 c.ifNoneMatch_ = entityTag 7760 return c 7761} 7762 7763// Context sets the context to be used in this call's Do method. Any 7764// pending HTTP request will be aborted if the provided context is 7765// canceled. 7766func (c *PlayersListCall) Context(ctx context.Context) *PlayersListCall { 7767 c.ctx_ = ctx 7768 return c 7769} 7770 7771// Header returns an http.Header that can be modified by the caller to 7772// add HTTP headers to the request. 7773func (c *PlayersListCall) Header() http.Header { 7774 if c.header_ == nil { 7775 c.header_ = make(http.Header) 7776 } 7777 return c.header_ 7778} 7779 7780func (c *PlayersListCall) doRequest(alt string) (*http.Response, error) { 7781 reqHeaders := make(http.Header) 7782 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7783 for k, v := range c.header_ { 7784 reqHeaders[k] = v 7785 } 7786 reqHeaders.Set("User-Agent", c.s.userAgent()) 7787 if c.ifNoneMatch_ != "" { 7788 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7789 } 7790 var body io.Reader = nil 7791 c.urlParams_.Set("alt", alt) 7792 c.urlParams_.Set("prettyPrint", "false") 7793 urls := googleapi.ResolveRelative(c.s.BasePath, "players/me/players/{collection}") 7794 urls += "?" + c.urlParams_.Encode() 7795 req, err := http.NewRequest("GET", urls, body) 7796 if err != nil { 7797 return nil, err 7798 } 7799 req.Header = reqHeaders 7800 googleapi.Expand(req.URL, map[string]string{ 7801 "collection": c.collection, 7802 }) 7803 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7804} 7805 7806// Do executes the "games.players.list" call. 7807// Exactly one of *PlayerListResponse or error will be non-nil. Any 7808// non-2xx status code is an error. Response headers are in either 7809// *PlayerListResponse.ServerResponse.Header or (if a response was 7810// returned at all) in error.(*googleapi.Error).Header. Use 7811// googleapi.IsNotModified to check whether the returned error was 7812// because http.StatusNotModified was returned. 7813func (c *PlayersListCall) Do(opts ...googleapi.CallOption) (*PlayerListResponse, error) { 7814 gensupport.SetOptions(c.urlParams_, opts...) 7815 res, err := c.doRequest("json") 7816 if res != nil && res.StatusCode == http.StatusNotModified { 7817 if res.Body != nil { 7818 res.Body.Close() 7819 } 7820 return nil, &googleapi.Error{ 7821 Code: res.StatusCode, 7822 Header: res.Header, 7823 } 7824 } 7825 if err != nil { 7826 return nil, err 7827 } 7828 defer googleapi.CloseBody(res) 7829 if err := googleapi.CheckResponse(res); err != nil { 7830 return nil, err 7831 } 7832 ret := &PlayerListResponse{ 7833 ServerResponse: googleapi.ServerResponse{ 7834 Header: res.Header, 7835 HTTPStatusCode: res.StatusCode, 7836 }, 7837 } 7838 target := &ret 7839 if err := gensupport.DecodeResponse(target, res); err != nil { 7840 return nil, err 7841 } 7842 return ret, nil 7843 // { 7844 // "description": "Get the collection of players for the currently authenticated user.", 7845 // "httpMethod": "GET", 7846 // "id": "games.players.list", 7847 // "parameterOrder": [ 7848 // "collection" 7849 // ], 7850 // "parameters": { 7851 // "collection": { 7852 // "description": "Collection of players being retrieved", 7853 // "enum": [ 7854 // "connected", 7855 // "playedWith", 7856 // "played_with", 7857 // "visible" 7858 // ], 7859 // "enumDescriptions": [ 7860 // "Retrieve a list of players that are also playing this game in reverse chronological order.", 7861 // "(DEPRECATED: please use played_with!) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.", 7862 // "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.", 7863 // "Retrieve a list of players in the user's social graph that are visible to this game." 7864 // ], 7865 // "location": "path", 7866 // "required": true, 7867 // "type": "string" 7868 // }, 7869 // "language": { 7870 // "description": "The preferred language to use for strings returned by this method.", 7871 // "location": "query", 7872 // "type": "string" 7873 // }, 7874 // "maxResults": { 7875 // "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.", 7876 // "format": "int32", 7877 // "location": "query", 7878 // "maximum": "50", 7879 // "minimum": "1", 7880 // "type": "integer" 7881 // }, 7882 // "pageToken": { 7883 // "description": "The token returned by the previous request.", 7884 // "location": "query", 7885 // "type": "string" 7886 // } 7887 // }, 7888 // "path": "players/me/players/{collection}", 7889 // "response": { 7890 // "$ref": "PlayerListResponse" 7891 // }, 7892 // "scopes": [ 7893 // "https://www.googleapis.com/auth/games" 7894 // ] 7895 // } 7896 7897} 7898 7899// Pages invokes f for each page of results. 7900// A non-nil error returned from f will halt the iteration. 7901// The provided context supersedes any context provided to the Context method. 7902func (c *PlayersListCall) Pages(ctx context.Context, f func(*PlayerListResponse) error) error { 7903 c.ctx_ = ctx 7904 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7905 for { 7906 x, err := c.Do() 7907 if err != nil { 7908 return err 7909 } 7910 if err := f(x); err != nil { 7911 return err 7912 } 7913 if x.NextPageToken == "" { 7914 return nil 7915 } 7916 c.PageToken(x.NextPageToken) 7917 } 7918} 7919 7920// method id "games.pushtokens.remove": 7921 7922type PushtokensRemoveCall struct { 7923 s *Service 7924 pushtokenid *PushTokenId 7925 urlParams_ gensupport.URLParams 7926 ctx_ context.Context 7927 header_ http.Header 7928} 7929 7930// Remove: Removes a push token for the current user and application. 7931// Removing a non-existent push token will report success. 7932func (r *PushtokensService) Remove(pushtokenid *PushTokenId) *PushtokensRemoveCall { 7933 c := &PushtokensRemoveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7934 c.pushtokenid = pushtokenid 7935 return c 7936} 7937 7938// Fields allows partial responses to be retrieved. See 7939// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7940// for more information. 7941func (c *PushtokensRemoveCall) Fields(s ...googleapi.Field) *PushtokensRemoveCall { 7942 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7943 return c 7944} 7945 7946// Context sets the context to be used in this call's Do method. Any 7947// pending HTTP request will be aborted if the provided context is 7948// canceled. 7949func (c *PushtokensRemoveCall) Context(ctx context.Context) *PushtokensRemoveCall { 7950 c.ctx_ = ctx 7951 return c 7952} 7953 7954// Header returns an http.Header that can be modified by the caller to 7955// add HTTP headers to the request. 7956func (c *PushtokensRemoveCall) Header() http.Header { 7957 if c.header_ == nil { 7958 c.header_ = make(http.Header) 7959 } 7960 return c.header_ 7961} 7962 7963func (c *PushtokensRemoveCall) doRequest(alt string) (*http.Response, error) { 7964 reqHeaders := make(http.Header) 7965 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 7966 for k, v := range c.header_ { 7967 reqHeaders[k] = v 7968 } 7969 reqHeaders.Set("User-Agent", c.s.userAgent()) 7970 var body io.Reader = nil 7971 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtokenid) 7972 if err != nil { 7973 return nil, err 7974 } 7975 reqHeaders.Set("Content-Type", "application/json") 7976 c.urlParams_.Set("alt", alt) 7977 c.urlParams_.Set("prettyPrint", "false") 7978 urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens/remove") 7979 urls += "?" + c.urlParams_.Encode() 7980 req, err := http.NewRequest("POST", urls, body) 7981 if err != nil { 7982 return nil, err 7983 } 7984 req.Header = reqHeaders 7985 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7986} 7987 7988// Do executes the "games.pushtokens.remove" call. 7989func (c *PushtokensRemoveCall) Do(opts ...googleapi.CallOption) error { 7990 gensupport.SetOptions(c.urlParams_, opts...) 7991 res, err := c.doRequest("json") 7992 if err != nil { 7993 return err 7994 } 7995 defer googleapi.CloseBody(res) 7996 if err := googleapi.CheckResponse(res); err != nil { 7997 return err 7998 } 7999 return nil 8000 // { 8001 // "description": "Removes a push token for the current user and application. Removing a non-existent push token will report success.", 8002 // "httpMethod": "POST", 8003 // "id": "games.pushtokens.remove", 8004 // "path": "pushtokens/remove", 8005 // "request": { 8006 // "$ref": "PushTokenId" 8007 // }, 8008 // "scopes": [ 8009 // "https://www.googleapis.com/auth/games" 8010 // ] 8011 // } 8012 8013} 8014 8015// method id "games.pushtokens.update": 8016 8017type PushtokensUpdateCall struct { 8018 s *Service 8019 pushtoken *PushToken 8020 urlParams_ gensupport.URLParams 8021 ctx_ context.Context 8022 header_ http.Header 8023} 8024 8025// Update: Registers a push token for the current user and application. 8026func (r *PushtokensService) Update(pushtoken *PushToken) *PushtokensUpdateCall { 8027 c := &PushtokensUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8028 c.pushtoken = pushtoken 8029 return c 8030} 8031 8032// Fields allows partial responses to be retrieved. See 8033// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8034// for more information. 8035func (c *PushtokensUpdateCall) Fields(s ...googleapi.Field) *PushtokensUpdateCall { 8036 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8037 return c 8038} 8039 8040// Context sets the context to be used in this call's Do method. Any 8041// pending HTTP request will be aborted if the provided context is 8042// canceled. 8043func (c *PushtokensUpdateCall) Context(ctx context.Context) *PushtokensUpdateCall { 8044 c.ctx_ = ctx 8045 return c 8046} 8047 8048// Header returns an http.Header that can be modified by the caller to 8049// add HTTP headers to the request. 8050func (c *PushtokensUpdateCall) Header() http.Header { 8051 if c.header_ == nil { 8052 c.header_ = make(http.Header) 8053 } 8054 return c.header_ 8055} 8056 8057func (c *PushtokensUpdateCall) doRequest(alt string) (*http.Response, error) { 8058 reqHeaders := make(http.Header) 8059 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 8060 for k, v := range c.header_ { 8061 reqHeaders[k] = v 8062 } 8063 reqHeaders.Set("User-Agent", c.s.userAgent()) 8064 var body io.Reader = nil 8065 body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtoken) 8066 if err != nil { 8067 return nil, err 8068 } 8069 reqHeaders.Set("Content-Type", "application/json") 8070 c.urlParams_.Set("alt", alt) 8071 c.urlParams_.Set("prettyPrint", "false") 8072 urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens") 8073 urls += "?" + c.urlParams_.Encode() 8074 req, err := http.NewRequest("PUT", urls, body) 8075 if err != nil { 8076 return nil, err 8077 } 8078 req.Header = reqHeaders 8079 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8080} 8081 8082// Do executes the "games.pushtokens.update" call. 8083func (c *PushtokensUpdateCall) Do(opts ...googleapi.CallOption) error { 8084 gensupport.SetOptions(c.urlParams_, opts...) 8085 res, err := c.doRequest("json") 8086 if err != nil { 8087 return err 8088 } 8089 defer googleapi.CloseBody(res) 8090 if err := googleapi.CheckResponse(res); err != nil { 8091 return err 8092 } 8093 return nil 8094 // { 8095 // "description": "Registers a push token for the current user and application.", 8096 // "httpMethod": "PUT", 8097 // "id": "games.pushtokens.update", 8098 // "path": "pushtokens", 8099 // "request": { 8100 // "$ref": "PushToken" 8101 // }, 8102 // "scopes": [ 8103 // "https://www.googleapis.com/auth/games" 8104 // ] 8105 // } 8106 8107} 8108 8109// method id "games.revisions.check": 8110 8111type RevisionsCheckCall struct { 8112 s *Service 8113 urlParams_ gensupport.URLParams 8114 ifNoneMatch_ string 8115 ctx_ context.Context 8116 header_ http.Header 8117} 8118 8119// Check: Checks whether the games client is out of date. 8120func (r *RevisionsService) Check(clientRevision string) *RevisionsCheckCall { 8121 c := &RevisionsCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8122 c.urlParams_.Set("clientRevision", clientRevision) 8123 return c 8124} 8125 8126// Fields allows partial responses to be retrieved. See 8127// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8128// for more information. 8129func (c *RevisionsCheckCall) Fields(s ...googleapi.Field) *RevisionsCheckCall { 8130 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8131 return c 8132} 8133 8134// IfNoneMatch sets the optional parameter which makes the operation 8135// fail if the object's ETag matches the given value. This is useful for 8136// getting updates only after the object has changed since the last 8137// request. Use googleapi.IsNotModified to check whether the response 8138// error from Do is the result of In-None-Match. 8139func (c *RevisionsCheckCall) IfNoneMatch(entityTag string) *RevisionsCheckCall { 8140 c.ifNoneMatch_ = entityTag 8141 return c 8142} 8143 8144// Context sets the context to be used in this call's Do method. Any 8145// pending HTTP request will be aborted if the provided context is 8146// canceled. 8147func (c *RevisionsCheckCall) Context(ctx context.Context) *RevisionsCheckCall { 8148 c.ctx_ = ctx 8149 return c 8150} 8151 8152// Header returns an http.Header that can be modified by the caller to 8153// add HTTP headers to the request. 8154func (c *RevisionsCheckCall) Header() http.Header { 8155 if c.header_ == nil { 8156 c.header_ = make(http.Header) 8157 } 8158 return c.header_ 8159} 8160 8161func (c *RevisionsCheckCall) doRequest(alt string) (*http.Response, error) { 8162 reqHeaders := make(http.Header) 8163 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 8164 for k, v := range c.header_ { 8165 reqHeaders[k] = v 8166 } 8167 reqHeaders.Set("User-Agent", c.s.userAgent()) 8168 if c.ifNoneMatch_ != "" { 8169 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8170 } 8171 var body io.Reader = nil 8172 c.urlParams_.Set("alt", alt) 8173 c.urlParams_.Set("prettyPrint", "false") 8174 urls := googleapi.ResolveRelative(c.s.BasePath, "revisions/check") 8175 urls += "?" + c.urlParams_.Encode() 8176 req, err := http.NewRequest("GET", urls, body) 8177 if err != nil { 8178 return nil, err 8179 } 8180 req.Header = reqHeaders 8181 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8182} 8183 8184// Do executes the "games.revisions.check" call. 8185// Exactly one of *RevisionCheckResponse or error will be non-nil. Any 8186// non-2xx status code is an error. Response headers are in either 8187// *RevisionCheckResponse.ServerResponse.Header or (if a response was 8188// returned at all) in error.(*googleapi.Error).Header. Use 8189// googleapi.IsNotModified to check whether the returned error was 8190// because http.StatusNotModified was returned. 8191func (c *RevisionsCheckCall) Do(opts ...googleapi.CallOption) (*RevisionCheckResponse, error) { 8192 gensupport.SetOptions(c.urlParams_, opts...) 8193 res, err := c.doRequest("json") 8194 if res != nil && res.StatusCode == http.StatusNotModified { 8195 if res.Body != nil { 8196 res.Body.Close() 8197 } 8198 return nil, &googleapi.Error{ 8199 Code: res.StatusCode, 8200 Header: res.Header, 8201 } 8202 } 8203 if err != nil { 8204 return nil, err 8205 } 8206 defer googleapi.CloseBody(res) 8207 if err := googleapi.CheckResponse(res); err != nil { 8208 return nil, err 8209 } 8210 ret := &RevisionCheckResponse{ 8211 ServerResponse: googleapi.ServerResponse{ 8212 Header: res.Header, 8213 HTTPStatusCode: res.StatusCode, 8214 }, 8215 } 8216 target := &ret 8217 if err := gensupport.DecodeResponse(target, res); err != nil { 8218 return nil, err 8219 } 8220 return ret, nil 8221 // { 8222 // "description": "Checks whether the games client is out of date.", 8223 // "httpMethod": "GET", 8224 // "id": "games.revisions.check", 8225 // "parameterOrder": [ 8226 // "clientRevision" 8227 // ], 8228 // "parameters": { 8229 // "clientRevision": { 8230 // "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.", 8231 // "location": "query", 8232 // "required": true, 8233 // "type": "string" 8234 // } 8235 // }, 8236 // "path": "revisions/check", 8237 // "response": { 8238 // "$ref": "RevisionCheckResponse" 8239 // }, 8240 // "scopes": [ 8241 // "https://www.googleapis.com/auth/games" 8242 // ] 8243 // } 8244 8245} 8246 8247// method id "games.rooms.create": 8248 8249type RoomsCreateCall struct { 8250 s *Service 8251 roomcreaterequest *RoomCreateRequest 8252 urlParams_ gensupport.URLParams 8253 ctx_ context.Context 8254 header_ http.Header 8255} 8256 8257// Create: Create a room. For internal use by the Games SDK only. 8258// Calling this method directly is unsupported. 8259func (r *RoomsService) Create(roomcreaterequest *RoomCreateRequest) *RoomsCreateCall { 8260 c := &RoomsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8261 c.roomcreaterequest = roomcreaterequest 8262 return c 8263} 8264 8265// Language sets the optional parameter "language": The preferred 8266// language to use for strings returned by this method. 8267func (c *RoomsCreateCall) Language(language string) *RoomsCreateCall { 8268 c.urlParams_.Set("language", language) 8269 return c 8270} 8271 8272// Fields allows partial responses to be retrieved. See 8273// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8274// for more information. 8275func (c *RoomsCreateCall) Fields(s ...googleapi.Field) *RoomsCreateCall { 8276 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8277 return c 8278} 8279 8280// Context sets the context to be used in this call's Do method. Any 8281// pending HTTP request will be aborted if the provided context is 8282// canceled. 8283func (c *RoomsCreateCall) Context(ctx context.Context) *RoomsCreateCall { 8284 c.ctx_ = ctx 8285 return c 8286} 8287 8288// Header returns an http.Header that can be modified by the caller to 8289// add HTTP headers to the request. 8290func (c *RoomsCreateCall) Header() http.Header { 8291 if c.header_ == nil { 8292 c.header_ = make(http.Header) 8293 } 8294 return c.header_ 8295} 8296 8297func (c *RoomsCreateCall) doRequest(alt string) (*http.Response, error) { 8298 reqHeaders := make(http.Header) 8299 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 8300 for k, v := range c.header_ { 8301 reqHeaders[k] = v 8302 } 8303 reqHeaders.Set("User-Agent", c.s.userAgent()) 8304 var body io.Reader = nil 8305 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomcreaterequest) 8306 if err != nil { 8307 return nil, err 8308 } 8309 reqHeaders.Set("Content-Type", "application/json") 8310 c.urlParams_.Set("alt", alt) 8311 c.urlParams_.Set("prettyPrint", "false") 8312 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/create") 8313 urls += "?" + c.urlParams_.Encode() 8314 req, err := http.NewRequest("POST", urls, body) 8315 if err != nil { 8316 return nil, err 8317 } 8318 req.Header = reqHeaders 8319 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8320} 8321 8322// Do executes the "games.rooms.create" call. 8323// Exactly one of *Room or error will be non-nil. Any non-2xx status 8324// code is an error. Response headers are in either 8325// *Room.ServerResponse.Header or (if a response was returned at all) in 8326// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8327// whether the returned error was because http.StatusNotModified was 8328// returned. 8329func (c *RoomsCreateCall) Do(opts ...googleapi.CallOption) (*Room, error) { 8330 gensupport.SetOptions(c.urlParams_, opts...) 8331 res, err := c.doRequest("json") 8332 if res != nil && res.StatusCode == http.StatusNotModified { 8333 if res.Body != nil { 8334 res.Body.Close() 8335 } 8336 return nil, &googleapi.Error{ 8337 Code: res.StatusCode, 8338 Header: res.Header, 8339 } 8340 } 8341 if err != nil { 8342 return nil, err 8343 } 8344 defer googleapi.CloseBody(res) 8345 if err := googleapi.CheckResponse(res); err != nil { 8346 return nil, err 8347 } 8348 ret := &Room{ 8349 ServerResponse: googleapi.ServerResponse{ 8350 Header: res.Header, 8351 HTTPStatusCode: res.StatusCode, 8352 }, 8353 } 8354 target := &ret 8355 if err := gensupport.DecodeResponse(target, res); err != nil { 8356 return nil, err 8357 } 8358 return ret, nil 8359 // { 8360 // "description": "Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 8361 // "httpMethod": "POST", 8362 // "id": "games.rooms.create", 8363 // "parameters": { 8364 // "language": { 8365 // "description": "The preferred language to use for strings returned by this method.", 8366 // "location": "query", 8367 // "type": "string" 8368 // } 8369 // }, 8370 // "path": "rooms/create", 8371 // "request": { 8372 // "$ref": "RoomCreateRequest" 8373 // }, 8374 // "response": { 8375 // "$ref": "Room" 8376 // }, 8377 // "scopes": [ 8378 // "https://www.googleapis.com/auth/games" 8379 // ] 8380 // } 8381 8382} 8383 8384// method id "games.rooms.decline": 8385 8386type RoomsDeclineCall struct { 8387 s *Service 8388 roomId string 8389 urlParams_ gensupport.URLParams 8390 ctx_ context.Context 8391 header_ http.Header 8392} 8393 8394// Decline: Decline an invitation to join a room. For internal use by 8395// the Games SDK only. Calling this method directly is unsupported. 8396func (r *RoomsService) Decline(roomId string) *RoomsDeclineCall { 8397 c := &RoomsDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8398 c.roomId = roomId 8399 return c 8400} 8401 8402// Language sets the optional parameter "language": The preferred 8403// language to use for strings returned by this method. 8404func (c *RoomsDeclineCall) Language(language string) *RoomsDeclineCall { 8405 c.urlParams_.Set("language", language) 8406 return c 8407} 8408 8409// Fields allows partial responses to be retrieved. See 8410// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8411// for more information. 8412func (c *RoomsDeclineCall) Fields(s ...googleapi.Field) *RoomsDeclineCall { 8413 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8414 return c 8415} 8416 8417// Context sets the context to be used in this call's Do method. Any 8418// pending HTTP request will be aborted if the provided context is 8419// canceled. 8420func (c *RoomsDeclineCall) Context(ctx context.Context) *RoomsDeclineCall { 8421 c.ctx_ = ctx 8422 return c 8423} 8424 8425// Header returns an http.Header that can be modified by the caller to 8426// add HTTP headers to the request. 8427func (c *RoomsDeclineCall) Header() http.Header { 8428 if c.header_ == nil { 8429 c.header_ = make(http.Header) 8430 } 8431 return c.header_ 8432} 8433 8434func (c *RoomsDeclineCall) doRequest(alt string) (*http.Response, error) { 8435 reqHeaders := make(http.Header) 8436 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 8437 for k, v := range c.header_ { 8438 reqHeaders[k] = v 8439 } 8440 reqHeaders.Set("User-Agent", c.s.userAgent()) 8441 var body io.Reader = nil 8442 c.urlParams_.Set("alt", alt) 8443 c.urlParams_.Set("prettyPrint", "false") 8444 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/decline") 8445 urls += "?" + c.urlParams_.Encode() 8446 req, err := http.NewRequest("POST", urls, body) 8447 if err != nil { 8448 return nil, err 8449 } 8450 req.Header = reqHeaders 8451 googleapi.Expand(req.URL, map[string]string{ 8452 "roomId": c.roomId, 8453 }) 8454 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8455} 8456 8457// Do executes the "games.rooms.decline" call. 8458// Exactly one of *Room or error will be non-nil. Any non-2xx status 8459// code is an error. Response headers are in either 8460// *Room.ServerResponse.Header or (if a response was returned at all) in 8461// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8462// whether the returned error was because http.StatusNotModified was 8463// returned. 8464func (c *RoomsDeclineCall) Do(opts ...googleapi.CallOption) (*Room, error) { 8465 gensupport.SetOptions(c.urlParams_, opts...) 8466 res, err := c.doRequest("json") 8467 if res != nil && res.StatusCode == http.StatusNotModified { 8468 if res.Body != nil { 8469 res.Body.Close() 8470 } 8471 return nil, &googleapi.Error{ 8472 Code: res.StatusCode, 8473 Header: res.Header, 8474 } 8475 } 8476 if err != nil { 8477 return nil, err 8478 } 8479 defer googleapi.CloseBody(res) 8480 if err := googleapi.CheckResponse(res); err != nil { 8481 return nil, err 8482 } 8483 ret := &Room{ 8484 ServerResponse: googleapi.ServerResponse{ 8485 Header: res.Header, 8486 HTTPStatusCode: res.StatusCode, 8487 }, 8488 } 8489 target := &ret 8490 if err := gensupport.DecodeResponse(target, res); err != nil { 8491 return nil, err 8492 } 8493 return ret, nil 8494 // { 8495 // "description": "Decline an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 8496 // "httpMethod": "POST", 8497 // "id": "games.rooms.decline", 8498 // "parameterOrder": [ 8499 // "roomId" 8500 // ], 8501 // "parameters": { 8502 // "language": { 8503 // "description": "The preferred language to use for strings returned by this method.", 8504 // "location": "query", 8505 // "type": "string" 8506 // }, 8507 // "roomId": { 8508 // "description": "The ID of the room.", 8509 // "location": "path", 8510 // "required": true, 8511 // "type": "string" 8512 // } 8513 // }, 8514 // "path": "rooms/{roomId}/decline", 8515 // "response": { 8516 // "$ref": "Room" 8517 // }, 8518 // "scopes": [ 8519 // "https://www.googleapis.com/auth/games" 8520 // ] 8521 // } 8522 8523} 8524 8525// method id "games.rooms.dismiss": 8526 8527type RoomsDismissCall struct { 8528 s *Service 8529 roomId string 8530 urlParams_ gensupport.URLParams 8531 ctx_ context.Context 8532 header_ http.Header 8533} 8534 8535// Dismiss: Dismiss an invitation to join a room. For internal use by 8536// the Games SDK only. Calling this method directly is unsupported. 8537func (r *RoomsService) Dismiss(roomId string) *RoomsDismissCall { 8538 c := &RoomsDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8539 c.roomId = roomId 8540 return c 8541} 8542 8543// Fields allows partial responses to be retrieved. See 8544// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8545// for more information. 8546func (c *RoomsDismissCall) Fields(s ...googleapi.Field) *RoomsDismissCall { 8547 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8548 return c 8549} 8550 8551// Context sets the context to be used in this call's Do method. Any 8552// pending HTTP request will be aborted if the provided context is 8553// canceled. 8554func (c *RoomsDismissCall) Context(ctx context.Context) *RoomsDismissCall { 8555 c.ctx_ = ctx 8556 return c 8557} 8558 8559// Header returns an http.Header that can be modified by the caller to 8560// add HTTP headers to the request. 8561func (c *RoomsDismissCall) Header() http.Header { 8562 if c.header_ == nil { 8563 c.header_ = make(http.Header) 8564 } 8565 return c.header_ 8566} 8567 8568func (c *RoomsDismissCall) doRequest(alt string) (*http.Response, error) { 8569 reqHeaders := make(http.Header) 8570 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 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, "rooms/{roomId}/dismiss") 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 "roomId": c.roomId, 8587 }) 8588 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8589} 8590 8591// Do executes the "games.rooms.dismiss" call. 8592func (c *RoomsDismissCall) Do(opts ...googleapi.CallOption) error { 8593 gensupport.SetOptions(c.urlParams_, opts...) 8594 res, err := c.doRequest("json") 8595 if err != nil { 8596 return err 8597 } 8598 defer googleapi.CloseBody(res) 8599 if err := googleapi.CheckResponse(res); err != nil { 8600 return err 8601 } 8602 return nil 8603 // { 8604 // "description": "Dismiss an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 8605 // "httpMethod": "POST", 8606 // "id": "games.rooms.dismiss", 8607 // "parameterOrder": [ 8608 // "roomId" 8609 // ], 8610 // "parameters": { 8611 // "roomId": { 8612 // "description": "The ID of the room.", 8613 // "location": "path", 8614 // "required": true, 8615 // "type": "string" 8616 // } 8617 // }, 8618 // "path": "rooms/{roomId}/dismiss", 8619 // "scopes": [ 8620 // "https://www.googleapis.com/auth/games" 8621 // ] 8622 // } 8623 8624} 8625 8626// method id "games.rooms.get": 8627 8628type RoomsGetCall struct { 8629 s *Service 8630 roomId string 8631 urlParams_ gensupport.URLParams 8632 ifNoneMatch_ string 8633 ctx_ context.Context 8634 header_ http.Header 8635} 8636 8637// Get: Get the data for a room. 8638func (r *RoomsService) Get(roomId string) *RoomsGetCall { 8639 c := &RoomsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8640 c.roomId = roomId 8641 return c 8642} 8643 8644// Language sets the optional parameter "language": The preferred 8645// language to use for strings returned by this method. 8646func (c *RoomsGetCall) Language(language string) *RoomsGetCall { 8647 c.urlParams_.Set("language", language) 8648 return c 8649} 8650 8651// Fields allows partial responses to be retrieved. See 8652// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8653// for more information. 8654func (c *RoomsGetCall) Fields(s ...googleapi.Field) *RoomsGetCall { 8655 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8656 return c 8657} 8658 8659// IfNoneMatch sets the optional parameter which makes the operation 8660// fail if the object's ETag matches the given value. This is useful for 8661// getting updates only after the object has changed since the last 8662// request. Use googleapi.IsNotModified to check whether the response 8663// error from Do is the result of In-None-Match. 8664func (c *RoomsGetCall) IfNoneMatch(entityTag string) *RoomsGetCall { 8665 c.ifNoneMatch_ = entityTag 8666 return c 8667} 8668 8669// Context sets the context to be used in this call's Do method. Any 8670// pending HTTP request will be aborted if the provided context is 8671// canceled. 8672func (c *RoomsGetCall) Context(ctx context.Context) *RoomsGetCall { 8673 c.ctx_ = ctx 8674 return c 8675} 8676 8677// Header returns an http.Header that can be modified by the caller to 8678// add HTTP headers to the request. 8679func (c *RoomsGetCall) Header() http.Header { 8680 if c.header_ == nil { 8681 c.header_ = make(http.Header) 8682 } 8683 return c.header_ 8684} 8685 8686func (c *RoomsGetCall) doRequest(alt string) (*http.Response, error) { 8687 reqHeaders := make(http.Header) 8688 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 8689 for k, v := range c.header_ { 8690 reqHeaders[k] = v 8691 } 8692 reqHeaders.Set("User-Agent", c.s.userAgent()) 8693 if c.ifNoneMatch_ != "" { 8694 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8695 } 8696 var body io.Reader = nil 8697 c.urlParams_.Set("alt", alt) 8698 c.urlParams_.Set("prettyPrint", "false") 8699 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}") 8700 urls += "?" + c.urlParams_.Encode() 8701 req, err := http.NewRequest("GET", urls, body) 8702 if err != nil { 8703 return nil, err 8704 } 8705 req.Header = reqHeaders 8706 googleapi.Expand(req.URL, map[string]string{ 8707 "roomId": c.roomId, 8708 }) 8709 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8710} 8711 8712// Do executes the "games.rooms.get" call. 8713// Exactly one of *Room or error will be non-nil. Any non-2xx status 8714// code is an error. Response headers are in either 8715// *Room.ServerResponse.Header or (if a response was returned at all) in 8716// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8717// whether the returned error was because http.StatusNotModified was 8718// returned. 8719func (c *RoomsGetCall) Do(opts ...googleapi.CallOption) (*Room, error) { 8720 gensupport.SetOptions(c.urlParams_, opts...) 8721 res, err := c.doRequest("json") 8722 if res != nil && res.StatusCode == http.StatusNotModified { 8723 if res.Body != nil { 8724 res.Body.Close() 8725 } 8726 return nil, &googleapi.Error{ 8727 Code: res.StatusCode, 8728 Header: res.Header, 8729 } 8730 } 8731 if err != nil { 8732 return nil, err 8733 } 8734 defer googleapi.CloseBody(res) 8735 if err := googleapi.CheckResponse(res); err != nil { 8736 return nil, err 8737 } 8738 ret := &Room{ 8739 ServerResponse: googleapi.ServerResponse{ 8740 Header: res.Header, 8741 HTTPStatusCode: res.StatusCode, 8742 }, 8743 } 8744 target := &ret 8745 if err := gensupport.DecodeResponse(target, res); err != nil { 8746 return nil, err 8747 } 8748 return ret, nil 8749 // { 8750 // "description": "Get the data for a room.", 8751 // "httpMethod": "GET", 8752 // "id": "games.rooms.get", 8753 // "parameterOrder": [ 8754 // "roomId" 8755 // ], 8756 // "parameters": { 8757 // "language": { 8758 // "description": "The preferred language to use for strings returned by this method.", 8759 // "location": "query", 8760 // "type": "string" 8761 // }, 8762 // "roomId": { 8763 // "description": "The ID of the room.", 8764 // "location": "path", 8765 // "required": true, 8766 // "type": "string" 8767 // } 8768 // }, 8769 // "path": "rooms/{roomId}", 8770 // "response": { 8771 // "$ref": "Room" 8772 // }, 8773 // "scopes": [ 8774 // "https://www.googleapis.com/auth/games" 8775 // ] 8776 // } 8777 8778} 8779 8780// method id "games.rooms.join": 8781 8782type RoomsJoinCall struct { 8783 s *Service 8784 roomId string 8785 roomjoinrequest *RoomJoinRequest 8786 urlParams_ gensupport.URLParams 8787 ctx_ context.Context 8788 header_ http.Header 8789} 8790 8791// Join: Join a room. For internal use by the Games SDK only. Calling 8792// this method directly is unsupported. 8793func (r *RoomsService) Join(roomId string, roomjoinrequest *RoomJoinRequest) *RoomsJoinCall { 8794 c := &RoomsJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8795 c.roomId = roomId 8796 c.roomjoinrequest = roomjoinrequest 8797 return c 8798} 8799 8800// Language sets the optional parameter "language": The preferred 8801// language to use for strings returned by this method. 8802func (c *RoomsJoinCall) Language(language string) *RoomsJoinCall { 8803 c.urlParams_.Set("language", language) 8804 return c 8805} 8806 8807// Fields allows partial responses to be retrieved. See 8808// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8809// for more information. 8810func (c *RoomsJoinCall) Fields(s ...googleapi.Field) *RoomsJoinCall { 8811 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8812 return c 8813} 8814 8815// Context sets the context to be used in this call's Do method. Any 8816// pending HTTP request will be aborted if the provided context is 8817// canceled. 8818func (c *RoomsJoinCall) Context(ctx context.Context) *RoomsJoinCall { 8819 c.ctx_ = ctx 8820 return c 8821} 8822 8823// Header returns an http.Header that can be modified by the caller to 8824// add HTTP headers to the request. 8825func (c *RoomsJoinCall) Header() http.Header { 8826 if c.header_ == nil { 8827 c.header_ = make(http.Header) 8828 } 8829 return c.header_ 8830} 8831 8832func (c *RoomsJoinCall) doRequest(alt string) (*http.Response, error) { 8833 reqHeaders := make(http.Header) 8834 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 8835 for k, v := range c.header_ { 8836 reqHeaders[k] = v 8837 } 8838 reqHeaders.Set("User-Agent", c.s.userAgent()) 8839 var body io.Reader = nil 8840 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomjoinrequest) 8841 if err != nil { 8842 return nil, err 8843 } 8844 reqHeaders.Set("Content-Type", "application/json") 8845 c.urlParams_.Set("alt", alt) 8846 c.urlParams_.Set("prettyPrint", "false") 8847 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/join") 8848 urls += "?" + c.urlParams_.Encode() 8849 req, err := http.NewRequest("POST", urls, body) 8850 if err != nil { 8851 return nil, err 8852 } 8853 req.Header = reqHeaders 8854 googleapi.Expand(req.URL, map[string]string{ 8855 "roomId": c.roomId, 8856 }) 8857 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8858} 8859 8860// Do executes the "games.rooms.join" call. 8861// Exactly one of *Room or error will be non-nil. Any non-2xx status 8862// code is an error. Response headers are in either 8863// *Room.ServerResponse.Header or (if a response was returned at all) in 8864// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8865// whether the returned error was because http.StatusNotModified was 8866// returned. 8867func (c *RoomsJoinCall) Do(opts ...googleapi.CallOption) (*Room, error) { 8868 gensupport.SetOptions(c.urlParams_, opts...) 8869 res, err := c.doRequest("json") 8870 if res != nil && res.StatusCode == http.StatusNotModified { 8871 if res.Body != nil { 8872 res.Body.Close() 8873 } 8874 return nil, &googleapi.Error{ 8875 Code: res.StatusCode, 8876 Header: res.Header, 8877 } 8878 } 8879 if err != nil { 8880 return nil, err 8881 } 8882 defer googleapi.CloseBody(res) 8883 if err := googleapi.CheckResponse(res); err != nil { 8884 return nil, err 8885 } 8886 ret := &Room{ 8887 ServerResponse: googleapi.ServerResponse{ 8888 Header: res.Header, 8889 HTTPStatusCode: res.StatusCode, 8890 }, 8891 } 8892 target := &ret 8893 if err := gensupport.DecodeResponse(target, res); err != nil { 8894 return nil, err 8895 } 8896 return ret, nil 8897 // { 8898 // "description": "Join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 8899 // "httpMethod": "POST", 8900 // "id": "games.rooms.join", 8901 // "parameterOrder": [ 8902 // "roomId" 8903 // ], 8904 // "parameters": { 8905 // "language": { 8906 // "description": "The preferred language to use for strings returned by this method.", 8907 // "location": "query", 8908 // "type": "string" 8909 // }, 8910 // "roomId": { 8911 // "description": "The ID of the room.", 8912 // "location": "path", 8913 // "required": true, 8914 // "type": "string" 8915 // } 8916 // }, 8917 // "path": "rooms/{roomId}/join", 8918 // "request": { 8919 // "$ref": "RoomJoinRequest" 8920 // }, 8921 // "response": { 8922 // "$ref": "Room" 8923 // }, 8924 // "scopes": [ 8925 // "https://www.googleapis.com/auth/games" 8926 // ] 8927 // } 8928 8929} 8930 8931// method id "games.rooms.leave": 8932 8933type RoomsLeaveCall struct { 8934 s *Service 8935 roomId string 8936 roomleaverequest *RoomLeaveRequest 8937 urlParams_ gensupport.URLParams 8938 ctx_ context.Context 8939 header_ http.Header 8940} 8941 8942// Leave: Leave a room. For internal use by the Games SDK only. Calling 8943// this method directly is unsupported. 8944func (r *RoomsService) Leave(roomId string, roomleaverequest *RoomLeaveRequest) *RoomsLeaveCall { 8945 c := &RoomsLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8946 c.roomId = roomId 8947 c.roomleaverequest = roomleaverequest 8948 return c 8949} 8950 8951// Language sets the optional parameter "language": The preferred 8952// language to use for strings returned by this method. 8953func (c *RoomsLeaveCall) Language(language string) *RoomsLeaveCall { 8954 c.urlParams_.Set("language", language) 8955 return c 8956} 8957 8958// Fields allows partial responses to be retrieved. See 8959// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8960// for more information. 8961func (c *RoomsLeaveCall) Fields(s ...googleapi.Field) *RoomsLeaveCall { 8962 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8963 return c 8964} 8965 8966// Context sets the context to be used in this call's Do method. Any 8967// pending HTTP request will be aborted if the provided context is 8968// canceled. 8969func (c *RoomsLeaveCall) Context(ctx context.Context) *RoomsLeaveCall { 8970 c.ctx_ = ctx 8971 return c 8972} 8973 8974// Header returns an http.Header that can be modified by the caller to 8975// add HTTP headers to the request. 8976func (c *RoomsLeaveCall) Header() http.Header { 8977 if c.header_ == nil { 8978 c.header_ = make(http.Header) 8979 } 8980 return c.header_ 8981} 8982 8983func (c *RoomsLeaveCall) doRequest(alt string) (*http.Response, error) { 8984 reqHeaders := make(http.Header) 8985 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 8986 for k, v := range c.header_ { 8987 reqHeaders[k] = v 8988 } 8989 reqHeaders.Set("User-Agent", c.s.userAgent()) 8990 var body io.Reader = nil 8991 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomleaverequest) 8992 if err != nil { 8993 return nil, err 8994 } 8995 reqHeaders.Set("Content-Type", "application/json") 8996 c.urlParams_.Set("alt", alt) 8997 c.urlParams_.Set("prettyPrint", "false") 8998 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/leave") 8999 urls += "?" + c.urlParams_.Encode() 9000 req, err := http.NewRequest("POST", urls, body) 9001 if err != nil { 9002 return nil, err 9003 } 9004 req.Header = reqHeaders 9005 googleapi.Expand(req.URL, map[string]string{ 9006 "roomId": c.roomId, 9007 }) 9008 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9009} 9010 9011// Do executes the "games.rooms.leave" call. 9012// Exactly one of *Room or error will be non-nil. Any non-2xx status 9013// code is an error. Response headers are in either 9014// *Room.ServerResponse.Header or (if a response was returned at all) in 9015// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9016// whether the returned error was because http.StatusNotModified was 9017// returned. 9018func (c *RoomsLeaveCall) Do(opts ...googleapi.CallOption) (*Room, error) { 9019 gensupport.SetOptions(c.urlParams_, opts...) 9020 res, err := c.doRequest("json") 9021 if res != nil && res.StatusCode == http.StatusNotModified { 9022 if res.Body != nil { 9023 res.Body.Close() 9024 } 9025 return nil, &googleapi.Error{ 9026 Code: res.StatusCode, 9027 Header: res.Header, 9028 } 9029 } 9030 if err != nil { 9031 return nil, err 9032 } 9033 defer googleapi.CloseBody(res) 9034 if err := googleapi.CheckResponse(res); err != nil { 9035 return nil, err 9036 } 9037 ret := &Room{ 9038 ServerResponse: googleapi.ServerResponse{ 9039 Header: res.Header, 9040 HTTPStatusCode: res.StatusCode, 9041 }, 9042 } 9043 target := &ret 9044 if err := gensupport.DecodeResponse(target, res); err != nil { 9045 return nil, err 9046 } 9047 return ret, nil 9048 // { 9049 // "description": "Leave a room. For internal use by the Games SDK only. Calling this method directly is unsupported.", 9050 // "httpMethod": "POST", 9051 // "id": "games.rooms.leave", 9052 // "parameterOrder": [ 9053 // "roomId" 9054 // ], 9055 // "parameters": { 9056 // "language": { 9057 // "description": "The preferred language to use for strings returned by this method.", 9058 // "location": "query", 9059 // "type": "string" 9060 // }, 9061 // "roomId": { 9062 // "description": "The ID of the room.", 9063 // "location": "path", 9064 // "required": true, 9065 // "type": "string" 9066 // } 9067 // }, 9068 // "path": "rooms/{roomId}/leave", 9069 // "request": { 9070 // "$ref": "RoomLeaveRequest" 9071 // }, 9072 // "response": { 9073 // "$ref": "Room" 9074 // }, 9075 // "scopes": [ 9076 // "https://www.googleapis.com/auth/games" 9077 // ] 9078 // } 9079 9080} 9081 9082// method id "games.rooms.list": 9083 9084type RoomsListCall struct { 9085 s *Service 9086 urlParams_ gensupport.URLParams 9087 ifNoneMatch_ string 9088 ctx_ context.Context 9089 header_ http.Header 9090} 9091 9092// List: Returns invitations to join rooms. 9093func (r *RoomsService) List() *RoomsListCall { 9094 c := &RoomsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9095 return c 9096} 9097 9098// Language sets the optional parameter "language": The preferred 9099// language to use for strings returned by this method. 9100func (c *RoomsListCall) Language(language string) *RoomsListCall { 9101 c.urlParams_.Set("language", language) 9102 return c 9103} 9104 9105// MaxResults sets the optional parameter "maxResults": The maximum 9106// number of rooms to return in the response, used for paging. For any 9107// response, the actual number of rooms to return may be less than the 9108// specified maxResults. 9109func (c *RoomsListCall) MaxResults(maxResults int64) *RoomsListCall { 9110 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9111 return c 9112} 9113 9114// PageToken sets the optional parameter "pageToken": The token returned 9115// by the previous request. 9116func (c *RoomsListCall) PageToken(pageToken string) *RoomsListCall { 9117 c.urlParams_.Set("pageToken", pageToken) 9118 return c 9119} 9120 9121// Fields allows partial responses to be retrieved. See 9122// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9123// for more information. 9124func (c *RoomsListCall) Fields(s ...googleapi.Field) *RoomsListCall { 9125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9126 return c 9127} 9128 9129// IfNoneMatch sets the optional parameter which makes the operation 9130// fail if the object's ETag matches the given value. This is useful for 9131// getting updates only after the object has changed since the last 9132// request. Use googleapi.IsNotModified to check whether the response 9133// error from Do is the result of In-None-Match. 9134func (c *RoomsListCall) IfNoneMatch(entityTag string) *RoomsListCall { 9135 c.ifNoneMatch_ = entityTag 9136 return c 9137} 9138 9139// Context sets the context to be used in this call's Do method. Any 9140// pending HTTP request will be aborted if the provided context is 9141// canceled. 9142func (c *RoomsListCall) Context(ctx context.Context) *RoomsListCall { 9143 c.ctx_ = ctx 9144 return c 9145} 9146 9147// Header returns an http.Header that can be modified by the caller to 9148// add HTTP headers to the request. 9149func (c *RoomsListCall) Header() http.Header { 9150 if c.header_ == nil { 9151 c.header_ = make(http.Header) 9152 } 9153 return c.header_ 9154} 9155 9156func (c *RoomsListCall) doRequest(alt string) (*http.Response, error) { 9157 reqHeaders := make(http.Header) 9158 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 9159 for k, v := range c.header_ { 9160 reqHeaders[k] = v 9161 } 9162 reqHeaders.Set("User-Agent", c.s.userAgent()) 9163 if c.ifNoneMatch_ != "" { 9164 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9165 } 9166 var body io.Reader = nil 9167 c.urlParams_.Set("alt", alt) 9168 c.urlParams_.Set("prettyPrint", "false") 9169 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms") 9170 urls += "?" + c.urlParams_.Encode() 9171 req, err := http.NewRequest("GET", urls, body) 9172 if err != nil { 9173 return nil, err 9174 } 9175 req.Header = reqHeaders 9176 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9177} 9178 9179// Do executes the "games.rooms.list" call. 9180// Exactly one of *RoomList or error will be non-nil. Any non-2xx status 9181// code is an error. Response headers are in either 9182// *RoomList.ServerResponse.Header or (if a response was returned at 9183// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9184// to check whether the returned error was because 9185// http.StatusNotModified was returned. 9186func (c *RoomsListCall) Do(opts ...googleapi.CallOption) (*RoomList, error) { 9187 gensupport.SetOptions(c.urlParams_, opts...) 9188 res, err := c.doRequest("json") 9189 if res != nil && res.StatusCode == http.StatusNotModified { 9190 if res.Body != nil { 9191 res.Body.Close() 9192 } 9193 return nil, &googleapi.Error{ 9194 Code: res.StatusCode, 9195 Header: res.Header, 9196 } 9197 } 9198 if err != nil { 9199 return nil, err 9200 } 9201 defer googleapi.CloseBody(res) 9202 if err := googleapi.CheckResponse(res); err != nil { 9203 return nil, err 9204 } 9205 ret := &RoomList{ 9206 ServerResponse: googleapi.ServerResponse{ 9207 Header: res.Header, 9208 HTTPStatusCode: res.StatusCode, 9209 }, 9210 } 9211 target := &ret 9212 if err := gensupport.DecodeResponse(target, res); err != nil { 9213 return nil, err 9214 } 9215 return ret, nil 9216 // { 9217 // "description": "Returns invitations to join rooms.", 9218 // "httpMethod": "GET", 9219 // "id": "games.rooms.list", 9220 // "parameters": { 9221 // "language": { 9222 // "description": "The preferred language to use for strings returned by this method.", 9223 // "location": "query", 9224 // "type": "string" 9225 // }, 9226 // "maxResults": { 9227 // "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.", 9228 // "format": "int32", 9229 // "location": "query", 9230 // "maximum": "500", 9231 // "minimum": "1", 9232 // "type": "integer" 9233 // }, 9234 // "pageToken": { 9235 // "description": "The token returned by the previous request.", 9236 // "location": "query", 9237 // "type": "string" 9238 // } 9239 // }, 9240 // "path": "rooms", 9241 // "response": { 9242 // "$ref": "RoomList" 9243 // }, 9244 // "scopes": [ 9245 // "https://www.googleapis.com/auth/games" 9246 // ] 9247 // } 9248 9249} 9250 9251// Pages invokes f for each page of results. 9252// A non-nil error returned from f will halt the iteration. 9253// The provided context supersedes any context provided to the Context method. 9254func (c *RoomsListCall) Pages(ctx context.Context, f func(*RoomList) error) error { 9255 c.ctx_ = ctx 9256 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9257 for { 9258 x, err := c.Do() 9259 if err != nil { 9260 return err 9261 } 9262 if err := f(x); err != nil { 9263 return err 9264 } 9265 if x.NextPageToken == "" { 9266 return nil 9267 } 9268 c.PageToken(x.NextPageToken) 9269 } 9270} 9271 9272// method id "games.rooms.reportStatus": 9273 9274type RoomsReportStatusCall struct { 9275 s *Service 9276 roomId string 9277 roomp2pstatuses *RoomP2PStatuses 9278 urlParams_ gensupport.URLParams 9279 ctx_ context.Context 9280 header_ http.Header 9281} 9282 9283// ReportStatus: Updates sent by a client reporting the status of peers 9284// in a room. For internal use by the Games SDK only. Calling this 9285// method directly is unsupported. 9286func (r *RoomsService) ReportStatus(roomId string, roomp2pstatuses *RoomP2PStatuses) *RoomsReportStatusCall { 9287 c := &RoomsReportStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9288 c.roomId = roomId 9289 c.roomp2pstatuses = roomp2pstatuses 9290 return c 9291} 9292 9293// Language sets the optional parameter "language": The preferred 9294// language to use for strings returned by this method. 9295func (c *RoomsReportStatusCall) Language(language string) *RoomsReportStatusCall { 9296 c.urlParams_.Set("language", language) 9297 return c 9298} 9299 9300// Fields allows partial responses to be retrieved. See 9301// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9302// for more information. 9303func (c *RoomsReportStatusCall) Fields(s ...googleapi.Field) *RoomsReportStatusCall { 9304 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9305 return c 9306} 9307 9308// Context sets the context to be used in this call's Do method. Any 9309// pending HTTP request will be aborted if the provided context is 9310// canceled. 9311func (c *RoomsReportStatusCall) Context(ctx context.Context) *RoomsReportStatusCall { 9312 c.ctx_ = ctx 9313 return c 9314} 9315 9316// Header returns an http.Header that can be modified by the caller to 9317// add HTTP headers to the request. 9318func (c *RoomsReportStatusCall) Header() http.Header { 9319 if c.header_ == nil { 9320 c.header_ = make(http.Header) 9321 } 9322 return c.header_ 9323} 9324 9325func (c *RoomsReportStatusCall) doRequest(alt string) (*http.Response, error) { 9326 reqHeaders := make(http.Header) 9327 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 9328 for k, v := range c.header_ { 9329 reqHeaders[k] = v 9330 } 9331 reqHeaders.Set("User-Agent", c.s.userAgent()) 9332 var body io.Reader = nil 9333 body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomp2pstatuses) 9334 if err != nil { 9335 return nil, err 9336 } 9337 reqHeaders.Set("Content-Type", "application/json") 9338 c.urlParams_.Set("alt", alt) 9339 c.urlParams_.Set("prettyPrint", "false") 9340 urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/reportstatus") 9341 urls += "?" + c.urlParams_.Encode() 9342 req, err := http.NewRequest("POST", urls, body) 9343 if err != nil { 9344 return nil, err 9345 } 9346 req.Header = reqHeaders 9347 googleapi.Expand(req.URL, map[string]string{ 9348 "roomId": c.roomId, 9349 }) 9350 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9351} 9352 9353// Do executes the "games.rooms.reportStatus" call. 9354// Exactly one of *RoomStatus or error will be non-nil. Any non-2xx 9355// status code is an error. Response headers are in either 9356// *RoomStatus.ServerResponse.Header or (if a response was returned at 9357// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9358// to check whether the returned error was because 9359// http.StatusNotModified was returned. 9360func (c *RoomsReportStatusCall) Do(opts ...googleapi.CallOption) (*RoomStatus, error) { 9361 gensupport.SetOptions(c.urlParams_, opts...) 9362 res, err := c.doRequest("json") 9363 if res != nil && res.StatusCode == http.StatusNotModified { 9364 if res.Body != nil { 9365 res.Body.Close() 9366 } 9367 return nil, &googleapi.Error{ 9368 Code: res.StatusCode, 9369 Header: res.Header, 9370 } 9371 } 9372 if err != nil { 9373 return nil, err 9374 } 9375 defer googleapi.CloseBody(res) 9376 if err := googleapi.CheckResponse(res); err != nil { 9377 return nil, err 9378 } 9379 ret := &RoomStatus{ 9380 ServerResponse: googleapi.ServerResponse{ 9381 Header: res.Header, 9382 HTTPStatusCode: res.StatusCode, 9383 }, 9384 } 9385 target := &ret 9386 if err := gensupport.DecodeResponse(target, res); err != nil { 9387 return nil, err 9388 } 9389 return ret, nil 9390 // { 9391 // "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.", 9392 // "httpMethod": "POST", 9393 // "id": "games.rooms.reportStatus", 9394 // "parameterOrder": [ 9395 // "roomId" 9396 // ], 9397 // "parameters": { 9398 // "language": { 9399 // "description": "The preferred language to use for strings returned by this method.", 9400 // "location": "query", 9401 // "type": "string" 9402 // }, 9403 // "roomId": { 9404 // "description": "The ID of the room.", 9405 // "location": "path", 9406 // "required": true, 9407 // "type": "string" 9408 // } 9409 // }, 9410 // "path": "rooms/{roomId}/reportstatus", 9411 // "request": { 9412 // "$ref": "RoomP2PStatuses" 9413 // }, 9414 // "response": { 9415 // "$ref": "RoomStatus" 9416 // }, 9417 // "scopes": [ 9418 // "https://www.googleapis.com/auth/games" 9419 // ] 9420 // } 9421 9422} 9423 9424// method id "games.scores.get": 9425 9426type ScoresGetCall struct { 9427 s *Service 9428 playerId string 9429 leaderboardId string 9430 timeSpan string 9431 urlParams_ gensupport.URLParams 9432 ifNoneMatch_ string 9433 ctx_ context.Context 9434 header_ http.Header 9435} 9436 9437// Get: Get high scores, and optionally ranks, in leaderboards for the 9438// currently authenticated player. For a specific time span, 9439// leaderboardId can be set to ALL to retrieve data for all leaderboards 9440// in a given time span. 9441// NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in 9442// the same request; only one parameter may be set to 'ALL'. 9443func (r *ScoresService) Get(playerId string, leaderboardId string, timeSpan string) *ScoresGetCall { 9444 c := &ScoresGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9445 c.playerId = playerId 9446 c.leaderboardId = leaderboardId 9447 c.timeSpan = timeSpan 9448 return c 9449} 9450 9451// IncludeRankType sets the optional parameter "includeRankType": The 9452// types of ranks to return. If the parameter is omitted, no ranks will 9453// be returned. 9454// 9455// Possible values: 9456// "ALL" - Retrieve public and social ranks. 9457// "PUBLIC" - Retrieve public ranks, if the player is sharing their 9458// gameplay activity publicly. 9459// "SOCIAL" - Retrieve the social rank. 9460func (c *ScoresGetCall) IncludeRankType(includeRankType string) *ScoresGetCall { 9461 c.urlParams_.Set("includeRankType", includeRankType) 9462 return c 9463} 9464 9465// Language sets the optional parameter "language": The preferred 9466// language to use for strings returned by this method. 9467func (c *ScoresGetCall) Language(language string) *ScoresGetCall { 9468 c.urlParams_.Set("language", language) 9469 return c 9470} 9471 9472// MaxResults sets the optional parameter "maxResults": The maximum 9473// number of leaderboard scores to return in the response. For any 9474// response, the actual number of leaderboard scores returned may be 9475// less than the specified maxResults. 9476func (c *ScoresGetCall) MaxResults(maxResults int64) *ScoresGetCall { 9477 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9478 return c 9479} 9480 9481// PageToken sets the optional parameter "pageToken": The token returned 9482// by the previous request. 9483func (c *ScoresGetCall) PageToken(pageToken string) *ScoresGetCall { 9484 c.urlParams_.Set("pageToken", pageToken) 9485 return c 9486} 9487 9488// Fields allows partial responses to be retrieved. See 9489// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9490// for more information. 9491func (c *ScoresGetCall) Fields(s ...googleapi.Field) *ScoresGetCall { 9492 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9493 return c 9494} 9495 9496// IfNoneMatch sets the optional parameter which makes the operation 9497// fail if the object's ETag matches the given value. This is useful for 9498// getting updates only after the object has changed since the last 9499// request. Use googleapi.IsNotModified to check whether the response 9500// error from Do is the result of In-None-Match. 9501func (c *ScoresGetCall) IfNoneMatch(entityTag string) *ScoresGetCall { 9502 c.ifNoneMatch_ = entityTag 9503 return c 9504} 9505 9506// Context sets the context to be used in this call's Do method. Any 9507// pending HTTP request will be aborted if the provided context is 9508// canceled. 9509func (c *ScoresGetCall) Context(ctx context.Context) *ScoresGetCall { 9510 c.ctx_ = ctx 9511 return c 9512} 9513 9514// Header returns an http.Header that can be modified by the caller to 9515// add HTTP headers to the request. 9516func (c *ScoresGetCall) Header() http.Header { 9517 if c.header_ == nil { 9518 c.header_ = make(http.Header) 9519 } 9520 return c.header_ 9521} 9522 9523func (c *ScoresGetCall) doRequest(alt string) (*http.Response, error) { 9524 reqHeaders := make(http.Header) 9525 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 9526 for k, v := range c.header_ { 9527 reqHeaders[k] = v 9528 } 9529 reqHeaders.Set("User-Agent", c.s.userAgent()) 9530 if c.ifNoneMatch_ != "" { 9531 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9532 } 9533 var body io.Reader = nil 9534 c.urlParams_.Set("alt", alt) 9535 c.urlParams_.Set("prettyPrint", "false") 9536 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}") 9537 urls += "?" + c.urlParams_.Encode() 9538 req, err := http.NewRequest("GET", urls, body) 9539 if err != nil { 9540 return nil, err 9541 } 9542 req.Header = reqHeaders 9543 googleapi.Expand(req.URL, map[string]string{ 9544 "playerId": c.playerId, 9545 "leaderboardId": c.leaderboardId, 9546 "timeSpan": c.timeSpan, 9547 }) 9548 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9549} 9550 9551// Do executes the "games.scores.get" call. 9552// Exactly one of *PlayerLeaderboardScoreListResponse or error will be 9553// non-nil. Any non-2xx status code is an error. Response headers are in 9554// either *PlayerLeaderboardScoreListResponse.ServerResponse.Header or 9555// (if a response was returned at all) in 9556// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9557// whether the returned error was because http.StatusNotModified was 9558// returned. 9559func (c *ScoresGetCall) Do(opts ...googleapi.CallOption) (*PlayerLeaderboardScoreListResponse, error) { 9560 gensupport.SetOptions(c.urlParams_, opts...) 9561 res, err := c.doRequest("json") 9562 if res != nil && res.StatusCode == http.StatusNotModified { 9563 if res.Body != nil { 9564 res.Body.Close() 9565 } 9566 return nil, &googleapi.Error{ 9567 Code: res.StatusCode, 9568 Header: res.Header, 9569 } 9570 } 9571 if err != nil { 9572 return nil, err 9573 } 9574 defer googleapi.CloseBody(res) 9575 if err := googleapi.CheckResponse(res); err != nil { 9576 return nil, err 9577 } 9578 ret := &PlayerLeaderboardScoreListResponse{ 9579 ServerResponse: googleapi.ServerResponse{ 9580 Header: res.Header, 9581 HTTPStatusCode: res.StatusCode, 9582 }, 9583 } 9584 target := &ret 9585 if err := gensupport.DecodeResponse(target, res); err != nil { 9586 return nil, err 9587 } 9588 return ret, nil 9589 // { 9590 // "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'.", 9591 // "httpMethod": "GET", 9592 // "id": "games.scores.get", 9593 // "parameterOrder": [ 9594 // "playerId", 9595 // "leaderboardId", 9596 // "timeSpan" 9597 // ], 9598 // "parameters": { 9599 // "includeRankType": { 9600 // "description": "The types of ranks to return. If the parameter is omitted, no ranks will be returned.", 9601 // "enum": [ 9602 // "ALL", 9603 // "PUBLIC", 9604 // "SOCIAL" 9605 // ], 9606 // "enumDescriptions": [ 9607 // "Retrieve public and social ranks.", 9608 // "Retrieve public ranks, if the player is sharing their gameplay activity publicly.", 9609 // "Retrieve the social rank." 9610 // ], 9611 // "location": "query", 9612 // "type": "string" 9613 // }, 9614 // "language": { 9615 // "description": "The preferred language to use for strings returned by this method.", 9616 // "location": "query", 9617 // "type": "string" 9618 // }, 9619 // "leaderboardId": { 9620 // "description": "The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.", 9621 // "location": "path", 9622 // "required": true, 9623 // "type": "string" 9624 // }, 9625 // "maxResults": { 9626 // "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.", 9627 // "format": "int32", 9628 // "location": "query", 9629 // "maximum": "30", 9630 // "minimum": "1", 9631 // "type": "integer" 9632 // }, 9633 // "pageToken": { 9634 // "description": "The token returned by the previous request.", 9635 // "location": "query", 9636 // "type": "string" 9637 // }, 9638 // "playerId": { 9639 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 9640 // "location": "path", 9641 // "required": true, 9642 // "type": "string" 9643 // }, 9644 // "timeSpan": { 9645 // "description": "The time span for the scores and ranks you're requesting.", 9646 // "enum": [ 9647 // "ALL", 9648 // "ALL_TIME", 9649 // "DAILY", 9650 // "WEEKLY" 9651 // ], 9652 // "enumDescriptions": [ 9653 // "Get the high scores for all time spans. If this is used, maxResults values will be ignored.", 9654 // "Get the all time high score.", 9655 // "List the top scores for the current day.", 9656 // "List the top scores for the current week." 9657 // ], 9658 // "location": "path", 9659 // "required": true, 9660 // "type": "string" 9661 // } 9662 // }, 9663 // "path": "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}", 9664 // "response": { 9665 // "$ref": "PlayerLeaderboardScoreListResponse" 9666 // }, 9667 // "scopes": [ 9668 // "https://www.googleapis.com/auth/games" 9669 // ] 9670 // } 9671 9672} 9673 9674// Pages invokes f for each page of results. 9675// A non-nil error returned from f will halt the iteration. 9676// The provided context supersedes any context provided to the Context method. 9677func (c *ScoresGetCall) Pages(ctx context.Context, f func(*PlayerLeaderboardScoreListResponse) error) error { 9678 c.ctx_ = ctx 9679 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9680 for { 9681 x, err := c.Do() 9682 if err != nil { 9683 return err 9684 } 9685 if err := f(x); err != nil { 9686 return err 9687 } 9688 if x.NextPageToken == "" { 9689 return nil 9690 } 9691 c.PageToken(x.NextPageToken) 9692 } 9693} 9694 9695// method id "games.scores.list": 9696 9697type ScoresListCall struct { 9698 s *Service 9699 leaderboardId string 9700 collection string 9701 urlParams_ gensupport.URLParams 9702 ifNoneMatch_ string 9703 ctx_ context.Context 9704 header_ http.Header 9705} 9706 9707// List: Lists the scores in a leaderboard, starting from the top. 9708func (r *ScoresService) List(leaderboardId string, collection string, timeSpan string) *ScoresListCall { 9709 c := &ScoresListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9710 c.leaderboardId = leaderboardId 9711 c.collection = collection 9712 c.urlParams_.Set("timeSpan", timeSpan) 9713 return c 9714} 9715 9716// Language sets the optional parameter "language": The preferred 9717// language to use for strings returned by this method. 9718func (c *ScoresListCall) Language(language string) *ScoresListCall { 9719 c.urlParams_.Set("language", language) 9720 return c 9721} 9722 9723// MaxResults sets the optional parameter "maxResults": The maximum 9724// number of leaderboard scores to return in the response. For any 9725// response, the actual number of leaderboard scores returned may be 9726// less than the specified maxResults. 9727func (c *ScoresListCall) MaxResults(maxResults int64) *ScoresListCall { 9728 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9729 return c 9730} 9731 9732// PageToken sets the optional parameter "pageToken": The token returned 9733// by the previous request. 9734func (c *ScoresListCall) PageToken(pageToken string) *ScoresListCall { 9735 c.urlParams_.Set("pageToken", pageToken) 9736 return c 9737} 9738 9739// Fields allows partial responses to be retrieved. See 9740// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9741// for more information. 9742func (c *ScoresListCall) Fields(s ...googleapi.Field) *ScoresListCall { 9743 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9744 return c 9745} 9746 9747// IfNoneMatch sets the optional parameter which makes the operation 9748// fail if the object's ETag matches the given value. This is useful for 9749// getting updates only after the object has changed since the last 9750// request. Use googleapi.IsNotModified to check whether the response 9751// error from Do is the result of In-None-Match. 9752func (c *ScoresListCall) IfNoneMatch(entityTag string) *ScoresListCall { 9753 c.ifNoneMatch_ = entityTag 9754 return c 9755} 9756 9757// Context sets the context to be used in this call's Do method. Any 9758// pending HTTP request will be aborted if the provided context is 9759// canceled. 9760func (c *ScoresListCall) Context(ctx context.Context) *ScoresListCall { 9761 c.ctx_ = ctx 9762 return c 9763} 9764 9765// Header returns an http.Header that can be modified by the caller to 9766// add HTTP headers to the request. 9767func (c *ScoresListCall) Header() http.Header { 9768 if c.header_ == nil { 9769 c.header_ = make(http.Header) 9770 } 9771 return c.header_ 9772} 9773 9774func (c *ScoresListCall) doRequest(alt string) (*http.Response, error) { 9775 reqHeaders := make(http.Header) 9776 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 9777 for k, v := range c.header_ { 9778 reqHeaders[k] = v 9779 } 9780 reqHeaders.Set("User-Agent", c.s.userAgent()) 9781 if c.ifNoneMatch_ != "" { 9782 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9783 } 9784 var body io.Reader = nil 9785 c.urlParams_.Set("alt", alt) 9786 c.urlParams_.Set("prettyPrint", "false") 9787 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/{collection}") 9788 urls += "?" + c.urlParams_.Encode() 9789 req, err := http.NewRequest("GET", urls, body) 9790 if err != nil { 9791 return nil, err 9792 } 9793 req.Header = reqHeaders 9794 googleapi.Expand(req.URL, map[string]string{ 9795 "leaderboardId": c.leaderboardId, 9796 "collection": c.collection, 9797 }) 9798 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9799} 9800 9801// Do executes the "games.scores.list" call. 9802// Exactly one of *LeaderboardScores or error will be non-nil. Any 9803// non-2xx status code is an error. Response headers are in either 9804// *LeaderboardScores.ServerResponse.Header or (if a response was 9805// returned at all) in error.(*googleapi.Error).Header. Use 9806// googleapi.IsNotModified to check whether the returned error was 9807// because http.StatusNotModified was returned. 9808func (c *ScoresListCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) { 9809 gensupport.SetOptions(c.urlParams_, opts...) 9810 res, err := c.doRequest("json") 9811 if res != nil && res.StatusCode == http.StatusNotModified { 9812 if res.Body != nil { 9813 res.Body.Close() 9814 } 9815 return nil, &googleapi.Error{ 9816 Code: res.StatusCode, 9817 Header: res.Header, 9818 } 9819 } 9820 if err != nil { 9821 return nil, err 9822 } 9823 defer googleapi.CloseBody(res) 9824 if err := googleapi.CheckResponse(res); err != nil { 9825 return nil, err 9826 } 9827 ret := &LeaderboardScores{ 9828 ServerResponse: googleapi.ServerResponse{ 9829 Header: res.Header, 9830 HTTPStatusCode: res.StatusCode, 9831 }, 9832 } 9833 target := &ret 9834 if err := gensupport.DecodeResponse(target, res); err != nil { 9835 return nil, err 9836 } 9837 return ret, nil 9838 // { 9839 // "description": "Lists the scores in a leaderboard, starting from the top.", 9840 // "httpMethod": "GET", 9841 // "id": "games.scores.list", 9842 // "parameterOrder": [ 9843 // "leaderboardId", 9844 // "collection", 9845 // "timeSpan" 9846 // ], 9847 // "parameters": { 9848 // "collection": { 9849 // "description": "The collection of scores you're requesting.", 9850 // "enum": [ 9851 // "PUBLIC", 9852 // "SOCIAL", 9853 // "SOCIAL_1P" 9854 // ], 9855 // "enumDescriptions": [ 9856 // "List all scores in the public leaderboard.", 9857 // "List only social scores.", 9858 // "List only social scores, not respecting the fACL." 9859 // ], 9860 // "location": "path", 9861 // "required": true, 9862 // "type": "string" 9863 // }, 9864 // "language": { 9865 // "description": "The preferred language to use for strings returned by this method.", 9866 // "location": "query", 9867 // "type": "string" 9868 // }, 9869 // "leaderboardId": { 9870 // "description": "The ID of the leaderboard.", 9871 // "location": "path", 9872 // "required": true, 9873 // "type": "string" 9874 // }, 9875 // "maxResults": { 9876 // "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.", 9877 // "format": "int32", 9878 // "location": "query", 9879 // "maximum": "30", 9880 // "minimum": "1", 9881 // "type": "integer" 9882 // }, 9883 // "pageToken": { 9884 // "description": "The token returned by the previous request.", 9885 // "location": "query", 9886 // "type": "string" 9887 // }, 9888 // "timeSpan": { 9889 // "description": "The time span for the scores and ranks you're requesting.", 9890 // "enum": [ 9891 // "ALL_TIME", 9892 // "DAILY", 9893 // "WEEKLY" 9894 // ], 9895 // "enumDescriptions": [ 9896 // "List the all-time top scores.", 9897 // "List the top scores for the current day.", 9898 // "List the top scores for the current week." 9899 // ], 9900 // "location": "query", 9901 // "required": true, 9902 // "type": "string" 9903 // } 9904 // }, 9905 // "path": "leaderboards/{leaderboardId}/scores/{collection}", 9906 // "response": { 9907 // "$ref": "LeaderboardScores" 9908 // }, 9909 // "scopes": [ 9910 // "https://www.googleapis.com/auth/games" 9911 // ] 9912 // } 9913 9914} 9915 9916// Pages invokes f for each page of results. 9917// A non-nil error returned from f will halt the iteration. 9918// The provided context supersedes any context provided to the Context method. 9919func (c *ScoresListCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error { 9920 c.ctx_ = ctx 9921 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9922 for { 9923 x, err := c.Do() 9924 if err != nil { 9925 return err 9926 } 9927 if err := f(x); err != nil { 9928 return err 9929 } 9930 if x.NextPageToken == "" { 9931 return nil 9932 } 9933 c.PageToken(x.NextPageToken) 9934 } 9935} 9936 9937// method id "games.scores.listWindow": 9938 9939type ScoresListWindowCall struct { 9940 s *Service 9941 leaderboardId string 9942 collection string 9943 urlParams_ gensupport.URLParams 9944 ifNoneMatch_ string 9945 ctx_ context.Context 9946 header_ http.Header 9947} 9948 9949// ListWindow: Lists the scores in a leaderboard around (and including) 9950// a player's score. 9951func (r *ScoresService) ListWindow(leaderboardId string, collection string, timeSpan string) *ScoresListWindowCall { 9952 c := &ScoresListWindowCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9953 c.leaderboardId = leaderboardId 9954 c.collection = collection 9955 c.urlParams_.Set("timeSpan", timeSpan) 9956 return c 9957} 9958 9959// Language sets the optional parameter "language": The preferred 9960// language to use for strings returned by this method. 9961func (c *ScoresListWindowCall) Language(language string) *ScoresListWindowCall { 9962 c.urlParams_.Set("language", language) 9963 return c 9964} 9965 9966// MaxResults sets the optional parameter "maxResults": The maximum 9967// number of leaderboard scores to return in the response. For any 9968// response, the actual number of leaderboard scores returned may be 9969// less than the specified maxResults. 9970func (c *ScoresListWindowCall) MaxResults(maxResults int64) *ScoresListWindowCall { 9971 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9972 return c 9973} 9974 9975// PageToken sets the optional parameter "pageToken": The token returned 9976// by the previous request. 9977func (c *ScoresListWindowCall) PageToken(pageToken string) *ScoresListWindowCall { 9978 c.urlParams_.Set("pageToken", pageToken) 9979 return c 9980} 9981 9982// ResultsAbove sets the optional parameter "resultsAbove": The 9983// preferred number of scores to return above the player's score. More 9984// scores may be returned if the player is at the bottom of the 9985// leaderboard; fewer may be returned if the player is at the top. Must 9986// be less than or equal to maxResults. 9987func (c *ScoresListWindowCall) ResultsAbove(resultsAbove int64) *ScoresListWindowCall { 9988 c.urlParams_.Set("resultsAbove", fmt.Sprint(resultsAbove)) 9989 return c 9990} 9991 9992// ReturnTopIfAbsent sets the optional parameter "returnTopIfAbsent": 9993// True if the top scores should be returned when the player is not in 9994// the leaderboard. Defaults to true. 9995func (c *ScoresListWindowCall) ReturnTopIfAbsent(returnTopIfAbsent bool) *ScoresListWindowCall { 9996 c.urlParams_.Set("returnTopIfAbsent", fmt.Sprint(returnTopIfAbsent)) 9997 return c 9998} 9999 10000// Fields allows partial responses to be retrieved. See 10001// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10002// for more information. 10003func (c *ScoresListWindowCall) Fields(s ...googleapi.Field) *ScoresListWindowCall { 10004 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10005 return c 10006} 10007 10008// IfNoneMatch sets the optional parameter which makes the operation 10009// fail if the object's ETag matches the given value. This is useful for 10010// getting updates only after the object has changed since the last 10011// request. Use googleapi.IsNotModified to check whether the response 10012// error from Do is the result of In-None-Match. 10013func (c *ScoresListWindowCall) IfNoneMatch(entityTag string) *ScoresListWindowCall { 10014 c.ifNoneMatch_ = entityTag 10015 return c 10016} 10017 10018// Context sets the context to be used in this call's Do method. Any 10019// pending HTTP request will be aborted if the provided context is 10020// canceled. 10021func (c *ScoresListWindowCall) Context(ctx context.Context) *ScoresListWindowCall { 10022 c.ctx_ = ctx 10023 return c 10024} 10025 10026// Header returns an http.Header that can be modified by the caller to 10027// add HTTP headers to the request. 10028func (c *ScoresListWindowCall) Header() http.Header { 10029 if c.header_ == nil { 10030 c.header_ = make(http.Header) 10031 } 10032 return c.header_ 10033} 10034 10035func (c *ScoresListWindowCall) doRequest(alt string) (*http.Response, error) { 10036 reqHeaders := make(http.Header) 10037 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 10038 for k, v := range c.header_ { 10039 reqHeaders[k] = v 10040 } 10041 reqHeaders.Set("User-Agent", c.s.userAgent()) 10042 if c.ifNoneMatch_ != "" { 10043 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10044 } 10045 var body io.Reader = nil 10046 c.urlParams_.Set("alt", alt) 10047 c.urlParams_.Set("prettyPrint", "false") 10048 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/window/{collection}") 10049 urls += "?" + c.urlParams_.Encode() 10050 req, err := http.NewRequest("GET", urls, body) 10051 if err != nil { 10052 return nil, err 10053 } 10054 req.Header = reqHeaders 10055 googleapi.Expand(req.URL, map[string]string{ 10056 "leaderboardId": c.leaderboardId, 10057 "collection": c.collection, 10058 }) 10059 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10060} 10061 10062// Do executes the "games.scores.listWindow" call. 10063// Exactly one of *LeaderboardScores or error will be non-nil. Any 10064// non-2xx status code is an error. Response headers are in either 10065// *LeaderboardScores.ServerResponse.Header or (if a response was 10066// returned at all) in error.(*googleapi.Error).Header. Use 10067// googleapi.IsNotModified to check whether the returned error was 10068// because http.StatusNotModified was returned. 10069func (c *ScoresListWindowCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) { 10070 gensupport.SetOptions(c.urlParams_, opts...) 10071 res, err := c.doRequest("json") 10072 if res != nil && res.StatusCode == http.StatusNotModified { 10073 if res.Body != nil { 10074 res.Body.Close() 10075 } 10076 return nil, &googleapi.Error{ 10077 Code: res.StatusCode, 10078 Header: res.Header, 10079 } 10080 } 10081 if err != nil { 10082 return nil, err 10083 } 10084 defer googleapi.CloseBody(res) 10085 if err := googleapi.CheckResponse(res); err != nil { 10086 return nil, err 10087 } 10088 ret := &LeaderboardScores{ 10089 ServerResponse: googleapi.ServerResponse{ 10090 Header: res.Header, 10091 HTTPStatusCode: res.StatusCode, 10092 }, 10093 } 10094 target := &ret 10095 if err := gensupport.DecodeResponse(target, res); err != nil { 10096 return nil, err 10097 } 10098 return ret, nil 10099 // { 10100 // "description": "Lists the scores in a leaderboard around (and including) a player's score.", 10101 // "httpMethod": "GET", 10102 // "id": "games.scores.listWindow", 10103 // "parameterOrder": [ 10104 // "leaderboardId", 10105 // "collection", 10106 // "timeSpan" 10107 // ], 10108 // "parameters": { 10109 // "collection": { 10110 // "description": "The collection of scores you're requesting.", 10111 // "enum": [ 10112 // "PUBLIC", 10113 // "SOCIAL", 10114 // "SOCIAL_1P" 10115 // ], 10116 // "enumDescriptions": [ 10117 // "List all scores in the public leaderboard.", 10118 // "List only social scores.", 10119 // "List only social scores, not respecting the fACL." 10120 // ], 10121 // "location": "path", 10122 // "required": true, 10123 // "type": "string" 10124 // }, 10125 // "language": { 10126 // "description": "The preferred language to use for strings returned by this method.", 10127 // "location": "query", 10128 // "type": "string" 10129 // }, 10130 // "leaderboardId": { 10131 // "description": "The ID of the leaderboard.", 10132 // "location": "path", 10133 // "required": true, 10134 // "type": "string" 10135 // }, 10136 // "maxResults": { 10137 // "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.", 10138 // "format": "int32", 10139 // "location": "query", 10140 // "maximum": "30", 10141 // "minimum": "1", 10142 // "type": "integer" 10143 // }, 10144 // "pageToken": { 10145 // "description": "The token returned by the previous request.", 10146 // "location": "query", 10147 // "type": "string" 10148 // }, 10149 // "resultsAbove": { 10150 // "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.", 10151 // "format": "int32", 10152 // "location": "query", 10153 // "type": "integer" 10154 // }, 10155 // "returnTopIfAbsent": { 10156 // "description": "True if the top scores should be returned when the player is not in the leaderboard. Defaults to true.", 10157 // "location": "query", 10158 // "type": "boolean" 10159 // }, 10160 // "timeSpan": { 10161 // "description": "The time span for the scores and ranks you're requesting.", 10162 // "enum": [ 10163 // "ALL_TIME", 10164 // "DAILY", 10165 // "WEEKLY" 10166 // ], 10167 // "enumDescriptions": [ 10168 // "List the all-time top scores.", 10169 // "List the top scores for the current day.", 10170 // "List the top scores for the current week." 10171 // ], 10172 // "location": "query", 10173 // "required": true, 10174 // "type": "string" 10175 // } 10176 // }, 10177 // "path": "leaderboards/{leaderboardId}/window/{collection}", 10178 // "response": { 10179 // "$ref": "LeaderboardScores" 10180 // }, 10181 // "scopes": [ 10182 // "https://www.googleapis.com/auth/games" 10183 // ] 10184 // } 10185 10186} 10187 10188// Pages invokes f for each page of results. 10189// A non-nil error returned from f will halt the iteration. 10190// The provided context supersedes any context provided to the Context method. 10191func (c *ScoresListWindowCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error { 10192 c.ctx_ = ctx 10193 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10194 for { 10195 x, err := c.Do() 10196 if err != nil { 10197 return err 10198 } 10199 if err := f(x); err != nil { 10200 return err 10201 } 10202 if x.NextPageToken == "" { 10203 return nil 10204 } 10205 c.PageToken(x.NextPageToken) 10206 } 10207} 10208 10209// method id "games.scores.submit": 10210 10211type ScoresSubmitCall struct { 10212 s *Service 10213 leaderboardId string 10214 urlParams_ gensupport.URLParams 10215 ctx_ context.Context 10216 header_ http.Header 10217} 10218 10219// Submit: Submits a score to the specified leaderboard. 10220func (r *ScoresService) Submit(leaderboardId string, score int64) *ScoresSubmitCall { 10221 c := &ScoresSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10222 c.leaderboardId = leaderboardId 10223 c.urlParams_.Set("score", fmt.Sprint(score)) 10224 return c 10225} 10226 10227// Language sets the optional parameter "language": The preferred 10228// language to use for strings returned by this method. 10229func (c *ScoresSubmitCall) Language(language string) *ScoresSubmitCall { 10230 c.urlParams_.Set("language", language) 10231 return c 10232} 10233 10234// ScoreTag sets the optional parameter "scoreTag": Additional 10235// information about the score you're submitting. Values must contain no 10236// more than 64 URI-safe characters as defined by section 2.3 of RFC 10237// 3986. 10238func (c *ScoresSubmitCall) ScoreTag(scoreTag string) *ScoresSubmitCall { 10239 c.urlParams_.Set("scoreTag", scoreTag) 10240 return c 10241} 10242 10243// Fields allows partial responses to be retrieved. See 10244// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10245// for more information. 10246func (c *ScoresSubmitCall) Fields(s ...googleapi.Field) *ScoresSubmitCall { 10247 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10248 return c 10249} 10250 10251// Context sets the context to be used in this call's Do method. Any 10252// pending HTTP request will be aborted if the provided context is 10253// canceled. 10254func (c *ScoresSubmitCall) Context(ctx context.Context) *ScoresSubmitCall { 10255 c.ctx_ = ctx 10256 return c 10257} 10258 10259// Header returns an http.Header that can be modified by the caller to 10260// add HTTP headers to the request. 10261func (c *ScoresSubmitCall) Header() http.Header { 10262 if c.header_ == nil { 10263 c.header_ = make(http.Header) 10264 } 10265 return c.header_ 10266} 10267 10268func (c *ScoresSubmitCall) doRequest(alt string) (*http.Response, error) { 10269 reqHeaders := make(http.Header) 10270 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 10271 for k, v := range c.header_ { 10272 reqHeaders[k] = v 10273 } 10274 reqHeaders.Set("User-Agent", c.s.userAgent()) 10275 var body io.Reader = nil 10276 c.urlParams_.Set("alt", alt) 10277 c.urlParams_.Set("prettyPrint", "false") 10278 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores") 10279 urls += "?" + c.urlParams_.Encode() 10280 req, err := http.NewRequest("POST", urls, body) 10281 if err != nil { 10282 return nil, err 10283 } 10284 req.Header = reqHeaders 10285 googleapi.Expand(req.URL, map[string]string{ 10286 "leaderboardId": c.leaderboardId, 10287 }) 10288 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10289} 10290 10291// Do executes the "games.scores.submit" call. 10292// Exactly one of *PlayerScoreResponse or error will be non-nil. Any 10293// non-2xx status code is an error. Response headers are in either 10294// *PlayerScoreResponse.ServerResponse.Header or (if a response was 10295// returned at all) in error.(*googleapi.Error).Header. Use 10296// googleapi.IsNotModified to check whether the returned error was 10297// because http.StatusNotModified was returned. 10298func (c *ScoresSubmitCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResponse, error) { 10299 gensupport.SetOptions(c.urlParams_, opts...) 10300 res, err := c.doRequest("json") 10301 if res != nil && res.StatusCode == http.StatusNotModified { 10302 if res.Body != nil { 10303 res.Body.Close() 10304 } 10305 return nil, &googleapi.Error{ 10306 Code: res.StatusCode, 10307 Header: res.Header, 10308 } 10309 } 10310 if err != nil { 10311 return nil, err 10312 } 10313 defer googleapi.CloseBody(res) 10314 if err := googleapi.CheckResponse(res); err != nil { 10315 return nil, err 10316 } 10317 ret := &PlayerScoreResponse{ 10318 ServerResponse: googleapi.ServerResponse{ 10319 Header: res.Header, 10320 HTTPStatusCode: res.StatusCode, 10321 }, 10322 } 10323 target := &ret 10324 if err := gensupport.DecodeResponse(target, res); err != nil { 10325 return nil, err 10326 } 10327 return ret, nil 10328 // { 10329 // "description": "Submits a score to the specified leaderboard.", 10330 // "httpMethod": "POST", 10331 // "id": "games.scores.submit", 10332 // "parameterOrder": [ 10333 // "leaderboardId", 10334 // "score" 10335 // ], 10336 // "parameters": { 10337 // "language": { 10338 // "description": "The preferred language to use for strings returned by this method.", 10339 // "location": "query", 10340 // "type": "string" 10341 // }, 10342 // "leaderboardId": { 10343 // "description": "The ID of the leaderboard.", 10344 // "location": "path", 10345 // "required": true, 10346 // "type": "string" 10347 // }, 10348 // "score": { 10349 // "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.", 10350 // "format": "int64", 10351 // "location": "query", 10352 // "required": true, 10353 // "type": "string" 10354 // }, 10355 // "scoreTag": { 10356 // "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.", 10357 // "location": "query", 10358 // "pattern": "[a-zA-Z0-9-._~]{0,64}", 10359 // "type": "string" 10360 // } 10361 // }, 10362 // "path": "leaderboards/{leaderboardId}/scores", 10363 // "response": { 10364 // "$ref": "PlayerScoreResponse" 10365 // }, 10366 // "scopes": [ 10367 // "https://www.googleapis.com/auth/games" 10368 // ] 10369 // } 10370 10371} 10372 10373// method id "games.scores.submitMultiple": 10374 10375type ScoresSubmitMultipleCall struct { 10376 s *Service 10377 playerscoresubmissionlist *PlayerScoreSubmissionList 10378 urlParams_ gensupport.URLParams 10379 ctx_ context.Context 10380 header_ http.Header 10381} 10382 10383// SubmitMultiple: Submits multiple scores to leaderboards. 10384func (r *ScoresService) SubmitMultiple(playerscoresubmissionlist *PlayerScoreSubmissionList) *ScoresSubmitMultipleCall { 10385 c := &ScoresSubmitMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10386 c.playerscoresubmissionlist = playerscoresubmissionlist 10387 return c 10388} 10389 10390// Language sets the optional parameter "language": The preferred 10391// language to use for strings returned by this method. 10392func (c *ScoresSubmitMultipleCall) Language(language string) *ScoresSubmitMultipleCall { 10393 c.urlParams_.Set("language", language) 10394 return c 10395} 10396 10397// Fields allows partial responses to be retrieved. See 10398// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10399// for more information. 10400func (c *ScoresSubmitMultipleCall) Fields(s ...googleapi.Field) *ScoresSubmitMultipleCall { 10401 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10402 return c 10403} 10404 10405// Context sets the context to be used in this call's Do method. Any 10406// pending HTTP request will be aborted if the provided context is 10407// canceled. 10408func (c *ScoresSubmitMultipleCall) Context(ctx context.Context) *ScoresSubmitMultipleCall { 10409 c.ctx_ = ctx 10410 return c 10411} 10412 10413// Header returns an http.Header that can be modified by the caller to 10414// add HTTP headers to the request. 10415func (c *ScoresSubmitMultipleCall) Header() http.Header { 10416 if c.header_ == nil { 10417 c.header_ = make(http.Header) 10418 } 10419 return c.header_ 10420} 10421 10422func (c *ScoresSubmitMultipleCall) doRequest(alt string) (*http.Response, error) { 10423 reqHeaders := make(http.Header) 10424 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 10425 for k, v := range c.header_ { 10426 reqHeaders[k] = v 10427 } 10428 reqHeaders.Set("User-Agent", c.s.userAgent()) 10429 var body io.Reader = nil 10430 body, err := googleapi.WithoutDataWrapper.JSONReader(c.playerscoresubmissionlist) 10431 if err != nil { 10432 return nil, err 10433 } 10434 reqHeaders.Set("Content-Type", "application/json") 10435 c.urlParams_.Set("alt", alt) 10436 c.urlParams_.Set("prettyPrint", "false") 10437 urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/scores") 10438 urls += "?" + c.urlParams_.Encode() 10439 req, err := http.NewRequest("POST", urls, body) 10440 if err != nil { 10441 return nil, err 10442 } 10443 req.Header = reqHeaders 10444 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10445} 10446 10447// Do executes the "games.scores.submitMultiple" call. 10448// Exactly one of *PlayerScoreListResponse or error will be non-nil. Any 10449// non-2xx status code is an error. Response headers are in either 10450// *PlayerScoreListResponse.ServerResponse.Header or (if a response was 10451// returned at all) in error.(*googleapi.Error).Header. Use 10452// googleapi.IsNotModified to check whether the returned error was 10453// because http.StatusNotModified was returned. 10454func (c *ScoresSubmitMultipleCall) Do(opts ...googleapi.CallOption) (*PlayerScoreListResponse, error) { 10455 gensupport.SetOptions(c.urlParams_, opts...) 10456 res, err := c.doRequest("json") 10457 if res != nil && res.StatusCode == http.StatusNotModified { 10458 if res.Body != nil { 10459 res.Body.Close() 10460 } 10461 return nil, &googleapi.Error{ 10462 Code: res.StatusCode, 10463 Header: res.Header, 10464 } 10465 } 10466 if err != nil { 10467 return nil, err 10468 } 10469 defer googleapi.CloseBody(res) 10470 if err := googleapi.CheckResponse(res); err != nil { 10471 return nil, err 10472 } 10473 ret := &PlayerScoreListResponse{ 10474 ServerResponse: googleapi.ServerResponse{ 10475 Header: res.Header, 10476 HTTPStatusCode: res.StatusCode, 10477 }, 10478 } 10479 target := &ret 10480 if err := gensupport.DecodeResponse(target, res); err != nil { 10481 return nil, err 10482 } 10483 return ret, nil 10484 // { 10485 // "description": "Submits multiple scores to leaderboards.", 10486 // "httpMethod": "POST", 10487 // "id": "games.scores.submitMultiple", 10488 // "parameters": { 10489 // "language": { 10490 // "description": "The preferred language to use for strings returned by this method.", 10491 // "location": "query", 10492 // "type": "string" 10493 // } 10494 // }, 10495 // "path": "leaderboards/scores", 10496 // "request": { 10497 // "$ref": "PlayerScoreSubmissionList" 10498 // }, 10499 // "response": { 10500 // "$ref": "PlayerScoreListResponse" 10501 // }, 10502 // "scopes": [ 10503 // "https://www.googleapis.com/auth/games" 10504 // ] 10505 // } 10506 10507} 10508 10509// method id "games.snapshots.get": 10510 10511type SnapshotsGetCall struct { 10512 s *Service 10513 snapshotId string 10514 urlParams_ gensupport.URLParams 10515 ifNoneMatch_ string 10516 ctx_ context.Context 10517 header_ http.Header 10518} 10519 10520// Get: Retrieves the metadata for a given snapshot ID. 10521func (r *SnapshotsService) Get(snapshotId string) *SnapshotsGetCall { 10522 c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10523 c.snapshotId = snapshotId 10524 return c 10525} 10526 10527// Language sets the optional parameter "language": The preferred 10528// language to use for strings returned by this method. 10529func (c *SnapshotsGetCall) Language(language string) *SnapshotsGetCall { 10530 c.urlParams_.Set("language", language) 10531 return c 10532} 10533 10534// Fields allows partial responses to be retrieved. See 10535// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10536// for more information. 10537func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall { 10538 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10539 return c 10540} 10541 10542// IfNoneMatch sets the optional parameter which makes the operation 10543// fail if the object's ETag matches the given value. This is useful for 10544// getting updates only after the object has changed since the last 10545// request. Use googleapi.IsNotModified to check whether the response 10546// error from Do is the result of In-None-Match. 10547func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall { 10548 c.ifNoneMatch_ = entityTag 10549 return c 10550} 10551 10552// Context sets the context to be used in this call's Do method. Any 10553// pending HTTP request will be aborted if the provided context is 10554// canceled. 10555func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall { 10556 c.ctx_ = ctx 10557 return c 10558} 10559 10560// Header returns an http.Header that can be modified by the caller to 10561// add HTTP headers to the request. 10562func (c *SnapshotsGetCall) Header() http.Header { 10563 if c.header_ == nil { 10564 c.header_ = make(http.Header) 10565 } 10566 return c.header_ 10567} 10568 10569func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) { 10570 reqHeaders := make(http.Header) 10571 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 10572 for k, v := range c.header_ { 10573 reqHeaders[k] = v 10574 } 10575 reqHeaders.Set("User-Agent", c.s.userAgent()) 10576 if c.ifNoneMatch_ != "" { 10577 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10578 } 10579 var body io.Reader = nil 10580 c.urlParams_.Set("alt", alt) 10581 c.urlParams_.Set("prettyPrint", "false") 10582 urls := googleapi.ResolveRelative(c.s.BasePath, "snapshots/{snapshotId}") 10583 urls += "?" + c.urlParams_.Encode() 10584 req, err := http.NewRequest("GET", urls, body) 10585 if err != nil { 10586 return nil, err 10587 } 10588 req.Header = reqHeaders 10589 googleapi.Expand(req.URL, map[string]string{ 10590 "snapshotId": c.snapshotId, 10591 }) 10592 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10593} 10594 10595// Do executes the "games.snapshots.get" call. 10596// Exactly one of *Snapshot or error will be non-nil. Any non-2xx status 10597// code is an error. Response headers are in either 10598// *Snapshot.ServerResponse.Header or (if a response was returned at 10599// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10600// to check whether the returned error was because 10601// http.StatusNotModified was returned. 10602func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) { 10603 gensupport.SetOptions(c.urlParams_, opts...) 10604 res, err := c.doRequest("json") 10605 if res != nil && res.StatusCode == http.StatusNotModified { 10606 if res.Body != nil { 10607 res.Body.Close() 10608 } 10609 return nil, &googleapi.Error{ 10610 Code: res.StatusCode, 10611 Header: res.Header, 10612 } 10613 } 10614 if err != nil { 10615 return nil, err 10616 } 10617 defer googleapi.CloseBody(res) 10618 if err := googleapi.CheckResponse(res); err != nil { 10619 return nil, err 10620 } 10621 ret := &Snapshot{ 10622 ServerResponse: googleapi.ServerResponse{ 10623 Header: res.Header, 10624 HTTPStatusCode: res.StatusCode, 10625 }, 10626 } 10627 target := &ret 10628 if err := gensupport.DecodeResponse(target, res); err != nil { 10629 return nil, err 10630 } 10631 return ret, nil 10632 // { 10633 // "description": "Retrieves the metadata for a given snapshot ID.", 10634 // "httpMethod": "GET", 10635 // "id": "games.snapshots.get", 10636 // "parameterOrder": [ 10637 // "snapshotId" 10638 // ], 10639 // "parameters": { 10640 // "language": { 10641 // "description": "The preferred language to use for strings returned by this method.", 10642 // "location": "query", 10643 // "type": "string" 10644 // }, 10645 // "snapshotId": { 10646 // "description": "The ID of the snapshot.", 10647 // "location": "path", 10648 // "required": true, 10649 // "type": "string" 10650 // } 10651 // }, 10652 // "path": "snapshots/{snapshotId}", 10653 // "response": { 10654 // "$ref": "Snapshot" 10655 // }, 10656 // "scopes": [ 10657 // "https://www.googleapis.com/auth/drive.appdata", 10658 // "https://www.googleapis.com/auth/games" 10659 // ] 10660 // } 10661 10662} 10663 10664// method id "games.snapshots.list": 10665 10666type SnapshotsListCall struct { 10667 s *Service 10668 playerId string 10669 urlParams_ gensupport.URLParams 10670 ifNoneMatch_ string 10671 ctx_ context.Context 10672 header_ http.Header 10673} 10674 10675// List: Retrieves a list of snapshots created by your application for 10676// the player corresponding to the player ID. 10677func (r *SnapshotsService) List(playerId string) *SnapshotsListCall { 10678 c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10679 c.playerId = playerId 10680 return c 10681} 10682 10683// Language sets the optional parameter "language": The preferred 10684// language to use for strings returned by this method. 10685func (c *SnapshotsListCall) Language(language string) *SnapshotsListCall { 10686 c.urlParams_.Set("language", language) 10687 return c 10688} 10689 10690// MaxResults sets the optional parameter "maxResults": The maximum 10691// number of snapshot resources to return in the response, used for 10692// paging. For any response, the actual number of snapshot resources 10693// returned may be less than the specified maxResults. 10694func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall { 10695 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 10696 return c 10697} 10698 10699// PageToken sets the optional parameter "pageToken": The token returned 10700// by the previous request. 10701func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall { 10702 c.urlParams_.Set("pageToken", pageToken) 10703 return c 10704} 10705 10706// Fields allows partial responses to be retrieved. See 10707// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10708// for more information. 10709func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall { 10710 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10711 return c 10712} 10713 10714// IfNoneMatch sets the optional parameter which makes the operation 10715// fail if the object's ETag matches the given value. This is useful for 10716// getting updates only after the object has changed since the last 10717// request. Use googleapi.IsNotModified to check whether the response 10718// error from Do is the result of In-None-Match. 10719func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall { 10720 c.ifNoneMatch_ = entityTag 10721 return c 10722} 10723 10724// Context sets the context to be used in this call's Do method. Any 10725// pending HTTP request will be aborted if the provided context is 10726// canceled. 10727func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall { 10728 c.ctx_ = ctx 10729 return c 10730} 10731 10732// Header returns an http.Header that can be modified by the caller to 10733// add HTTP headers to the request. 10734func (c *SnapshotsListCall) Header() http.Header { 10735 if c.header_ == nil { 10736 c.header_ = make(http.Header) 10737 } 10738 return c.header_ 10739} 10740 10741func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) { 10742 reqHeaders := make(http.Header) 10743 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 10744 for k, v := range c.header_ { 10745 reqHeaders[k] = v 10746 } 10747 reqHeaders.Set("User-Agent", c.s.userAgent()) 10748 if c.ifNoneMatch_ != "" { 10749 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10750 } 10751 var body io.Reader = nil 10752 c.urlParams_.Set("alt", alt) 10753 c.urlParams_.Set("prettyPrint", "false") 10754 urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/snapshots") 10755 urls += "?" + c.urlParams_.Encode() 10756 req, err := http.NewRequest("GET", urls, body) 10757 if err != nil { 10758 return nil, err 10759 } 10760 req.Header = reqHeaders 10761 googleapi.Expand(req.URL, map[string]string{ 10762 "playerId": c.playerId, 10763 }) 10764 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10765} 10766 10767// Do executes the "games.snapshots.list" call. 10768// Exactly one of *SnapshotListResponse or error will be non-nil. Any 10769// non-2xx status code is an error. Response headers are in either 10770// *SnapshotListResponse.ServerResponse.Header or (if a response was 10771// returned at all) in error.(*googleapi.Error).Header. Use 10772// googleapi.IsNotModified to check whether the returned error was 10773// because http.StatusNotModified was returned. 10774func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotListResponse, error) { 10775 gensupport.SetOptions(c.urlParams_, opts...) 10776 res, err := c.doRequest("json") 10777 if res != nil && res.StatusCode == http.StatusNotModified { 10778 if res.Body != nil { 10779 res.Body.Close() 10780 } 10781 return nil, &googleapi.Error{ 10782 Code: res.StatusCode, 10783 Header: res.Header, 10784 } 10785 } 10786 if err != nil { 10787 return nil, err 10788 } 10789 defer googleapi.CloseBody(res) 10790 if err := googleapi.CheckResponse(res); err != nil { 10791 return nil, err 10792 } 10793 ret := &SnapshotListResponse{ 10794 ServerResponse: googleapi.ServerResponse{ 10795 Header: res.Header, 10796 HTTPStatusCode: res.StatusCode, 10797 }, 10798 } 10799 target := &ret 10800 if err := gensupport.DecodeResponse(target, res); err != nil { 10801 return nil, err 10802 } 10803 return ret, nil 10804 // { 10805 // "description": "Retrieves a list of snapshots created by your application for the player corresponding to the player ID.", 10806 // "httpMethod": "GET", 10807 // "id": "games.snapshots.list", 10808 // "parameterOrder": [ 10809 // "playerId" 10810 // ], 10811 // "parameters": { 10812 // "language": { 10813 // "description": "The preferred language to use for strings returned by this method.", 10814 // "location": "query", 10815 // "type": "string" 10816 // }, 10817 // "maxResults": { 10818 // "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.", 10819 // "format": "int32", 10820 // "location": "query", 10821 // "maximum": "25", 10822 // "minimum": "1", 10823 // "type": "integer" 10824 // }, 10825 // "pageToken": { 10826 // "description": "The token returned by the previous request.", 10827 // "location": "query", 10828 // "type": "string" 10829 // }, 10830 // "playerId": { 10831 // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.", 10832 // "location": "path", 10833 // "required": true, 10834 // "type": "string" 10835 // } 10836 // }, 10837 // "path": "players/{playerId}/snapshots", 10838 // "response": { 10839 // "$ref": "SnapshotListResponse" 10840 // }, 10841 // "scopes": [ 10842 // "https://www.googleapis.com/auth/drive.appdata", 10843 // "https://www.googleapis.com/auth/games" 10844 // ] 10845 // } 10846 10847} 10848 10849// Pages invokes f for each page of results. 10850// A non-nil error returned from f will halt the iteration. 10851// The provided context supersedes any context provided to the Context method. 10852func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotListResponse) error) error { 10853 c.ctx_ = ctx 10854 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10855 for { 10856 x, err := c.Do() 10857 if err != nil { 10858 return err 10859 } 10860 if err := f(x); err != nil { 10861 return err 10862 } 10863 if x.NextPageToken == "" { 10864 return nil 10865 } 10866 c.PageToken(x.NextPageToken) 10867 } 10868} 10869 10870// method id "games.turnBasedMatches.cancel": 10871 10872type TurnBasedMatchesCancelCall struct { 10873 s *Service 10874 matchId string 10875 urlParams_ gensupport.URLParams 10876 ctx_ context.Context 10877 header_ http.Header 10878} 10879 10880// Cancel: Cancel a turn-based match. 10881func (r *TurnBasedMatchesService) Cancel(matchId string) *TurnBasedMatchesCancelCall { 10882 c := &TurnBasedMatchesCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10883 c.matchId = matchId 10884 return c 10885} 10886 10887// Fields allows partial responses to be retrieved. See 10888// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10889// for more information. 10890func (c *TurnBasedMatchesCancelCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCancelCall { 10891 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10892 return c 10893} 10894 10895// Context sets the context to be used in this call's Do method. Any 10896// pending HTTP request will be aborted if the provided context is 10897// canceled. 10898func (c *TurnBasedMatchesCancelCall) Context(ctx context.Context) *TurnBasedMatchesCancelCall { 10899 c.ctx_ = ctx 10900 return c 10901} 10902 10903// Header returns an http.Header that can be modified by the caller to 10904// add HTTP headers to the request. 10905func (c *TurnBasedMatchesCancelCall) Header() http.Header { 10906 if c.header_ == nil { 10907 c.header_ = make(http.Header) 10908 } 10909 return c.header_ 10910} 10911 10912func (c *TurnBasedMatchesCancelCall) doRequest(alt string) (*http.Response, error) { 10913 reqHeaders := make(http.Header) 10914 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 10915 for k, v := range c.header_ { 10916 reqHeaders[k] = v 10917 } 10918 reqHeaders.Set("User-Agent", c.s.userAgent()) 10919 var body io.Reader = nil 10920 c.urlParams_.Set("alt", alt) 10921 c.urlParams_.Set("prettyPrint", "false") 10922 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/cancel") 10923 urls += "?" + c.urlParams_.Encode() 10924 req, err := http.NewRequest("PUT", urls, body) 10925 if err != nil { 10926 return nil, err 10927 } 10928 req.Header = reqHeaders 10929 googleapi.Expand(req.URL, map[string]string{ 10930 "matchId": c.matchId, 10931 }) 10932 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10933} 10934 10935// Do executes the "games.turnBasedMatches.cancel" call. 10936func (c *TurnBasedMatchesCancelCall) Do(opts ...googleapi.CallOption) error { 10937 gensupport.SetOptions(c.urlParams_, opts...) 10938 res, err := c.doRequest("json") 10939 if err != nil { 10940 return err 10941 } 10942 defer googleapi.CloseBody(res) 10943 if err := googleapi.CheckResponse(res); err != nil { 10944 return err 10945 } 10946 return nil 10947 // { 10948 // "description": "Cancel a turn-based match.", 10949 // "httpMethod": "PUT", 10950 // "id": "games.turnBasedMatches.cancel", 10951 // "parameterOrder": [ 10952 // "matchId" 10953 // ], 10954 // "parameters": { 10955 // "matchId": { 10956 // "description": "The ID of the match.", 10957 // "location": "path", 10958 // "required": true, 10959 // "type": "string" 10960 // } 10961 // }, 10962 // "path": "turnbasedmatches/{matchId}/cancel", 10963 // "scopes": [ 10964 // "https://www.googleapis.com/auth/games" 10965 // ] 10966 // } 10967 10968} 10969 10970// method id "games.turnBasedMatches.create": 10971 10972type TurnBasedMatchesCreateCall struct { 10973 s *Service 10974 turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest 10975 urlParams_ gensupport.URLParams 10976 ctx_ context.Context 10977 header_ http.Header 10978} 10979 10980// Create: Create a turn-based match. 10981func (r *TurnBasedMatchesService) Create(turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest) *TurnBasedMatchesCreateCall { 10982 c := &TurnBasedMatchesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10983 c.turnbasedmatchcreaterequest = turnbasedmatchcreaterequest 10984 return c 10985} 10986 10987// Language sets the optional parameter "language": The preferred 10988// language to use for strings returned by this method. 10989func (c *TurnBasedMatchesCreateCall) Language(language string) *TurnBasedMatchesCreateCall { 10990 c.urlParams_.Set("language", language) 10991 return c 10992} 10993 10994// Fields allows partial responses to be retrieved. See 10995// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10996// for more information. 10997func (c *TurnBasedMatchesCreateCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCreateCall { 10998 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10999 return c 11000} 11001 11002// Context sets the context to be used in this call's Do method. Any 11003// pending HTTP request will be aborted if the provided context is 11004// canceled. 11005func (c *TurnBasedMatchesCreateCall) Context(ctx context.Context) *TurnBasedMatchesCreateCall { 11006 c.ctx_ = ctx 11007 return c 11008} 11009 11010// Header returns an http.Header that can be modified by the caller to 11011// add HTTP headers to the request. 11012func (c *TurnBasedMatchesCreateCall) Header() http.Header { 11013 if c.header_ == nil { 11014 c.header_ = make(http.Header) 11015 } 11016 return c.header_ 11017} 11018 11019func (c *TurnBasedMatchesCreateCall) doRequest(alt string) (*http.Response, error) { 11020 reqHeaders := make(http.Header) 11021 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 11022 for k, v := range c.header_ { 11023 reqHeaders[k] = v 11024 } 11025 reqHeaders.Set("User-Agent", c.s.userAgent()) 11026 var body io.Reader = nil 11027 body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchcreaterequest) 11028 if err != nil { 11029 return nil, err 11030 } 11031 reqHeaders.Set("Content-Type", "application/json") 11032 c.urlParams_.Set("alt", alt) 11033 c.urlParams_.Set("prettyPrint", "false") 11034 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/create") 11035 urls += "?" + c.urlParams_.Encode() 11036 req, err := http.NewRequest("POST", urls, body) 11037 if err != nil { 11038 return nil, err 11039 } 11040 req.Header = reqHeaders 11041 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11042} 11043 11044// Do executes the "games.turnBasedMatches.create" call. 11045// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 11046// status code is an error. Response headers are in either 11047// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 11048// at all) in error.(*googleapi.Error).Header. Use 11049// googleapi.IsNotModified to check whether the returned error was 11050// because http.StatusNotModified was returned. 11051func (c *TurnBasedMatchesCreateCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 11052 gensupport.SetOptions(c.urlParams_, opts...) 11053 res, err := c.doRequest("json") 11054 if res != nil && res.StatusCode == http.StatusNotModified { 11055 if res.Body != nil { 11056 res.Body.Close() 11057 } 11058 return nil, &googleapi.Error{ 11059 Code: res.StatusCode, 11060 Header: res.Header, 11061 } 11062 } 11063 if err != nil { 11064 return nil, err 11065 } 11066 defer googleapi.CloseBody(res) 11067 if err := googleapi.CheckResponse(res); err != nil { 11068 return nil, err 11069 } 11070 ret := &TurnBasedMatch{ 11071 ServerResponse: googleapi.ServerResponse{ 11072 Header: res.Header, 11073 HTTPStatusCode: res.StatusCode, 11074 }, 11075 } 11076 target := &ret 11077 if err := gensupport.DecodeResponse(target, res); err != nil { 11078 return nil, err 11079 } 11080 return ret, nil 11081 // { 11082 // "description": "Create a turn-based match.", 11083 // "httpMethod": "POST", 11084 // "id": "games.turnBasedMatches.create", 11085 // "parameters": { 11086 // "language": { 11087 // "description": "The preferred language to use for strings returned by this method.", 11088 // "location": "query", 11089 // "type": "string" 11090 // } 11091 // }, 11092 // "path": "turnbasedmatches/create", 11093 // "request": { 11094 // "$ref": "TurnBasedMatchCreateRequest" 11095 // }, 11096 // "response": { 11097 // "$ref": "TurnBasedMatch" 11098 // }, 11099 // "scopes": [ 11100 // "https://www.googleapis.com/auth/games" 11101 // ] 11102 // } 11103 11104} 11105 11106// method id "games.turnBasedMatches.decline": 11107 11108type TurnBasedMatchesDeclineCall struct { 11109 s *Service 11110 matchId string 11111 urlParams_ gensupport.URLParams 11112 ctx_ context.Context 11113 header_ http.Header 11114} 11115 11116// Decline: Decline an invitation to play a turn-based match. 11117func (r *TurnBasedMatchesService) Decline(matchId string) *TurnBasedMatchesDeclineCall { 11118 c := &TurnBasedMatchesDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11119 c.matchId = matchId 11120 return c 11121} 11122 11123// Language sets the optional parameter "language": The preferred 11124// language to use for strings returned by this method. 11125func (c *TurnBasedMatchesDeclineCall) Language(language string) *TurnBasedMatchesDeclineCall { 11126 c.urlParams_.Set("language", language) 11127 return c 11128} 11129 11130// Fields allows partial responses to be retrieved. See 11131// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11132// for more information. 11133func (c *TurnBasedMatchesDeclineCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDeclineCall { 11134 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11135 return c 11136} 11137 11138// Context sets the context to be used in this call's Do method. Any 11139// pending HTTP request will be aborted if the provided context is 11140// canceled. 11141func (c *TurnBasedMatchesDeclineCall) Context(ctx context.Context) *TurnBasedMatchesDeclineCall { 11142 c.ctx_ = ctx 11143 return c 11144} 11145 11146// Header returns an http.Header that can be modified by the caller to 11147// add HTTP headers to the request. 11148func (c *TurnBasedMatchesDeclineCall) Header() http.Header { 11149 if c.header_ == nil { 11150 c.header_ = make(http.Header) 11151 } 11152 return c.header_ 11153} 11154 11155func (c *TurnBasedMatchesDeclineCall) doRequest(alt string) (*http.Response, error) { 11156 reqHeaders := make(http.Header) 11157 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 11158 for k, v := range c.header_ { 11159 reqHeaders[k] = v 11160 } 11161 reqHeaders.Set("User-Agent", c.s.userAgent()) 11162 var body io.Reader = nil 11163 c.urlParams_.Set("alt", alt) 11164 c.urlParams_.Set("prettyPrint", "false") 11165 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/decline") 11166 urls += "?" + c.urlParams_.Encode() 11167 req, err := http.NewRequest("PUT", urls, body) 11168 if err != nil { 11169 return nil, err 11170 } 11171 req.Header = reqHeaders 11172 googleapi.Expand(req.URL, map[string]string{ 11173 "matchId": c.matchId, 11174 }) 11175 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11176} 11177 11178// Do executes the "games.turnBasedMatches.decline" call. 11179// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 11180// status code is an error. Response headers are in either 11181// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 11182// at all) in error.(*googleapi.Error).Header. Use 11183// googleapi.IsNotModified to check whether the returned error was 11184// because http.StatusNotModified was returned. 11185func (c *TurnBasedMatchesDeclineCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 11186 gensupport.SetOptions(c.urlParams_, opts...) 11187 res, err := c.doRequest("json") 11188 if res != nil && res.StatusCode == http.StatusNotModified { 11189 if res.Body != nil { 11190 res.Body.Close() 11191 } 11192 return nil, &googleapi.Error{ 11193 Code: res.StatusCode, 11194 Header: res.Header, 11195 } 11196 } 11197 if err != nil { 11198 return nil, err 11199 } 11200 defer googleapi.CloseBody(res) 11201 if err := googleapi.CheckResponse(res); err != nil { 11202 return nil, err 11203 } 11204 ret := &TurnBasedMatch{ 11205 ServerResponse: googleapi.ServerResponse{ 11206 Header: res.Header, 11207 HTTPStatusCode: res.StatusCode, 11208 }, 11209 } 11210 target := &ret 11211 if err := gensupport.DecodeResponse(target, res); err != nil { 11212 return nil, err 11213 } 11214 return ret, nil 11215 // { 11216 // "description": "Decline an invitation to play a turn-based match.", 11217 // "httpMethod": "PUT", 11218 // "id": "games.turnBasedMatches.decline", 11219 // "parameterOrder": [ 11220 // "matchId" 11221 // ], 11222 // "parameters": { 11223 // "language": { 11224 // "description": "The preferred language to use for strings returned by this method.", 11225 // "location": "query", 11226 // "type": "string" 11227 // }, 11228 // "matchId": { 11229 // "description": "The ID of the match.", 11230 // "location": "path", 11231 // "required": true, 11232 // "type": "string" 11233 // } 11234 // }, 11235 // "path": "turnbasedmatches/{matchId}/decline", 11236 // "response": { 11237 // "$ref": "TurnBasedMatch" 11238 // }, 11239 // "scopes": [ 11240 // "https://www.googleapis.com/auth/games" 11241 // ] 11242 // } 11243 11244} 11245 11246// method id "games.turnBasedMatches.dismiss": 11247 11248type TurnBasedMatchesDismissCall struct { 11249 s *Service 11250 matchId string 11251 urlParams_ gensupport.URLParams 11252 ctx_ context.Context 11253 header_ http.Header 11254} 11255 11256// Dismiss: Dismiss a turn-based match from the match list. The match 11257// will no longer show up in the list and will not generate 11258// notifications. 11259func (r *TurnBasedMatchesService) Dismiss(matchId string) *TurnBasedMatchesDismissCall { 11260 c := &TurnBasedMatchesDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11261 c.matchId = matchId 11262 return c 11263} 11264 11265// Fields allows partial responses to be retrieved. See 11266// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11267// for more information. 11268func (c *TurnBasedMatchesDismissCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDismissCall { 11269 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11270 return c 11271} 11272 11273// Context sets the context to be used in this call's Do method. Any 11274// pending HTTP request will be aborted if the provided context is 11275// canceled. 11276func (c *TurnBasedMatchesDismissCall) Context(ctx context.Context) *TurnBasedMatchesDismissCall { 11277 c.ctx_ = ctx 11278 return c 11279} 11280 11281// Header returns an http.Header that can be modified by the caller to 11282// add HTTP headers to the request. 11283func (c *TurnBasedMatchesDismissCall) Header() http.Header { 11284 if c.header_ == nil { 11285 c.header_ = make(http.Header) 11286 } 11287 return c.header_ 11288} 11289 11290func (c *TurnBasedMatchesDismissCall) doRequest(alt string) (*http.Response, error) { 11291 reqHeaders := make(http.Header) 11292 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 11293 for k, v := range c.header_ { 11294 reqHeaders[k] = v 11295 } 11296 reqHeaders.Set("User-Agent", c.s.userAgent()) 11297 var body io.Reader = nil 11298 c.urlParams_.Set("alt", alt) 11299 c.urlParams_.Set("prettyPrint", "false") 11300 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/dismiss") 11301 urls += "?" + c.urlParams_.Encode() 11302 req, err := http.NewRequest("PUT", urls, body) 11303 if err != nil { 11304 return nil, err 11305 } 11306 req.Header = reqHeaders 11307 googleapi.Expand(req.URL, map[string]string{ 11308 "matchId": c.matchId, 11309 }) 11310 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11311} 11312 11313// Do executes the "games.turnBasedMatches.dismiss" call. 11314func (c *TurnBasedMatchesDismissCall) Do(opts ...googleapi.CallOption) error { 11315 gensupport.SetOptions(c.urlParams_, opts...) 11316 res, err := c.doRequest("json") 11317 if err != nil { 11318 return err 11319 } 11320 defer googleapi.CloseBody(res) 11321 if err := googleapi.CheckResponse(res); err != nil { 11322 return err 11323 } 11324 return nil 11325 // { 11326 // "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.", 11327 // "httpMethod": "PUT", 11328 // "id": "games.turnBasedMatches.dismiss", 11329 // "parameterOrder": [ 11330 // "matchId" 11331 // ], 11332 // "parameters": { 11333 // "matchId": { 11334 // "description": "The ID of the match.", 11335 // "location": "path", 11336 // "required": true, 11337 // "type": "string" 11338 // } 11339 // }, 11340 // "path": "turnbasedmatches/{matchId}/dismiss", 11341 // "scopes": [ 11342 // "https://www.googleapis.com/auth/games" 11343 // ] 11344 // } 11345 11346} 11347 11348// method id "games.turnBasedMatches.finish": 11349 11350type TurnBasedMatchesFinishCall struct { 11351 s *Service 11352 matchId string 11353 turnbasedmatchresults *TurnBasedMatchResults 11354 urlParams_ gensupport.URLParams 11355 ctx_ context.Context 11356 header_ http.Header 11357} 11358 11359// Finish: Finish a turn-based match. Each player should make this call 11360// once, after all results are in. Only the player whose turn it is may 11361// make the first call to Finish, and can pass in the final match state. 11362func (r *TurnBasedMatchesService) Finish(matchId string, turnbasedmatchresults *TurnBasedMatchResults) *TurnBasedMatchesFinishCall { 11363 c := &TurnBasedMatchesFinishCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11364 c.matchId = matchId 11365 c.turnbasedmatchresults = turnbasedmatchresults 11366 return c 11367} 11368 11369// Language sets the optional parameter "language": The preferred 11370// language to use for strings returned by this method. 11371func (c *TurnBasedMatchesFinishCall) Language(language string) *TurnBasedMatchesFinishCall { 11372 c.urlParams_.Set("language", language) 11373 return c 11374} 11375 11376// Fields allows partial responses to be retrieved. See 11377// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11378// for more information. 11379func (c *TurnBasedMatchesFinishCall) Fields(s ...googleapi.Field) *TurnBasedMatchesFinishCall { 11380 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11381 return c 11382} 11383 11384// Context sets the context to be used in this call's Do method. Any 11385// pending HTTP request will be aborted if the provided context is 11386// canceled. 11387func (c *TurnBasedMatchesFinishCall) Context(ctx context.Context) *TurnBasedMatchesFinishCall { 11388 c.ctx_ = ctx 11389 return c 11390} 11391 11392// Header returns an http.Header that can be modified by the caller to 11393// add HTTP headers to the request. 11394func (c *TurnBasedMatchesFinishCall) Header() http.Header { 11395 if c.header_ == nil { 11396 c.header_ = make(http.Header) 11397 } 11398 return c.header_ 11399} 11400 11401func (c *TurnBasedMatchesFinishCall) doRequest(alt string) (*http.Response, error) { 11402 reqHeaders := make(http.Header) 11403 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 11404 for k, v := range c.header_ { 11405 reqHeaders[k] = v 11406 } 11407 reqHeaders.Set("User-Agent", c.s.userAgent()) 11408 var body io.Reader = nil 11409 body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchresults) 11410 if err != nil { 11411 return nil, err 11412 } 11413 reqHeaders.Set("Content-Type", "application/json") 11414 c.urlParams_.Set("alt", alt) 11415 c.urlParams_.Set("prettyPrint", "false") 11416 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/finish") 11417 urls += "?" + c.urlParams_.Encode() 11418 req, err := http.NewRequest("PUT", urls, body) 11419 if err != nil { 11420 return nil, err 11421 } 11422 req.Header = reqHeaders 11423 googleapi.Expand(req.URL, map[string]string{ 11424 "matchId": c.matchId, 11425 }) 11426 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11427} 11428 11429// Do executes the "games.turnBasedMatches.finish" call. 11430// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 11431// status code is an error. Response headers are in either 11432// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 11433// at all) in error.(*googleapi.Error).Header. Use 11434// googleapi.IsNotModified to check whether the returned error was 11435// because http.StatusNotModified was returned. 11436func (c *TurnBasedMatchesFinishCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 11437 gensupport.SetOptions(c.urlParams_, opts...) 11438 res, err := c.doRequest("json") 11439 if res != nil && res.StatusCode == http.StatusNotModified { 11440 if res.Body != nil { 11441 res.Body.Close() 11442 } 11443 return nil, &googleapi.Error{ 11444 Code: res.StatusCode, 11445 Header: res.Header, 11446 } 11447 } 11448 if err != nil { 11449 return nil, err 11450 } 11451 defer googleapi.CloseBody(res) 11452 if err := googleapi.CheckResponse(res); err != nil { 11453 return nil, err 11454 } 11455 ret := &TurnBasedMatch{ 11456 ServerResponse: googleapi.ServerResponse{ 11457 Header: res.Header, 11458 HTTPStatusCode: res.StatusCode, 11459 }, 11460 } 11461 target := &ret 11462 if err := gensupport.DecodeResponse(target, res); err != nil { 11463 return nil, err 11464 } 11465 return ret, nil 11466 // { 11467 // "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.", 11468 // "httpMethod": "PUT", 11469 // "id": "games.turnBasedMatches.finish", 11470 // "parameterOrder": [ 11471 // "matchId" 11472 // ], 11473 // "parameters": { 11474 // "language": { 11475 // "description": "The preferred language to use for strings returned by this method.", 11476 // "location": "query", 11477 // "type": "string" 11478 // }, 11479 // "matchId": { 11480 // "description": "The ID of the match.", 11481 // "location": "path", 11482 // "required": true, 11483 // "type": "string" 11484 // } 11485 // }, 11486 // "path": "turnbasedmatches/{matchId}/finish", 11487 // "request": { 11488 // "$ref": "TurnBasedMatchResults" 11489 // }, 11490 // "response": { 11491 // "$ref": "TurnBasedMatch" 11492 // }, 11493 // "scopes": [ 11494 // "https://www.googleapis.com/auth/games" 11495 // ] 11496 // } 11497 11498} 11499 11500// method id "games.turnBasedMatches.get": 11501 11502type TurnBasedMatchesGetCall struct { 11503 s *Service 11504 matchId string 11505 urlParams_ gensupport.URLParams 11506 ifNoneMatch_ string 11507 ctx_ context.Context 11508 header_ http.Header 11509} 11510 11511// Get: Get the data for a turn-based match. 11512func (r *TurnBasedMatchesService) Get(matchId string) *TurnBasedMatchesGetCall { 11513 c := &TurnBasedMatchesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11514 c.matchId = matchId 11515 return c 11516} 11517 11518// IncludeMatchData sets the optional parameter "includeMatchData": Get 11519// match data along with metadata. 11520func (c *TurnBasedMatchesGetCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesGetCall { 11521 c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData)) 11522 return c 11523} 11524 11525// Language sets the optional parameter "language": The preferred 11526// language to use for strings returned by this method. 11527func (c *TurnBasedMatchesGetCall) Language(language string) *TurnBasedMatchesGetCall { 11528 c.urlParams_.Set("language", language) 11529 return c 11530} 11531 11532// Fields allows partial responses to be retrieved. See 11533// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11534// for more information. 11535func (c *TurnBasedMatchesGetCall) Fields(s ...googleapi.Field) *TurnBasedMatchesGetCall { 11536 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11537 return c 11538} 11539 11540// IfNoneMatch sets the optional parameter which makes the operation 11541// fail if the object's ETag matches the given value. This is useful for 11542// getting updates only after the object has changed since the last 11543// request. Use googleapi.IsNotModified to check whether the response 11544// error from Do is the result of In-None-Match. 11545func (c *TurnBasedMatchesGetCall) IfNoneMatch(entityTag string) *TurnBasedMatchesGetCall { 11546 c.ifNoneMatch_ = entityTag 11547 return c 11548} 11549 11550// Context sets the context to be used in this call's Do method. Any 11551// pending HTTP request will be aborted if the provided context is 11552// canceled. 11553func (c *TurnBasedMatchesGetCall) Context(ctx context.Context) *TurnBasedMatchesGetCall { 11554 c.ctx_ = ctx 11555 return c 11556} 11557 11558// Header returns an http.Header that can be modified by the caller to 11559// add HTTP headers to the request. 11560func (c *TurnBasedMatchesGetCall) Header() http.Header { 11561 if c.header_ == nil { 11562 c.header_ = make(http.Header) 11563 } 11564 return c.header_ 11565} 11566 11567func (c *TurnBasedMatchesGetCall) doRequest(alt string) (*http.Response, error) { 11568 reqHeaders := make(http.Header) 11569 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 11570 for k, v := range c.header_ { 11571 reqHeaders[k] = v 11572 } 11573 reqHeaders.Set("User-Agent", c.s.userAgent()) 11574 if c.ifNoneMatch_ != "" { 11575 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11576 } 11577 var body io.Reader = nil 11578 c.urlParams_.Set("alt", alt) 11579 c.urlParams_.Set("prettyPrint", "false") 11580 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}") 11581 urls += "?" + c.urlParams_.Encode() 11582 req, err := http.NewRequest("GET", urls, body) 11583 if err != nil { 11584 return nil, err 11585 } 11586 req.Header = reqHeaders 11587 googleapi.Expand(req.URL, map[string]string{ 11588 "matchId": c.matchId, 11589 }) 11590 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11591} 11592 11593// Do executes the "games.turnBasedMatches.get" call. 11594// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 11595// status code is an error. Response headers are in either 11596// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 11597// at all) in error.(*googleapi.Error).Header. Use 11598// googleapi.IsNotModified to check whether the returned error was 11599// because http.StatusNotModified was returned. 11600func (c *TurnBasedMatchesGetCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 11601 gensupport.SetOptions(c.urlParams_, opts...) 11602 res, err := c.doRequest("json") 11603 if res != nil && res.StatusCode == http.StatusNotModified { 11604 if res.Body != nil { 11605 res.Body.Close() 11606 } 11607 return nil, &googleapi.Error{ 11608 Code: res.StatusCode, 11609 Header: res.Header, 11610 } 11611 } 11612 if err != nil { 11613 return nil, err 11614 } 11615 defer googleapi.CloseBody(res) 11616 if err := googleapi.CheckResponse(res); err != nil { 11617 return nil, err 11618 } 11619 ret := &TurnBasedMatch{ 11620 ServerResponse: googleapi.ServerResponse{ 11621 Header: res.Header, 11622 HTTPStatusCode: res.StatusCode, 11623 }, 11624 } 11625 target := &ret 11626 if err := gensupport.DecodeResponse(target, res); err != nil { 11627 return nil, err 11628 } 11629 return ret, nil 11630 // { 11631 // "description": "Get the data for a turn-based match.", 11632 // "httpMethod": "GET", 11633 // "id": "games.turnBasedMatches.get", 11634 // "parameterOrder": [ 11635 // "matchId" 11636 // ], 11637 // "parameters": { 11638 // "includeMatchData": { 11639 // "description": "Get match data along with metadata.", 11640 // "location": "query", 11641 // "type": "boolean" 11642 // }, 11643 // "language": { 11644 // "description": "The preferred language to use for strings returned by this method.", 11645 // "location": "query", 11646 // "type": "string" 11647 // }, 11648 // "matchId": { 11649 // "description": "The ID of the match.", 11650 // "location": "path", 11651 // "required": true, 11652 // "type": "string" 11653 // } 11654 // }, 11655 // "path": "turnbasedmatches/{matchId}", 11656 // "response": { 11657 // "$ref": "TurnBasedMatch" 11658 // }, 11659 // "scopes": [ 11660 // "https://www.googleapis.com/auth/games" 11661 // ] 11662 // } 11663 11664} 11665 11666// method id "games.turnBasedMatches.join": 11667 11668type TurnBasedMatchesJoinCall struct { 11669 s *Service 11670 matchId string 11671 urlParams_ gensupport.URLParams 11672 ctx_ context.Context 11673 header_ http.Header 11674} 11675 11676// Join: Join a turn-based match. 11677func (r *TurnBasedMatchesService) Join(matchId string) *TurnBasedMatchesJoinCall { 11678 c := &TurnBasedMatchesJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11679 c.matchId = matchId 11680 return c 11681} 11682 11683// Language sets the optional parameter "language": The preferred 11684// language to use for strings returned by this method. 11685func (c *TurnBasedMatchesJoinCall) Language(language string) *TurnBasedMatchesJoinCall { 11686 c.urlParams_.Set("language", language) 11687 return c 11688} 11689 11690// Fields allows partial responses to be retrieved. See 11691// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11692// for more information. 11693func (c *TurnBasedMatchesJoinCall) Fields(s ...googleapi.Field) *TurnBasedMatchesJoinCall { 11694 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11695 return c 11696} 11697 11698// Context sets the context to be used in this call's Do method. Any 11699// pending HTTP request will be aborted if the provided context is 11700// canceled. 11701func (c *TurnBasedMatchesJoinCall) Context(ctx context.Context) *TurnBasedMatchesJoinCall { 11702 c.ctx_ = ctx 11703 return c 11704} 11705 11706// Header returns an http.Header that can be modified by the caller to 11707// add HTTP headers to the request. 11708func (c *TurnBasedMatchesJoinCall) Header() http.Header { 11709 if c.header_ == nil { 11710 c.header_ = make(http.Header) 11711 } 11712 return c.header_ 11713} 11714 11715func (c *TurnBasedMatchesJoinCall) doRequest(alt string) (*http.Response, error) { 11716 reqHeaders := make(http.Header) 11717 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 11718 for k, v := range c.header_ { 11719 reqHeaders[k] = v 11720 } 11721 reqHeaders.Set("User-Agent", c.s.userAgent()) 11722 var body io.Reader = nil 11723 c.urlParams_.Set("alt", alt) 11724 c.urlParams_.Set("prettyPrint", "false") 11725 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/join") 11726 urls += "?" + c.urlParams_.Encode() 11727 req, err := http.NewRequest("PUT", urls, body) 11728 if err != nil { 11729 return nil, err 11730 } 11731 req.Header = reqHeaders 11732 googleapi.Expand(req.URL, map[string]string{ 11733 "matchId": c.matchId, 11734 }) 11735 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11736} 11737 11738// Do executes the "games.turnBasedMatches.join" call. 11739// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 11740// status code is an error. Response headers are in either 11741// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 11742// at all) in error.(*googleapi.Error).Header. Use 11743// googleapi.IsNotModified to check whether the returned error was 11744// because http.StatusNotModified was returned. 11745func (c *TurnBasedMatchesJoinCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 11746 gensupport.SetOptions(c.urlParams_, opts...) 11747 res, err := c.doRequest("json") 11748 if res != nil && res.StatusCode == http.StatusNotModified { 11749 if res.Body != nil { 11750 res.Body.Close() 11751 } 11752 return nil, &googleapi.Error{ 11753 Code: res.StatusCode, 11754 Header: res.Header, 11755 } 11756 } 11757 if err != nil { 11758 return nil, err 11759 } 11760 defer googleapi.CloseBody(res) 11761 if err := googleapi.CheckResponse(res); err != nil { 11762 return nil, err 11763 } 11764 ret := &TurnBasedMatch{ 11765 ServerResponse: googleapi.ServerResponse{ 11766 Header: res.Header, 11767 HTTPStatusCode: res.StatusCode, 11768 }, 11769 } 11770 target := &ret 11771 if err := gensupport.DecodeResponse(target, res); err != nil { 11772 return nil, err 11773 } 11774 return ret, nil 11775 // { 11776 // "description": "Join a turn-based match.", 11777 // "httpMethod": "PUT", 11778 // "id": "games.turnBasedMatches.join", 11779 // "parameterOrder": [ 11780 // "matchId" 11781 // ], 11782 // "parameters": { 11783 // "language": { 11784 // "description": "The preferred language to use for strings returned by this method.", 11785 // "location": "query", 11786 // "type": "string" 11787 // }, 11788 // "matchId": { 11789 // "description": "The ID of the match.", 11790 // "location": "path", 11791 // "required": true, 11792 // "type": "string" 11793 // } 11794 // }, 11795 // "path": "turnbasedmatches/{matchId}/join", 11796 // "response": { 11797 // "$ref": "TurnBasedMatch" 11798 // }, 11799 // "scopes": [ 11800 // "https://www.googleapis.com/auth/games" 11801 // ] 11802 // } 11803 11804} 11805 11806// method id "games.turnBasedMatches.leave": 11807 11808type TurnBasedMatchesLeaveCall struct { 11809 s *Service 11810 matchId string 11811 urlParams_ gensupport.URLParams 11812 ctx_ context.Context 11813 header_ http.Header 11814} 11815 11816// Leave: Leave a turn-based match when it is not the current player's 11817// turn, without canceling the match. 11818func (r *TurnBasedMatchesService) Leave(matchId string) *TurnBasedMatchesLeaveCall { 11819 c := &TurnBasedMatchesLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11820 c.matchId = matchId 11821 return c 11822} 11823 11824// Language sets the optional parameter "language": The preferred 11825// language to use for strings returned by this method. 11826func (c *TurnBasedMatchesLeaveCall) Language(language string) *TurnBasedMatchesLeaveCall { 11827 c.urlParams_.Set("language", language) 11828 return c 11829} 11830 11831// Fields allows partial responses to be retrieved. See 11832// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11833// for more information. 11834func (c *TurnBasedMatchesLeaveCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveCall { 11835 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11836 return c 11837} 11838 11839// Context sets the context to be used in this call's Do method. Any 11840// pending HTTP request will be aborted if the provided context is 11841// canceled. 11842func (c *TurnBasedMatchesLeaveCall) Context(ctx context.Context) *TurnBasedMatchesLeaveCall { 11843 c.ctx_ = ctx 11844 return c 11845} 11846 11847// Header returns an http.Header that can be modified by the caller to 11848// add HTTP headers to the request. 11849func (c *TurnBasedMatchesLeaveCall) Header() http.Header { 11850 if c.header_ == nil { 11851 c.header_ = make(http.Header) 11852 } 11853 return c.header_ 11854} 11855 11856func (c *TurnBasedMatchesLeaveCall) doRequest(alt string) (*http.Response, error) { 11857 reqHeaders := make(http.Header) 11858 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 11859 for k, v := range c.header_ { 11860 reqHeaders[k] = v 11861 } 11862 reqHeaders.Set("User-Agent", c.s.userAgent()) 11863 var body io.Reader = nil 11864 c.urlParams_.Set("alt", alt) 11865 c.urlParams_.Set("prettyPrint", "false") 11866 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leave") 11867 urls += "?" + c.urlParams_.Encode() 11868 req, err := http.NewRequest("PUT", urls, body) 11869 if err != nil { 11870 return nil, err 11871 } 11872 req.Header = reqHeaders 11873 googleapi.Expand(req.URL, map[string]string{ 11874 "matchId": c.matchId, 11875 }) 11876 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11877} 11878 11879// Do executes the "games.turnBasedMatches.leave" call. 11880// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 11881// status code is an error. Response headers are in either 11882// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 11883// at all) in error.(*googleapi.Error).Header. Use 11884// googleapi.IsNotModified to check whether the returned error was 11885// because http.StatusNotModified was returned. 11886func (c *TurnBasedMatchesLeaveCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 11887 gensupport.SetOptions(c.urlParams_, opts...) 11888 res, err := c.doRequest("json") 11889 if res != nil && res.StatusCode == http.StatusNotModified { 11890 if res.Body != nil { 11891 res.Body.Close() 11892 } 11893 return nil, &googleapi.Error{ 11894 Code: res.StatusCode, 11895 Header: res.Header, 11896 } 11897 } 11898 if err != nil { 11899 return nil, err 11900 } 11901 defer googleapi.CloseBody(res) 11902 if err := googleapi.CheckResponse(res); err != nil { 11903 return nil, err 11904 } 11905 ret := &TurnBasedMatch{ 11906 ServerResponse: googleapi.ServerResponse{ 11907 Header: res.Header, 11908 HTTPStatusCode: res.StatusCode, 11909 }, 11910 } 11911 target := &ret 11912 if err := gensupport.DecodeResponse(target, res); err != nil { 11913 return nil, err 11914 } 11915 return ret, nil 11916 // { 11917 // "description": "Leave a turn-based match when it is not the current player's turn, without canceling the match.", 11918 // "httpMethod": "PUT", 11919 // "id": "games.turnBasedMatches.leave", 11920 // "parameterOrder": [ 11921 // "matchId" 11922 // ], 11923 // "parameters": { 11924 // "language": { 11925 // "description": "The preferred language to use for strings returned by this method.", 11926 // "location": "query", 11927 // "type": "string" 11928 // }, 11929 // "matchId": { 11930 // "description": "The ID of the match.", 11931 // "location": "path", 11932 // "required": true, 11933 // "type": "string" 11934 // } 11935 // }, 11936 // "path": "turnbasedmatches/{matchId}/leave", 11937 // "response": { 11938 // "$ref": "TurnBasedMatch" 11939 // }, 11940 // "scopes": [ 11941 // "https://www.googleapis.com/auth/games" 11942 // ] 11943 // } 11944 11945} 11946 11947// method id "games.turnBasedMatches.leaveTurn": 11948 11949type TurnBasedMatchesLeaveTurnCall struct { 11950 s *Service 11951 matchId string 11952 urlParams_ gensupport.URLParams 11953 ctx_ context.Context 11954 header_ http.Header 11955} 11956 11957// LeaveTurn: Leave a turn-based match during the current player's turn, 11958// without canceling the match. 11959func (r *TurnBasedMatchesService) LeaveTurn(matchId string, matchVersion int64) *TurnBasedMatchesLeaveTurnCall { 11960 c := &TurnBasedMatchesLeaveTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11961 c.matchId = matchId 11962 c.urlParams_.Set("matchVersion", fmt.Sprint(matchVersion)) 11963 return c 11964} 11965 11966// Language sets the optional parameter "language": The preferred 11967// language to use for strings returned by this method. 11968func (c *TurnBasedMatchesLeaveTurnCall) Language(language string) *TurnBasedMatchesLeaveTurnCall { 11969 c.urlParams_.Set("language", language) 11970 return c 11971} 11972 11973// PendingParticipantId sets the optional parameter 11974// "pendingParticipantId": The ID of another participant who should take 11975// their turn next. If not set, the match will wait for other player(s) 11976// to join via automatching; this is only valid if automatch criteria is 11977// set on the match with remaining slots for automatched players. 11978func (c *TurnBasedMatchesLeaveTurnCall) PendingParticipantId(pendingParticipantId string) *TurnBasedMatchesLeaveTurnCall { 11979 c.urlParams_.Set("pendingParticipantId", pendingParticipantId) 11980 return c 11981} 11982 11983// Fields allows partial responses to be retrieved. See 11984// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11985// for more information. 11986func (c *TurnBasedMatchesLeaveTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveTurnCall { 11987 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11988 return c 11989} 11990 11991// Context sets the context to be used in this call's Do method. Any 11992// pending HTTP request will be aborted if the provided context is 11993// canceled. 11994func (c *TurnBasedMatchesLeaveTurnCall) Context(ctx context.Context) *TurnBasedMatchesLeaveTurnCall { 11995 c.ctx_ = ctx 11996 return c 11997} 11998 11999// Header returns an http.Header that can be modified by the caller to 12000// add HTTP headers to the request. 12001func (c *TurnBasedMatchesLeaveTurnCall) Header() http.Header { 12002 if c.header_ == nil { 12003 c.header_ = make(http.Header) 12004 } 12005 return c.header_ 12006} 12007 12008func (c *TurnBasedMatchesLeaveTurnCall) doRequest(alt string) (*http.Response, error) { 12009 reqHeaders := make(http.Header) 12010 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 12011 for k, v := range c.header_ { 12012 reqHeaders[k] = v 12013 } 12014 reqHeaders.Set("User-Agent", c.s.userAgent()) 12015 var body io.Reader = nil 12016 c.urlParams_.Set("alt", alt) 12017 c.urlParams_.Set("prettyPrint", "false") 12018 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leaveTurn") 12019 urls += "?" + c.urlParams_.Encode() 12020 req, err := http.NewRequest("PUT", urls, body) 12021 if err != nil { 12022 return nil, err 12023 } 12024 req.Header = reqHeaders 12025 googleapi.Expand(req.URL, map[string]string{ 12026 "matchId": c.matchId, 12027 }) 12028 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12029} 12030 12031// Do executes the "games.turnBasedMatches.leaveTurn" call. 12032// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 12033// status code is an error. Response headers are in either 12034// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 12035// at all) in error.(*googleapi.Error).Header. Use 12036// googleapi.IsNotModified to check whether the returned error was 12037// because http.StatusNotModified was returned. 12038func (c *TurnBasedMatchesLeaveTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 12039 gensupport.SetOptions(c.urlParams_, opts...) 12040 res, err := c.doRequest("json") 12041 if res != nil && res.StatusCode == http.StatusNotModified { 12042 if res.Body != nil { 12043 res.Body.Close() 12044 } 12045 return nil, &googleapi.Error{ 12046 Code: res.StatusCode, 12047 Header: res.Header, 12048 } 12049 } 12050 if err != nil { 12051 return nil, err 12052 } 12053 defer googleapi.CloseBody(res) 12054 if err := googleapi.CheckResponse(res); err != nil { 12055 return nil, err 12056 } 12057 ret := &TurnBasedMatch{ 12058 ServerResponse: googleapi.ServerResponse{ 12059 Header: res.Header, 12060 HTTPStatusCode: res.StatusCode, 12061 }, 12062 } 12063 target := &ret 12064 if err := gensupport.DecodeResponse(target, res); err != nil { 12065 return nil, err 12066 } 12067 return ret, nil 12068 // { 12069 // "description": "Leave a turn-based match during the current player's turn, without canceling the match.", 12070 // "httpMethod": "PUT", 12071 // "id": "games.turnBasedMatches.leaveTurn", 12072 // "parameterOrder": [ 12073 // "matchId", 12074 // "matchVersion" 12075 // ], 12076 // "parameters": { 12077 // "language": { 12078 // "description": "The preferred language to use for strings returned by this method.", 12079 // "location": "query", 12080 // "type": "string" 12081 // }, 12082 // "matchId": { 12083 // "description": "The ID of the match.", 12084 // "location": "path", 12085 // "required": true, 12086 // "type": "string" 12087 // }, 12088 // "matchVersion": { 12089 // "description": "The version of the match being updated.", 12090 // "format": "int32", 12091 // "location": "query", 12092 // "required": true, 12093 // "type": "integer" 12094 // }, 12095 // "pendingParticipantId": { 12096 // "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.", 12097 // "location": "query", 12098 // "type": "string" 12099 // } 12100 // }, 12101 // "path": "turnbasedmatches/{matchId}/leaveTurn", 12102 // "response": { 12103 // "$ref": "TurnBasedMatch" 12104 // }, 12105 // "scopes": [ 12106 // "https://www.googleapis.com/auth/games" 12107 // ] 12108 // } 12109 12110} 12111 12112// method id "games.turnBasedMatches.list": 12113 12114type TurnBasedMatchesListCall struct { 12115 s *Service 12116 urlParams_ gensupport.URLParams 12117 ifNoneMatch_ string 12118 ctx_ context.Context 12119 header_ http.Header 12120} 12121 12122// List: Returns turn-based matches the player is or was involved in. 12123func (r *TurnBasedMatchesService) List() *TurnBasedMatchesListCall { 12124 c := &TurnBasedMatchesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12125 return c 12126} 12127 12128// IncludeMatchData sets the optional parameter "includeMatchData": True 12129// if match data should be returned in the response. Note that not all 12130// data will necessarily be returned if include_match_data is true; the 12131// server may decide to only return data for some of the matches to 12132// limit download size for the client. The remainder of the data for 12133// these matches will be retrievable on request. 12134func (c *TurnBasedMatchesListCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesListCall { 12135 c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData)) 12136 return c 12137} 12138 12139// Language sets the optional parameter "language": The preferred 12140// language to use for strings returned by this method. 12141func (c *TurnBasedMatchesListCall) Language(language string) *TurnBasedMatchesListCall { 12142 c.urlParams_.Set("language", language) 12143 return c 12144} 12145 12146// MaxCompletedMatches sets the optional parameter 12147// "maxCompletedMatches": The maximum number of completed or canceled 12148// matches to return in the response. If not set, all matches returned 12149// could be completed or canceled. 12150func (c *TurnBasedMatchesListCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesListCall { 12151 c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches)) 12152 return c 12153} 12154 12155// MaxResults sets the optional parameter "maxResults": The maximum 12156// number of matches to return in the response, used for paging. For any 12157// response, the actual number of matches to return may be less than the 12158// specified maxResults. 12159func (c *TurnBasedMatchesListCall) MaxResults(maxResults int64) *TurnBasedMatchesListCall { 12160 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 12161 return c 12162} 12163 12164// PageToken sets the optional parameter "pageToken": The token returned 12165// by the previous request. 12166func (c *TurnBasedMatchesListCall) PageToken(pageToken string) *TurnBasedMatchesListCall { 12167 c.urlParams_.Set("pageToken", pageToken) 12168 return c 12169} 12170 12171// Fields allows partial responses to be retrieved. See 12172// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12173// for more information. 12174func (c *TurnBasedMatchesListCall) Fields(s ...googleapi.Field) *TurnBasedMatchesListCall { 12175 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12176 return c 12177} 12178 12179// IfNoneMatch sets the optional parameter which makes the operation 12180// fail if the object's ETag matches the given value. This is useful for 12181// getting updates only after the object has changed since the last 12182// request. Use googleapi.IsNotModified to check whether the response 12183// error from Do is the result of In-None-Match. 12184func (c *TurnBasedMatchesListCall) IfNoneMatch(entityTag string) *TurnBasedMatchesListCall { 12185 c.ifNoneMatch_ = entityTag 12186 return c 12187} 12188 12189// Context sets the context to be used in this call's Do method. Any 12190// pending HTTP request will be aborted if the provided context is 12191// canceled. 12192func (c *TurnBasedMatchesListCall) Context(ctx context.Context) *TurnBasedMatchesListCall { 12193 c.ctx_ = ctx 12194 return c 12195} 12196 12197// Header returns an http.Header that can be modified by the caller to 12198// add HTTP headers to the request. 12199func (c *TurnBasedMatchesListCall) Header() http.Header { 12200 if c.header_ == nil { 12201 c.header_ = make(http.Header) 12202 } 12203 return c.header_ 12204} 12205 12206func (c *TurnBasedMatchesListCall) doRequest(alt string) (*http.Response, error) { 12207 reqHeaders := make(http.Header) 12208 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 12209 for k, v := range c.header_ { 12210 reqHeaders[k] = v 12211 } 12212 reqHeaders.Set("User-Agent", c.s.userAgent()) 12213 if c.ifNoneMatch_ != "" { 12214 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12215 } 12216 var body io.Reader = nil 12217 c.urlParams_.Set("alt", alt) 12218 c.urlParams_.Set("prettyPrint", "false") 12219 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches") 12220 urls += "?" + c.urlParams_.Encode() 12221 req, err := http.NewRequest("GET", urls, body) 12222 if err != nil { 12223 return nil, err 12224 } 12225 req.Header = reqHeaders 12226 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12227} 12228 12229// Do executes the "games.turnBasedMatches.list" call. 12230// Exactly one of *TurnBasedMatchList or error will be non-nil. Any 12231// non-2xx status code is an error. Response headers are in either 12232// *TurnBasedMatchList.ServerResponse.Header or (if a response was 12233// returned at all) in error.(*googleapi.Error).Header. Use 12234// googleapi.IsNotModified to check whether the returned error was 12235// because http.StatusNotModified was returned. 12236func (c *TurnBasedMatchesListCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchList, error) { 12237 gensupport.SetOptions(c.urlParams_, opts...) 12238 res, err := c.doRequest("json") 12239 if res != nil && res.StatusCode == http.StatusNotModified { 12240 if res.Body != nil { 12241 res.Body.Close() 12242 } 12243 return nil, &googleapi.Error{ 12244 Code: res.StatusCode, 12245 Header: res.Header, 12246 } 12247 } 12248 if err != nil { 12249 return nil, err 12250 } 12251 defer googleapi.CloseBody(res) 12252 if err := googleapi.CheckResponse(res); err != nil { 12253 return nil, err 12254 } 12255 ret := &TurnBasedMatchList{ 12256 ServerResponse: googleapi.ServerResponse{ 12257 Header: res.Header, 12258 HTTPStatusCode: res.StatusCode, 12259 }, 12260 } 12261 target := &ret 12262 if err := gensupport.DecodeResponse(target, res); err != nil { 12263 return nil, err 12264 } 12265 return ret, nil 12266 // { 12267 // "description": "Returns turn-based matches the player is or was involved in.", 12268 // "httpMethod": "GET", 12269 // "id": "games.turnBasedMatches.list", 12270 // "parameters": { 12271 // "includeMatchData": { 12272 // "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.", 12273 // "location": "query", 12274 // "type": "boolean" 12275 // }, 12276 // "language": { 12277 // "description": "The preferred language to use for strings returned by this method.", 12278 // "location": "query", 12279 // "type": "string" 12280 // }, 12281 // "maxCompletedMatches": { 12282 // "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.", 12283 // "format": "int32", 12284 // "location": "query", 12285 // "maximum": "500", 12286 // "minimum": "0", 12287 // "type": "integer" 12288 // }, 12289 // "maxResults": { 12290 // "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.", 12291 // "format": "int32", 12292 // "location": "query", 12293 // "maximum": "500", 12294 // "minimum": "1", 12295 // "type": "integer" 12296 // }, 12297 // "pageToken": { 12298 // "description": "The token returned by the previous request.", 12299 // "location": "query", 12300 // "type": "string" 12301 // } 12302 // }, 12303 // "path": "turnbasedmatches", 12304 // "response": { 12305 // "$ref": "TurnBasedMatchList" 12306 // }, 12307 // "scopes": [ 12308 // "https://www.googleapis.com/auth/games" 12309 // ] 12310 // } 12311 12312} 12313 12314// Pages invokes f for each page of results. 12315// A non-nil error returned from f will halt the iteration. 12316// The provided context supersedes any context provided to the Context method. 12317func (c *TurnBasedMatchesListCall) Pages(ctx context.Context, f func(*TurnBasedMatchList) error) error { 12318 c.ctx_ = ctx 12319 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 12320 for { 12321 x, err := c.Do() 12322 if err != nil { 12323 return err 12324 } 12325 if err := f(x); err != nil { 12326 return err 12327 } 12328 if x.NextPageToken == "" { 12329 return nil 12330 } 12331 c.PageToken(x.NextPageToken) 12332 } 12333} 12334 12335// method id "games.turnBasedMatches.rematch": 12336 12337type TurnBasedMatchesRematchCall struct { 12338 s *Service 12339 matchId string 12340 urlParams_ gensupport.URLParams 12341 ctx_ context.Context 12342 header_ http.Header 12343} 12344 12345// Rematch: Create a rematch of a match that was previously completed, 12346// with the same participants. This can be called by only one player on 12347// a match still in their list; the player must have called Finish 12348// first. Returns the newly created match; it will be the caller's turn. 12349func (r *TurnBasedMatchesService) Rematch(matchId string) *TurnBasedMatchesRematchCall { 12350 c := &TurnBasedMatchesRematchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12351 c.matchId = matchId 12352 return c 12353} 12354 12355// Language sets the optional parameter "language": The preferred 12356// language to use for strings returned by this method. 12357func (c *TurnBasedMatchesRematchCall) Language(language string) *TurnBasedMatchesRematchCall { 12358 c.urlParams_.Set("language", language) 12359 return c 12360} 12361 12362// RequestId sets the optional parameter "requestId": A randomly 12363// generated numeric ID for each request specified by the caller. This 12364// number is used at the server to ensure that the request is handled 12365// correctly across retries. 12366func (c *TurnBasedMatchesRematchCall) RequestId(requestId int64) *TurnBasedMatchesRematchCall { 12367 c.urlParams_.Set("requestId", fmt.Sprint(requestId)) 12368 return c 12369} 12370 12371// Fields allows partial responses to be retrieved. See 12372// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12373// for more information. 12374func (c *TurnBasedMatchesRematchCall) Fields(s ...googleapi.Field) *TurnBasedMatchesRematchCall { 12375 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12376 return c 12377} 12378 12379// Context sets the context to be used in this call's Do method. Any 12380// pending HTTP request will be aborted if the provided context is 12381// canceled. 12382func (c *TurnBasedMatchesRematchCall) Context(ctx context.Context) *TurnBasedMatchesRematchCall { 12383 c.ctx_ = ctx 12384 return c 12385} 12386 12387// Header returns an http.Header that can be modified by the caller to 12388// add HTTP headers to the request. 12389func (c *TurnBasedMatchesRematchCall) Header() http.Header { 12390 if c.header_ == nil { 12391 c.header_ = make(http.Header) 12392 } 12393 return c.header_ 12394} 12395 12396func (c *TurnBasedMatchesRematchCall) doRequest(alt string) (*http.Response, error) { 12397 reqHeaders := make(http.Header) 12398 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 12399 for k, v := range c.header_ { 12400 reqHeaders[k] = v 12401 } 12402 reqHeaders.Set("User-Agent", c.s.userAgent()) 12403 var body io.Reader = nil 12404 c.urlParams_.Set("alt", alt) 12405 c.urlParams_.Set("prettyPrint", "false") 12406 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/rematch") 12407 urls += "?" + c.urlParams_.Encode() 12408 req, err := http.NewRequest("POST", urls, body) 12409 if err != nil { 12410 return nil, err 12411 } 12412 req.Header = reqHeaders 12413 googleapi.Expand(req.URL, map[string]string{ 12414 "matchId": c.matchId, 12415 }) 12416 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12417} 12418 12419// Do executes the "games.turnBasedMatches.rematch" call. 12420// Exactly one of *TurnBasedMatchRematch or error will be non-nil. Any 12421// non-2xx status code is an error. Response headers are in either 12422// *TurnBasedMatchRematch.ServerResponse.Header or (if a response was 12423// returned at all) in error.(*googleapi.Error).Header. Use 12424// googleapi.IsNotModified to check whether the returned error was 12425// because http.StatusNotModified was returned. 12426func (c *TurnBasedMatchesRematchCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchRematch, error) { 12427 gensupport.SetOptions(c.urlParams_, opts...) 12428 res, err := c.doRequest("json") 12429 if res != nil && res.StatusCode == http.StatusNotModified { 12430 if res.Body != nil { 12431 res.Body.Close() 12432 } 12433 return nil, &googleapi.Error{ 12434 Code: res.StatusCode, 12435 Header: res.Header, 12436 } 12437 } 12438 if err != nil { 12439 return nil, err 12440 } 12441 defer googleapi.CloseBody(res) 12442 if err := googleapi.CheckResponse(res); err != nil { 12443 return nil, err 12444 } 12445 ret := &TurnBasedMatchRematch{ 12446 ServerResponse: googleapi.ServerResponse{ 12447 Header: res.Header, 12448 HTTPStatusCode: res.StatusCode, 12449 }, 12450 } 12451 target := &ret 12452 if err := gensupport.DecodeResponse(target, res); err != nil { 12453 return nil, err 12454 } 12455 return ret, nil 12456 // { 12457 // "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.", 12458 // "httpMethod": "POST", 12459 // "id": "games.turnBasedMatches.rematch", 12460 // "parameterOrder": [ 12461 // "matchId" 12462 // ], 12463 // "parameters": { 12464 // "language": { 12465 // "description": "The preferred language to use for strings returned by this method.", 12466 // "location": "query", 12467 // "type": "string" 12468 // }, 12469 // "matchId": { 12470 // "description": "The ID of the match.", 12471 // "location": "path", 12472 // "required": true, 12473 // "type": "string" 12474 // }, 12475 // "requestId": { 12476 // "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.", 12477 // "format": "int64", 12478 // "location": "query", 12479 // "type": "string" 12480 // } 12481 // }, 12482 // "path": "turnbasedmatches/{matchId}/rematch", 12483 // "response": { 12484 // "$ref": "TurnBasedMatchRematch" 12485 // }, 12486 // "scopes": [ 12487 // "https://www.googleapis.com/auth/games" 12488 // ] 12489 // } 12490 12491} 12492 12493// method id "games.turnBasedMatches.sync": 12494 12495type TurnBasedMatchesSyncCall struct { 12496 s *Service 12497 urlParams_ gensupport.URLParams 12498 ifNoneMatch_ string 12499 ctx_ context.Context 12500 header_ http.Header 12501} 12502 12503// Sync: Returns turn-based matches the player is or was involved in 12504// that changed since the last sync call, with the least recent changes 12505// coming first. Matches that should be removed from the local cache 12506// will have a status of MATCH_DELETED. 12507func (r *TurnBasedMatchesService) Sync() *TurnBasedMatchesSyncCall { 12508 c := &TurnBasedMatchesSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12509 return c 12510} 12511 12512// IncludeMatchData sets the optional parameter "includeMatchData": True 12513// if match data should be returned in the response. Note that not all 12514// data will necessarily be returned if include_match_data is true; the 12515// server may decide to only return data for some of the matches to 12516// limit download size for the client. The remainder of the data for 12517// these matches will be retrievable on request. 12518func (c *TurnBasedMatchesSyncCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesSyncCall { 12519 c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData)) 12520 return c 12521} 12522 12523// Language sets the optional parameter "language": The preferred 12524// language to use for strings returned by this method. 12525func (c *TurnBasedMatchesSyncCall) Language(language string) *TurnBasedMatchesSyncCall { 12526 c.urlParams_.Set("language", language) 12527 return c 12528} 12529 12530// MaxCompletedMatches sets the optional parameter 12531// "maxCompletedMatches": The maximum number of completed or canceled 12532// matches to return in the response. If not set, all matches returned 12533// could be completed or canceled. 12534func (c *TurnBasedMatchesSyncCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesSyncCall { 12535 c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches)) 12536 return c 12537} 12538 12539// MaxResults sets the optional parameter "maxResults": The maximum 12540// number of matches to return in the response, used for paging. For any 12541// response, the actual number of matches to return may be less than the 12542// specified maxResults. 12543func (c *TurnBasedMatchesSyncCall) MaxResults(maxResults int64) *TurnBasedMatchesSyncCall { 12544 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 12545 return c 12546} 12547 12548// PageToken sets the optional parameter "pageToken": The token returned 12549// by the previous request. 12550func (c *TurnBasedMatchesSyncCall) PageToken(pageToken string) *TurnBasedMatchesSyncCall { 12551 c.urlParams_.Set("pageToken", pageToken) 12552 return c 12553} 12554 12555// Fields allows partial responses to be retrieved. See 12556// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12557// for more information. 12558func (c *TurnBasedMatchesSyncCall) Fields(s ...googleapi.Field) *TurnBasedMatchesSyncCall { 12559 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12560 return c 12561} 12562 12563// IfNoneMatch sets the optional parameter which makes the operation 12564// fail if the object's ETag matches the given value. This is useful for 12565// getting updates only after the object has changed since the last 12566// request. Use googleapi.IsNotModified to check whether the response 12567// error from Do is the result of In-None-Match. 12568func (c *TurnBasedMatchesSyncCall) IfNoneMatch(entityTag string) *TurnBasedMatchesSyncCall { 12569 c.ifNoneMatch_ = entityTag 12570 return c 12571} 12572 12573// Context sets the context to be used in this call's Do method. Any 12574// pending HTTP request will be aborted if the provided context is 12575// canceled. 12576func (c *TurnBasedMatchesSyncCall) Context(ctx context.Context) *TurnBasedMatchesSyncCall { 12577 c.ctx_ = ctx 12578 return c 12579} 12580 12581// Header returns an http.Header that can be modified by the caller to 12582// add HTTP headers to the request. 12583func (c *TurnBasedMatchesSyncCall) Header() http.Header { 12584 if c.header_ == nil { 12585 c.header_ = make(http.Header) 12586 } 12587 return c.header_ 12588} 12589 12590func (c *TurnBasedMatchesSyncCall) doRequest(alt string) (*http.Response, error) { 12591 reqHeaders := make(http.Header) 12592 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 12593 for k, v := range c.header_ { 12594 reqHeaders[k] = v 12595 } 12596 reqHeaders.Set("User-Agent", c.s.userAgent()) 12597 if c.ifNoneMatch_ != "" { 12598 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12599 } 12600 var body io.Reader = nil 12601 c.urlParams_.Set("alt", alt) 12602 c.urlParams_.Set("prettyPrint", "false") 12603 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/sync") 12604 urls += "?" + c.urlParams_.Encode() 12605 req, err := http.NewRequest("GET", urls, body) 12606 if err != nil { 12607 return nil, err 12608 } 12609 req.Header = reqHeaders 12610 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12611} 12612 12613// Do executes the "games.turnBasedMatches.sync" call. 12614// Exactly one of *TurnBasedMatchSync or error will be non-nil. Any 12615// non-2xx status code is an error. Response headers are in either 12616// *TurnBasedMatchSync.ServerResponse.Header or (if a response was 12617// returned at all) in error.(*googleapi.Error).Header. Use 12618// googleapi.IsNotModified to check whether the returned error was 12619// because http.StatusNotModified was returned. 12620func (c *TurnBasedMatchesSyncCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchSync, error) { 12621 gensupport.SetOptions(c.urlParams_, opts...) 12622 res, err := c.doRequest("json") 12623 if res != nil && res.StatusCode == http.StatusNotModified { 12624 if res.Body != nil { 12625 res.Body.Close() 12626 } 12627 return nil, &googleapi.Error{ 12628 Code: res.StatusCode, 12629 Header: res.Header, 12630 } 12631 } 12632 if err != nil { 12633 return nil, err 12634 } 12635 defer googleapi.CloseBody(res) 12636 if err := googleapi.CheckResponse(res); err != nil { 12637 return nil, err 12638 } 12639 ret := &TurnBasedMatchSync{ 12640 ServerResponse: googleapi.ServerResponse{ 12641 Header: res.Header, 12642 HTTPStatusCode: res.StatusCode, 12643 }, 12644 } 12645 target := &ret 12646 if err := gensupport.DecodeResponse(target, res); err != nil { 12647 return nil, err 12648 } 12649 return ret, nil 12650 // { 12651 // "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.", 12652 // "httpMethod": "GET", 12653 // "id": "games.turnBasedMatches.sync", 12654 // "parameters": { 12655 // "includeMatchData": { 12656 // "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.", 12657 // "location": "query", 12658 // "type": "boolean" 12659 // }, 12660 // "language": { 12661 // "description": "The preferred language to use for strings returned by this method.", 12662 // "location": "query", 12663 // "type": "string" 12664 // }, 12665 // "maxCompletedMatches": { 12666 // "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.", 12667 // "format": "int32", 12668 // "location": "query", 12669 // "maximum": "500", 12670 // "minimum": "0", 12671 // "type": "integer" 12672 // }, 12673 // "maxResults": { 12674 // "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.", 12675 // "format": "int32", 12676 // "location": "query", 12677 // "maximum": "500", 12678 // "minimum": "1", 12679 // "type": "integer" 12680 // }, 12681 // "pageToken": { 12682 // "description": "The token returned by the previous request.", 12683 // "location": "query", 12684 // "type": "string" 12685 // } 12686 // }, 12687 // "path": "turnbasedmatches/sync", 12688 // "response": { 12689 // "$ref": "TurnBasedMatchSync" 12690 // }, 12691 // "scopes": [ 12692 // "https://www.googleapis.com/auth/games" 12693 // ] 12694 // } 12695 12696} 12697 12698// Pages invokes f for each page of results. 12699// A non-nil error returned from f will halt the iteration. 12700// The provided context supersedes any context provided to the Context method. 12701func (c *TurnBasedMatchesSyncCall) Pages(ctx context.Context, f func(*TurnBasedMatchSync) error) error { 12702 c.ctx_ = ctx 12703 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 12704 for { 12705 x, err := c.Do() 12706 if err != nil { 12707 return err 12708 } 12709 if err := f(x); err != nil { 12710 return err 12711 } 12712 if x.NextPageToken == "" { 12713 return nil 12714 } 12715 c.PageToken(x.NextPageToken) 12716 } 12717} 12718 12719// method id "games.turnBasedMatches.takeTurn": 12720 12721type TurnBasedMatchesTakeTurnCall struct { 12722 s *Service 12723 matchId string 12724 turnbasedmatchturn *TurnBasedMatchTurn 12725 urlParams_ gensupport.URLParams 12726 ctx_ context.Context 12727 header_ http.Header 12728} 12729 12730// TakeTurn: Commit the results of a player turn. 12731func (r *TurnBasedMatchesService) TakeTurn(matchId string, turnbasedmatchturn *TurnBasedMatchTurn) *TurnBasedMatchesTakeTurnCall { 12732 c := &TurnBasedMatchesTakeTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12733 c.matchId = matchId 12734 c.turnbasedmatchturn = turnbasedmatchturn 12735 return c 12736} 12737 12738// Language sets the optional parameter "language": The preferred 12739// language to use for strings returned by this method. 12740func (c *TurnBasedMatchesTakeTurnCall) Language(language string) *TurnBasedMatchesTakeTurnCall { 12741 c.urlParams_.Set("language", language) 12742 return c 12743} 12744 12745// Fields allows partial responses to be retrieved. See 12746// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12747// for more information. 12748func (c *TurnBasedMatchesTakeTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesTakeTurnCall { 12749 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12750 return c 12751} 12752 12753// Context sets the context to be used in this call's Do method. Any 12754// pending HTTP request will be aborted if the provided context is 12755// canceled. 12756func (c *TurnBasedMatchesTakeTurnCall) Context(ctx context.Context) *TurnBasedMatchesTakeTurnCall { 12757 c.ctx_ = ctx 12758 return c 12759} 12760 12761// Header returns an http.Header that can be modified by the caller to 12762// add HTTP headers to the request. 12763func (c *TurnBasedMatchesTakeTurnCall) Header() http.Header { 12764 if c.header_ == nil { 12765 c.header_ = make(http.Header) 12766 } 12767 return c.header_ 12768} 12769 12770func (c *TurnBasedMatchesTakeTurnCall) doRequest(alt string) (*http.Response, error) { 12771 reqHeaders := make(http.Header) 12772 reqHeaders.Set("x-goog-api-client", "gl-go/1.11.0 gdcl/20191216") 12773 for k, v := range c.header_ { 12774 reqHeaders[k] = v 12775 } 12776 reqHeaders.Set("User-Agent", c.s.userAgent()) 12777 var body io.Reader = nil 12778 body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchturn) 12779 if err != nil { 12780 return nil, err 12781 } 12782 reqHeaders.Set("Content-Type", "application/json") 12783 c.urlParams_.Set("alt", alt) 12784 c.urlParams_.Set("prettyPrint", "false") 12785 urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/turn") 12786 urls += "?" + c.urlParams_.Encode() 12787 req, err := http.NewRequest("PUT", urls, body) 12788 if err != nil { 12789 return nil, err 12790 } 12791 req.Header = reqHeaders 12792 googleapi.Expand(req.URL, map[string]string{ 12793 "matchId": c.matchId, 12794 }) 12795 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12796} 12797 12798// Do executes the "games.turnBasedMatches.takeTurn" call. 12799// Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx 12800// status code is an error. Response headers are in either 12801// *TurnBasedMatch.ServerResponse.Header or (if a response was returned 12802// at all) in error.(*googleapi.Error).Header. Use 12803// googleapi.IsNotModified to check whether the returned error was 12804// because http.StatusNotModified was returned. 12805func (c *TurnBasedMatchesTakeTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) { 12806 gensupport.SetOptions(c.urlParams_, opts...) 12807 res, err := c.doRequest("json") 12808 if res != nil && res.StatusCode == http.StatusNotModified { 12809 if res.Body != nil { 12810 res.Body.Close() 12811 } 12812 return nil, &googleapi.Error{ 12813 Code: res.StatusCode, 12814 Header: res.Header, 12815 } 12816 } 12817 if err != nil { 12818 return nil, err 12819 } 12820 defer googleapi.CloseBody(res) 12821 if err := googleapi.CheckResponse(res); err != nil { 12822 return nil, err 12823 } 12824 ret := &TurnBasedMatch{ 12825 ServerResponse: googleapi.ServerResponse{ 12826 Header: res.Header, 12827 HTTPStatusCode: res.StatusCode, 12828 }, 12829 } 12830 target := &ret 12831 if err := gensupport.DecodeResponse(target, res); err != nil { 12832 return nil, err 12833 } 12834 return ret, nil 12835 // { 12836 // "description": "Commit the results of a player turn.", 12837 // "httpMethod": "PUT", 12838 // "id": "games.turnBasedMatches.takeTurn", 12839 // "parameterOrder": [ 12840 // "matchId" 12841 // ], 12842 // "parameters": { 12843 // "language": { 12844 // "description": "The preferred language to use for strings returned by this method.", 12845 // "location": "query", 12846 // "type": "string" 12847 // }, 12848 // "matchId": { 12849 // "description": "The ID of the match.", 12850 // "location": "path", 12851 // "required": true, 12852 // "type": "string" 12853 // } 12854 // }, 12855 // "path": "turnbasedmatches/{matchId}/turn", 12856 // "request": { 12857 // "$ref": "TurnBasedMatchTurn" 12858 // }, 12859 // "response": { 12860 // "$ref": "TurnBasedMatch" 12861 // }, 12862 // "scopes": [ 12863 // "https://www.googleapis.com/auth/games" 12864 // ] 12865 // } 12866 12867} 12868