1// Copyright 2021 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 gamesmanagement provides access to the Google Play Game Management. 8// 9// For product documentation, see: https://developers.google.com/games/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/gamesmanagement/v1management" 16// ... 17// ctx := context.Background() 18// gamesmanagementService, err := gamesmanagement.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// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// gamesmanagementService, err := gamesmanagement.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// gamesmanagementService, err := gamesmanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package gamesmanagement // import "google.golang.org/api/gamesmanagement/v1management" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "gamesManagement:v1management" 75const apiName = "gamesManagement" 76const apiVersion = "v1management" 77const basePath = "https://gamesmanagement.googleapis.com/" 78const mtlsBasePath = "https://gamesmanagement.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // Create, edit, and delete your Google Play Games activity 83 GamesScope = "https://www.googleapis.com/auth/games" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/games", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Achievements = NewAchievementsService(s) 120 s.Applications = NewApplicationsService(s) 121 s.Events = NewEventsService(s) 122 s.Players = NewPlayersService(s) 123 s.Scores = NewScoresService(s) 124 return s, nil 125} 126 127type Service struct { 128 client *http.Client 129 BasePath string // API endpoint base URL 130 UserAgent string // optional additional User-Agent fragment 131 132 Achievements *AchievementsService 133 134 Applications *ApplicationsService 135 136 Events *EventsService 137 138 Players *PlayersService 139 140 Scores *ScoresService 141} 142 143func (s *Service) userAgent() string { 144 if s.UserAgent == "" { 145 return googleapi.UserAgent 146 } 147 return googleapi.UserAgent + " " + s.UserAgent 148} 149 150func NewAchievementsService(s *Service) *AchievementsService { 151 rs := &AchievementsService{s: s} 152 return rs 153} 154 155type AchievementsService struct { 156 s *Service 157} 158 159func NewApplicationsService(s *Service) *ApplicationsService { 160 rs := &ApplicationsService{s: s} 161 return rs 162} 163 164type ApplicationsService struct { 165 s *Service 166} 167 168func NewEventsService(s *Service) *EventsService { 169 rs := &EventsService{s: s} 170 return rs 171} 172 173type EventsService struct { 174 s *Service 175} 176 177func NewPlayersService(s *Service) *PlayersService { 178 rs := &PlayersService{s: s} 179 return rs 180} 181 182type PlayersService struct { 183 s *Service 184} 185 186func NewScoresService(s *Service) *ScoresService { 187 rs := &ScoresService{s: s} 188 return rs 189} 190 191type ScoresService struct { 192 s *Service 193} 194 195// AchievementResetAllResponse: Achievement reset all response. 196type AchievementResetAllResponse struct { 197 // Kind: Uniquely identifies the type of this resource. Value is always 198 // the fixed string `gamesManagement#achievementResetAllResponse`. 199 Kind string `json:"kind,omitempty"` 200 201 // Results: The achievement reset results. 202 Results []*AchievementResetResponse `json:"results,omitempty"` 203 204 // ServerResponse contains the HTTP response code and headers from the 205 // server. 206 googleapi.ServerResponse `json:"-"` 207 208 // ForceSendFields is a list of field names (e.g. "Kind") to 209 // unconditionally include in API requests. By default, fields with 210 // empty values are omitted from API requests. However, any non-pointer, 211 // non-interface field appearing in ForceSendFields will be sent to the 212 // server regardless of whether the field is empty or not. This may be 213 // used to include empty fields in Patch requests. 214 ForceSendFields []string `json:"-"` 215 216 // NullFields is a list of field names (e.g. "Kind") to include in API 217 // requests with the JSON null value. By default, fields with empty 218 // values are omitted from API requests. However, any field with an 219 // empty value appearing in NullFields will be sent to the server as 220 // null. It is an error if a field in this list has a non-empty value. 221 // This may be used to include null fields in Patch requests. 222 NullFields []string `json:"-"` 223} 224 225func (s *AchievementResetAllResponse) MarshalJSON() ([]byte, error) { 226 type NoMethod AchievementResetAllResponse 227 raw := NoMethod(*s) 228 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 229} 230 231type AchievementResetMultipleForAllRequest struct { 232 // AchievementIds: The IDs of achievements to reset. 233 AchievementIds []string `json:"achievement_ids,omitempty"` 234 235 // Kind: Uniquely identifies the type of this resource. Value is always 236 // the fixed string 237 // `gamesManagement#achievementResetMultipleForAllRequest`. 238 Kind string `json:"kind,omitempty"` 239 240 // ForceSendFields is a list of field names (e.g. "AchievementIds") to 241 // unconditionally include in API requests. By default, fields with 242 // empty values are omitted from API requests. However, any non-pointer, 243 // non-interface field appearing in ForceSendFields will be sent to the 244 // server regardless of whether the field is empty or not. This may be 245 // used to include empty fields in Patch requests. 246 ForceSendFields []string `json:"-"` 247 248 // NullFields is a list of field names (e.g. "AchievementIds") to 249 // include in API requests with the JSON null value. By default, fields 250 // with empty values are omitted from API requests. However, any field 251 // with an empty value appearing in NullFields will be sent to the 252 // server as null. It is an error if a field in this list has a 253 // non-empty value. This may be used to include null fields in Patch 254 // requests. 255 NullFields []string `json:"-"` 256} 257 258func (s *AchievementResetMultipleForAllRequest) MarshalJSON() ([]byte, error) { 259 type NoMethod AchievementResetMultipleForAllRequest 260 raw := NoMethod(*s) 261 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 262} 263 264// AchievementResetResponse: An achievement reset response. 265type AchievementResetResponse struct { 266 // CurrentState: The current state of the achievement. This is the same 267 // as the initial state of the achievement. Possible values are: - 268 // "HIDDEN"- Achievement is hidden. - "REVEALED" - Achievement is 269 // revealed. - "UNLOCKED" - Achievement is unlocked. 270 CurrentState string `json:"currentState,omitempty"` 271 272 // DefinitionId: The ID of an achievement for which player state has 273 // been updated. 274 DefinitionId string `json:"definitionId,omitempty"` 275 276 // Kind: Uniquely identifies the type of this resource. Value is always 277 // the fixed string `gamesManagement#achievementResetResponse`. 278 Kind string `json:"kind,omitempty"` 279 280 // UpdateOccurred: Flag to indicate if the requested update actually 281 // occurred. 282 UpdateOccurred bool `json:"updateOccurred,omitempty"` 283 284 // ServerResponse contains the HTTP response code and headers from the 285 // server. 286 googleapi.ServerResponse `json:"-"` 287 288 // ForceSendFields is a list of field names (e.g. "CurrentState") to 289 // unconditionally include in API requests. By default, fields with 290 // empty values are omitted from API requests. However, any non-pointer, 291 // non-interface field appearing in ForceSendFields will be sent to the 292 // server regardless of whether the field is empty or not. This may be 293 // used to include empty fields in Patch requests. 294 ForceSendFields []string `json:"-"` 295 296 // NullFields is a list of field names (e.g. "CurrentState") to include 297 // in API requests with the JSON null value. By default, fields with 298 // empty values are omitted from API requests. However, any field with 299 // an empty value appearing in NullFields will be sent to the server as 300 // null. It is an error if a field in this list has a non-empty value. 301 // This may be used to include null fields in Patch requests. 302 NullFields []string `json:"-"` 303} 304 305func (s *AchievementResetResponse) MarshalJSON() ([]byte, error) { 306 type NoMethod AchievementResetResponse 307 raw := NoMethod(*s) 308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 309} 310 311// EventsResetMultipleForAllRequest: Multiple events reset all request. 312type EventsResetMultipleForAllRequest struct { 313 // EventIds: The IDs of events to reset. 314 EventIds []string `json:"event_ids,omitempty"` 315 316 // Kind: Uniquely identifies the type of this resource. Value is always 317 // the fixed string `gamesManagement#eventsResetMultipleForAllRequest`. 318 Kind string `json:"kind,omitempty"` 319 320 // ForceSendFields is a list of field names (e.g. "EventIds") to 321 // unconditionally include in API requests. By default, fields with 322 // empty values are omitted from API requests. However, any non-pointer, 323 // non-interface field appearing in ForceSendFields will be sent to the 324 // server regardless of whether the field is empty or not. This may be 325 // used to include empty fields in Patch requests. 326 ForceSendFields []string `json:"-"` 327 328 // NullFields is a list of field names (e.g. "EventIds") to include in 329 // API requests with the JSON null value. By default, fields with empty 330 // values are omitted from API requests. However, any field with an 331 // empty value appearing in NullFields will be sent to the server as 332 // null. It is an error if a field in this list has a non-empty value. 333 // This may be used to include null fields in Patch requests. 334 NullFields []string `json:"-"` 335} 336 337func (s *EventsResetMultipleForAllRequest) MarshalJSON() ([]byte, error) { 338 type NoMethod EventsResetMultipleForAllRequest 339 raw := NoMethod(*s) 340 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 341} 342 343// GamesPlayerExperienceInfoResource: 1P/3P metadata about the player's 344// experience. 345type GamesPlayerExperienceInfoResource struct { 346 // CurrentExperiencePoints: The current number of experience points for 347 // the player. 348 CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"` 349 350 // CurrentLevel: The current level of the player. 351 CurrentLevel *GamesPlayerLevelResource `json:"currentLevel,omitempty"` 352 353 // LastLevelUpTimestampMillis: The timestamp when the player was leveled 354 // up, in millis since Unix epoch UTC. 355 LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"` 356 357 // NextLevel: The next level of the player. If the current level is the 358 // maximum level, this should be same as the current level. 359 NextLevel *GamesPlayerLevelResource `json:"nextLevel,omitempty"` 360 361 // ForceSendFields is a list of field names (e.g. 362 // "CurrentExperiencePoints") to unconditionally include in API 363 // requests. By default, fields with empty values are omitted from API 364 // requests. However, any non-pointer, non-interface field appearing in 365 // ForceSendFields will be sent to the server regardless of whether the 366 // field is empty or not. This may be used to include empty fields in 367 // Patch requests. 368 ForceSendFields []string `json:"-"` 369 370 // NullFields is a list of field names (e.g. "CurrentExperiencePoints") 371 // to include in API requests with the JSON null value. By default, 372 // fields with empty values are omitted from API requests. However, any 373 // field with an empty value appearing in NullFields will be sent to the 374 // server as null. It is an error if a field in this list has a 375 // non-empty value. This may be used to include null fields in Patch 376 // requests. 377 NullFields []string `json:"-"` 378} 379 380func (s *GamesPlayerExperienceInfoResource) MarshalJSON() ([]byte, error) { 381 type NoMethod GamesPlayerExperienceInfoResource 382 raw := NoMethod(*s) 383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 384} 385 386// GamesPlayerLevelResource: 1P/3P metadata about a user's level. 387type GamesPlayerLevelResource struct { 388 // Level: The level for the user. 389 Level int64 `json:"level,omitempty"` 390 391 // MaxExperiencePoints: The maximum experience points for this level. 392 MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"` 393 394 // MinExperiencePoints: The minimum experience points for this level. 395 MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"` 396 397 // ForceSendFields is a list of field names (e.g. "Level") to 398 // unconditionally include in API requests. By default, fields with 399 // empty values are omitted from API requests. However, any non-pointer, 400 // non-interface field appearing in ForceSendFields will be sent to the 401 // server regardless of whether the field is empty or not. This may be 402 // used to include empty fields in Patch requests. 403 ForceSendFields []string `json:"-"` 404 405 // NullFields is a list of field names (e.g. "Level") to include in API 406 // requests with the JSON null value. By default, fields with empty 407 // values are omitted from API requests. However, any field with an 408 // empty value appearing in NullFields will be sent to the server as 409 // null. It is an error if a field in this list has a non-empty value. 410 // This may be used to include null fields in Patch requests. 411 NullFields []string `json:"-"` 412} 413 414func (s *GamesPlayerLevelResource) MarshalJSON() ([]byte, error) { 415 type NoMethod GamesPlayerLevelResource 416 raw := NoMethod(*s) 417 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 418} 419 420// HiddenPlayer: The HiddenPlayer resource. 421type HiddenPlayer struct { 422 // HiddenTimeMillis: Output only. The time this player was hidden. 423 HiddenTimeMillis int64 `json:"hiddenTimeMillis,omitempty,string"` 424 425 // Kind: Output only. Uniquely identifies the type of this resource. 426 // Value is always the fixed string `gamesManagement#hiddenPlayer`. 427 Kind string `json:"kind,omitempty"` 428 429 // Player: Output only. The player information. 430 Player *Player `json:"player,omitempty"` 431 432 // ForceSendFields is a list of field names (e.g. "HiddenTimeMillis") to 433 // unconditionally include in API requests. By default, fields with 434 // empty values are omitted from API requests. However, any non-pointer, 435 // non-interface field appearing in ForceSendFields will be sent to the 436 // server regardless of whether the field is empty or not. This may be 437 // used to include empty fields in Patch requests. 438 ForceSendFields []string `json:"-"` 439 440 // NullFields is a list of field names (e.g. "HiddenTimeMillis") to 441 // include in API requests with the JSON null value. By default, fields 442 // with empty values are omitted from API requests. However, any field 443 // with an empty value appearing in NullFields will be sent to the 444 // server as null. It is an error if a field in this list has a 445 // non-empty value. This may be used to include null fields in Patch 446 // requests. 447 NullFields []string `json:"-"` 448} 449 450func (s *HiddenPlayer) MarshalJSON() ([]byte, error) { 451 type NoMethod HiddenPlayer 452 raw := NoMethod(*s) 453 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 454} 455 456// HiddenPlayerList: A list of hidden players. 457type HiddenPlayerList struct { 458 // Items: The players. 459 Items []*HiddenPlayer `json:"items,omitempty"` 460 461 // Kind: Uniquely identifies the type of this resource. Value is always 462 // the fixed string `gamesManagement#hiddenPlayerList`. 463 Kind string `json:"kind,omitempty"` 464 465 // NextPageToken: The pagination token for the next page of results. 466 NextPageToken string `json:"nextPageToken,omitempty"` 467 468 // ServerResponse contains the HTTP response code and headers from the 469 // server. 470 googleapi.ServerResponse `json:"-"` 471 472 // ForceSendFields is a list of field names (e.g. "Items") to 473 // unconditionally include in API requests. By default, fields with 474 // empty values are omitted from API requests. However, any non-pointer, 475 // non-interface field appearing in ForceSendFields will be sent to the 476 // server regardless of whether the field is empty or not. This may be 477 // used to include empty fields in Patch requests. 478 ForceSendFields []string `json:"-"` 479 480 // NullFields is a list of field names (e.g. "Items") to include in API 481 // requests with the JSON null value. By default, fields with empty 482 // values are omitted from API requests. However, any field with an 483 // empty value appearing in NullFields will be sent to the server as 484 // null. It is an error if a field in this list has a non-empty value. 485 // This may be used to include null fields in Patch requests. 486 NullFields []string `json:"-"` 487} 488 489func (s *HiddenPlayerList) MarshalJSON() ([]byte, error) { 490 type NoMethod HiddenPlayerList 491 raw := NoMethod(*s) 492 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 493} 494 495// Player: A Player resource. 496type Player struct { 497 // AvatarImageUrl: The base URL for the image that represents the 498 // player. 499 AvatarImageUrl string `json:"avatarImageUrl,omitempty"` 500 501 // BannerUrlLandscape: The url to the landscape mode player banner 502 // image. 503 BannerUrlLandscape string `json:"bannerUrlLandscape,omitempty"` 504 505 // BannerUrlPortrait: The url to the portrait mode player banner image. 506 BannerUrlPortrait string `json:"bannerUrlPortrait,omitempty"` 507 508 // DisplayName: The name to display for the player. 509 DisplayName string `json:"displayName,omitempty"` 510 511 // ExperienceInfo: An object to represent Play Game experience 512 // information for the player. 513 ExperienceInfo *GamesPlayerExperienceInfoResource `json:"experienceInfo,omitempty"` 514 515 // Kind: Uniquely identifies the type of this resource. Value is always 516 // the fixed string `gamesManagement#player`. 517 Kind string `json:"kind,omitempty"` 518 519 // Name: An object representation of the individual components of the 520 // player's name. For some players, these fields may not be present. 521 Name *PlayerName `json:"name,omitempty"` 522 523 // OriginalPlayerId: The player ID that was used for this player the 524 // first time they signed into the game in question. This is only 525 // populated for calls to player.get for the requesting player, only if 526 // the player ID has subsequently changed, and only to clients that 527 // support remapping player IDs. 528 OriginalPlayerId string `json:"originalPlayerId,omitempty"` 529 530 // PlayerId: The ID of the player. 531 PlayerId string `json:"playerId,omitempty"` 532 533 // ProfileSettings: The player's profile settings. Controls whether or 534 // not the player's profile is visible to other players. 535 ProfileSettings *ProfileSettings `json:"profileSettings,omitempty"` 536 537 // Title: The player's title rewarded for their game activities. 538 Title string `json:"title,omitempty"` 539 540 // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to 541 // unconditionally include in API requests. By default, fields with 542 // empty values are omitted from API requests. However, any non-pointer, 543 // non-interface field appearing in ForceSendFields will be sent to the 544 // server regardless of whether the field is empty or not. This may be 545 // used to include empty fields in Patch requests. 546 ForceSendFields []string `json:"-"` 547 548 // NullFields is a list of field names (e.g. "AvatarImageUrl") to 549 // include in API requests with the JSON null value. By default, fields 550 // with empty values are omitted from API requests. However, any field 551 // with an empty value appearing in NullFields will be sent to the 552 // server as null. It is an error if a field in this list has a 553 // non-empty value. This may be used to include null fields in Patch 554 // requests. 555 NullFields []string `json:"-"` 556} 557 558func (s *Player) MarshalJSON() ([]byte, error) { 559 type NoMethod Player 560 raw := NoMethod(*s) 561 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 562} 563 564// PlayerName: An object representation of the individual components of 565// the player's name. For some players, these fields may not be present. 566type PlayerName struct { 567 // FamilyName: The family name of this player. In some places, this is 568 // known as the last name. 569 FamilyName string `json:"familyName,omitempty"` 570 571 // GivenName: The given name of this player. In some places, this is 572 // known as the first name. 573 GivenName string `json:"givenName,omitempty"` 574 575 // ForceSendFields is a list of field names (e.g. "FamilyName") to 576 // unconditionally include in API requests. By default, fields with 577 // empty values are omitted from API requests. However, any non-pointer, 578 // non-interface field appearing in ForceSendFields will be sent to the 579 // server regardless of whether the field is empty or not. This may be 580 // used to include empty fields in Patch requests. 581 ForceSendFields []string `json:"-"` 582 583 // NullFields is a list of field names (e.g. "FamilyName") to include in 584 // API requests with the JSON null value. By default, fields with empty 585 // values are omitted from API requests. However, any field with an 586 // empty value appearing in NullFields will be sent to the server as 587 // null. It is an error if a field in this list has a non-empty value. 588 // This may be used to include null fields in Patch requests. 589 NullFields []string `json:"-"` 590} 591 592func (s *PlayerName) MarshalJSON() ([]byte, error) { 593 type NoMethod PlayerName 594 raw := NoMethod(*s) 595 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 596} 597 598// PlayerScoreResetAllResponse: A list of leaderboard reset resources. 599type PlayerScoreResetAllResponse struct { 600 // Kind: Uniquely identifies the type of this resource. Value is always 601 // the fixed string `gamesManagement#playerScoreResetAllResponse`. 602 Kind string `json:"kind,omitempty"` 603 604 // Results: The leaderboard reset results. 605 Results []*PlayerScoreResetResponse `json:"results,omitempty"` 606 607 // ServerResponse contains the HTTP response code and headers from the 608 // server. 609 googleapi.ServerResponse `json:"-"` 610 611 // ForceSendFields is a list of field names (e.g. "Kind") to 612 // unconditionally include in API requests. By default, fields with 613 // empty values are omitted from API requests. However, any non-pointer, 614 // non-interface field appearing in ForceSendFields will be sent to the 615 // server regardless of whether the field is empty or not. This may be 616 // used to include empty fields in Patch requests. 617 ForceSendFields []string `json:"-"` 618 619 // NullFields is a list of field names (e.g. "Kind") to include in API 620 // requests with the JSON null value. By default, fields with empty 621 // values are omitted from API requests. However, any field with an 622 // empty value appearing in NullFields will be sent to the server as 623 // null. It is an error if a field in this list has a non-empty value. 624 // This may be used to include null fields in Patch requests. 625 NullFields []string `json:"-"` 626} 627 628func (s *PlayerScoreResetAllResponse) MarshalJSON() ([]byte, error) { 629 type NoMethod PlayerScoreResetAllResponse 630 raw := NoMethod(*s) 631 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 632} 633 634// PlayerScoreResetResponse: A list of reset leaderboard entry 635// resources. 636type PlayerScoreResetResponse struct { 637 // DefinitionId: The ID of an leaderboard for which player state has 638 // been updated. 639 DefinitionId string `json:"definitionId,omitempty"` 640 641 // Kind: Uniquely identifies the type of this resource. Value is always 642 // the fixed string `gamesManagement#playerScoreResetResponse`. 643 Kind string `json:"kind,omitempty"` 644 645 // ResetScoreTimeSpans: The time spans of the updated score. Possible 646 // values are: - "ALL_TIME" - The score is an all-time score. - 647 // "WEEKLY" - The score is a weekly score. - "DAILY" - The score is 648 // a daily score. 649 ResetScoreTimeSpans []string `json:"resetScoreTimeSpans,omitempty"` 650 651 // ServerResponse contains the HTTP response code and headers from the 652 // server. 653 googleapi.ServerResponse `json:"-"` 654 655 // ForceSendFields is a list of field names (e.g. "DefinitionId") to 656 // unconditionally include in API requests. By default, fields with 657 // empty values are omitted from API requests. However, any non-pointer, 658 // non-interface field appearing in ForceSendFields will be sent to the 659 // server regardless of whether the field is empty or not. This may be 660 // used to include empty fields in Patch requests. 661 ForceSendFields []string `json:"-"` 662 663 // NullFields is a list of field names (e.g. "DefinitionId") to include 664 // in API requests with the JSON null value. By default, fields with 665 // empty values are omitted from API requests. However, any field with 666 // an empty value appearing in NullFields will be sent to the server as 667 // null. It is an error if a field in this list has a non-empty value. 668 // This may be used to include null fields in Patch requests. 669 NullFields []string `json:"-"` 670} 671 672func (s *PlayerScoreResetResponse) MarshalJSON() ([]byte, error) { 673 type NoMethod PlayerScoreResetResponse 674 raw := NoMethod(*s) 675 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 676} 677 678// ProfileSettings: Profile settings 679type ProfileSettings struct { 680 // Kind: Uniquely identifies the type of this resource. Value is always 681 // the fixed string `gamesManagement#profileSettings`. 682 Kind string `json:"kind,omitempty"` 683 684 ProfileVisible bool `json:"profileVisible,omitempty"` 685 686 // ForceSendFields is a list of field names (e.g. "Kind") to 687 // unconditionally include in API requests. By default, fields with 688 // empty values are omitted from API requests. However, any non-pointer, 689 // non-interface field appearing in ForceSendFields will be sent to the 690 // server regardless of whether the field is empty or not. This may be 691 // used to include empty fields in Patch requests. 692 ForceSendFields []string `json:"-"` 693 694 // NullFields is a list of field names (e.g. "Kind") to include in API 695 // requests with the JSON null value. By default, fields with empty 696 // values are omitted from API requests. However, any field with an 697 // empty value appearing in NullFields will be sent to the server as 698 // null. It is an error if a field in this list has a non-empty value. 699 // This may be used to include null fields in Patch requests. 700 NullFields []string `json:"-"` 701} 702 703func (s *ProfileSettings) MarshalJSON() ([]byte, error) { 704 type NoMethod ProfileSettings 705 raw := NoMethod(*s) 706 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 707} 708 709type ScoresResetMultipleForAllRequest struct { 710 // Kind: Uniquely identifies the type of this resource. Value is always 711 // the fixed string `gamesManagement#scoresResetMultipleForAllRequest`. 712 Kind string `json:"kind,omitempty"` 713 714 // LeaderboardIds: The IDs of leaderboards to reset. 715 LeaderboardIds []string `json:"leaderboard_ids,omitempty"` 716 717 // ForceSendFields is a list of field names (e.g. "Kind") to 718 // unconditionally include in API requests. By default, fields with 719 // empty values are omitted from API requests. However, any non-pointer, 720 // non-interface field appearing in ForceSendFields will be sent to the 721 // server regardless of whether the field is empty or not. This may be 722 // used to include empty fields in Patch requests. 723 ForceSendFields []string `json:"-"` 724 725 // NullFields is a list of field names (e.g. "Kind") to include in API 726 // requests with the JSON null value. By default, fields with empty 727 // values are omitted from API requests. However, any field with an 728 // empty value appearing in NullFields will be sent to the server as 729 // null. It is an error if a field in this list has a non-empty value. 730 // This may be used to include null fields in Patch requests. 731 NullFields []string `json:"-"` 732} 733 734func (s *ScoresResetMultipleForAllRequest) MarshalJSON() ([]byte, error) { 735 type NoMethod ScoresResetMultipleForAllRequest 736 raw := NoMethod(*s) 737 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 738} 739 740// method id "gamesManagement.achievements.reset": 741 742type AchievementsResetCall struct { 743 s *Service 744 achievementId string 745 urlParams_ gensupport.URLParams 746 ctx_ context.Context 747 header_ http.Header 748} 749 750// Reset: Resets the achievement with the given ID for the currently 751// authenticated player. This method is only accessible to whitelisted 752// tester accounts for your application. 753// 754// - achievementId: The ID of the achievement used by this method. 755func (r *AchievementsService) Reset(achievementId string) *AchievementsResetCall { 756 c := &AchievementsResetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 757 c.achievementId = achievementId 758 return c 759} 760 761// Fields allows partial responses to be retrieved. See 762// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 763// for more information. 764func (c *AchievementsResetCall) Fields(s ...googleapi.Field) *AchievementsResetCall { 765 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 766 return c 767} 768 769// Context sets the context to be used in this call's Do method. Any 770// pending HTTP request will be aborted if the provided context is 771// canceled. 772func (c *AchievementsResetCall) Context(ctx context.Context) *AchievementsResetCall { 773 c.ctx_ = ctx 774 return c 775} 776 777// Header returns an http.Header that can be modified by the caller to 778// add HTTP headers to the request. 779func (c *AchievementsResetCall) Header() http.Header { 780 if c.header_ == nil { 781 c.header_ = make(http.Header) 782 } 783 return c.header_ 784} 785 786func (c *AchievementsResetCall) doRequest(alt string) (*http.Response, error) { 787 reqHeaders := make(http.Header) 788 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 789 for k, v := range c.header_ { 790 reqHeaders[k] = v 791 } 792 reqHeaders.Set("User-Agent", c.s.userAgent()) 793 var body io.Reader = nil 794 c.urlParams_.Set("alt", alt) 795 c.urlParams_.Set("prettyPrint", "false") 796 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/{achievementId}/reset") 797 urls += "?" + c.urlParams_.Encode() 798 req, err := http.NewRequest("POST", urls, body) 799 if err != nil { 800 return nil, err 801 } 802 req.Header = reqHeaders 803 googleapi.Expand(req.URL, map[string]string{ 804 "achievementId": c.achievementId, 805 }) 806 return gensupport.SendRequest(c.ctx_, c.s.client, req) 807} 808 809// Do executes the "gamesManagement.achievements.reset" call. 810// Exactly one of *AchievementResetResponse or error will be non-nil. 811// Any non-2xx status code is an error. Response headers are in either 812// *AchievementResetResponse.ServerResponse.Header or (if a response was 813// returned at all) in error.(*googleapi.Error).Header. Use 814// googleapi.IsNotModified to check whether the returned error was 815// because http.StatusNotModified was returned. 816func (c *AchievementsResetCall) Do(opts ...googleapi.CallOption) (*AchievementResetResponse, error) { 817 gensupport.SetOptions(c.urlParams_, opts...) 818 res, err := c.doRequest("json") 819 if res != nil && res.StatusCode == http.StatusNotModified { 820 if res.Body != nil { 821 res.Body.Close() 822 } 823 return nil, &googleapi.Error{ 824 Code: res.StatusCode, 825 Header: res.Header, 826 } 827 } 828 if err != nil { 829 return nil, err 830 } 831 defer googleapi.CloseBody(res) 832 if err := googleapi.CheckResponse(res); err != nil { 833 return nil, err 834 } 835 ret := &AchievementResetResponse{ 836 ServerResponse: googleapi.ServerResponse{ 837 Header: res.Header, 838 HTTPStatusCode: res.StatusCode, 839 }, 840 } 841 target := &ret 842 if err := gensupport.DecodeResponse(target, res); err != nil { 843 return nil, err 844 } 845 return ret, nil 846 // { 847 // "description": "Resets the achievement with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", 848 // "flatPath": "games/v1management/achievements/{achievementId}/reset", 849 // "httpMethod": "POST", 850 // "id": "gamesManagement.achievements.reset", 851 // "parameterOrder": [ 852 // "achievementId" 853 // ], 854 // "parameters": { 855 // "achievementId": { 856 // "description": "The ID of the achievement used by this method.", 857 // "location": "path", 858 // "required": true, 859 // "type": "string" 860 // } 861 // }, 862 // "path": "games/v1management/achievements/{achievementId}/reset", 863 // "response": { 864 // "$ref": "AchievementResetResponse" 865 // }, 866 // "scopes": [ 867 // "https://www.googleapis.com/auth/games" 868 // ] 869 // } 870 871} 872 873// method id "gamesManagement.achievements.resetAll": 874 875type AchievementsResetAllCall struct { 876 s *Service 877 urlParams_ gensupport.URLParams 878 ctx_ context.Context 879 header_ http.Header 880} 881 882// ResetAll: Resets all achievements for the currently authenticated 883// player for your application. This method is only accessible to 884// whitelisted tester accounts for your application. 885func (r *AchievementsService) ResetAll() *AchievementsResetAllCall { 886 c := &AchievementsResetAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} 887 return c 888} 889 890// Fields allows partial responses to be retrieved. See 891// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 892// for more information. 893func (c *AchievementsResetAllCall) Fields(s ...googleapi.Field) *AchievementsResetAllCall { 894 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 895 return c 896} 897 898// Context sets the context to be used in this call's Do method. Any 899// pending HTTP request will be aborted if the provided context is 900// canceled. 901func (c *AchievementsResetAllCall) Context(ctx context.Context) *AchievementsResetAllCall { 902 c.ctx_ = ctx 903 return c 904} 905 906// Header returns an http.Header that can be modified by the caller to 907// add HTTP headers to the request. 908func (c *AchievementsResetAllCall) Header() http.Header { 909 if c.header_ == nil { 910 c.header_ = make(http.Header) 911 } 912 return c.header_ 913} 914 915func (c *AchievementsResetAllCall) doRequest(alt string) (*http.Response, error) { 916 reqHeaders := make(http.Header) 917 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 918 for k, v := range c.header_ { 919 reqHeaders[k] = v 920 } 921 reqHeaders.Set("User-Agent", c.s.userAgent()) 922 var body io.Reader = nil 923 c.urlParams_.Set("alt", alt) 924 c.urlParams_.Set("prettyPrint", "false") 925 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/reset") 926 urls += "?" + c.urlParams_.Encode() 927 req, err := http.NewRequest("POST", urls, body) 928 if err != nil { 929 return nil, err 930 } 931 req.Header = reqHeaders 932 return gensupport.SendRequest(c.ctx_, c.s.client, req) 933} 934 935// Do executes the "gamesManagement.achievements.resetAll" call. 936// Exactly one of *AchievementResetAllResponse or error will be non-nil. 937// Any non-2xx status code is an error. Response headers are in either 938// *AchievementResetAllResponse.ServerResponse.Header or (if a response 939// was returned at all) in error.(*googleapi.Error).Header. Use 940// googleapi.IsNotModified to check whether the returned error was 941// because http.StatusNotModified was returned. 942func (c *AchievementsResetAllCall) Do(opts ...googleapi.CallOption) (*AchievementResetAllResponse, error) { 943 gensupport.SetOptions(c.urlParams_, opts...) 944 res, err := c.doRequest("json") 945 if res != nil && res.StatusCode == http.StatusNotModified { 946 if res.Body != nil { 947 res.Body.Close() 948 } 949 return nil, &googleapi.Error{ 950 Code: res.StatusCode, 951 Header: res.Header, 952 } 953 } 954 if err != nil { 955 return nil, err 956 } 957 defer googleapi.CloseBody(res) 958 if err := googleapi.CheckResponse(res); err != nil { 959 return nil, err 960 } 961 ret := &AchievementResetAllResponse{ 962 ServerResponse: googleapi.ServerResponse{ 963 Header: res.Header, 964 HTTPStatusCode: res.StatusCode, 965 }, 966 } 967 target := &ret 968 if err := gensupport.DecodeResponse(target, res); err != nil { 969 return nil, err 970 } 971 return ret, nil 972 // { 973 // "description": "Resets all achievements for the currently authenticated player for your application. This method is only accessible to whitelisted tester accounts for your application.", 974 // "flatPath": "games/v1management/achievements/reset", 975 // "httpMethod": "POST", 976 // "id": "gamesManagement.achievements.resetAll", 977 // "parameterOrder": [], 978 // "parameters": {}, 979 // "path": "games/v1management/achievements/reset", 980 // "response": { 981 // "$ref": "AchievementResetAllResponse" 982 // }, 983 // "scopes": [ 984 // "https://www.googleapis.com/auth/games" 985 // ] 986 // } 987 988} 989 990// method id "gamesManagement.achievements.resetAllForAllPlayers": 991 992type AchievementsResetAllForAllPlayersCall struct { 993 s *Service 994 urlParams_ gensupport.URLParams 995 ctx_ context.Context 996 header_ http.Header 997} 998 999// ResetAllForAllPlayers: Resets all draft achievements for all players. 1000// This method is only available to user accounts for your developer 1001// console. 1002func (r *AchievementsService) ResetAllForAllPlayers() *AchievementsResetAllForAllPlayersCall { 1003 c := &AchievementsResetAllForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1004 return c 1005} 1006 1007// Fields allows partial responses to be retrieved. See 1008// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1009// for more information. 1010func (c *AchievementsResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetAllForAllPlayersCall { 1011 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1012 return c 1013} 1014 1015// Context sets the context to be used in this call's Do method. Any 1016// pending HTTP request will be aborted if the provided context is 1017// canceled. 1018func (c *AchievementsResetAllForAllPlayersCall) Context(ctx context.Context) *AchievementsResetAllForAllPlayersCall { 1019 c.ctx_ = ctx 1020 return c 1021} 1022 1023// Header returns an http.Header that can be modified by the caller to 1024// add HTTP headers to the request. 1025func (c *AchievementsResetAllForAllPlayersCall) Header() http.Header { 1026 if c.header_ == nil { 1027 c.header_ = make(http.Header) 1028 } 1029 return c.header_ 1030} 1031 1032func (c *AchievementsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 1033 reqHeaders := make(http.Header) 1034 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1035 for k, v := range c.header_ { 1036 reqHeaders[k] = v 1037 } 1038 reqHeaders.Set("User-Agent", c.s.userAgent()) 1039 var body io.Reader = nil 1040 c.urlParams_.Set("alt", alt) 1041 c.urlParams_.Set("prettyPrint", "false") 1042 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/resetAllForAllPlayers") 1043 urls += "?" + c.urlParams_.Encode() 1044 req, err := http.NewRequest("POST", urls, body) 1045 if err != nil { 1046 return nil, err 1047 } 1048 req.Header = reqHeaders 1049 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1050} 1051 1052// Do executes the "gamesManagement.achievements.resetAllForAllPlayers" call. 1053func (c *AchievementsResetAllForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 1054 gensupport.SetOptions(c.urlParams_, opts...) 1055 res, err := c.doRequest("json") 1056 if err != nil { 1057 return err 1058 } 1059 defer googleapi.CloseBody(res) 1060 if err := googleapi.CheckResponse(res); err != nil { 1061 return err 1062 } 1063 return nil 1064 // { 1065 // "description": "Resets all draft achievements for all players. This method is only available to user accounts for your developer console.", 1066 // "flatPath": "games/v1management/achievements/resetAllForAllPlayers", 1067 // "httpMethod": "POST", 1068 // "id": "gamesManagement.achievements.resetAllForAllPlayers", 1069 // "parameterOrder": [], 1070 // "parameters": {}, 1071 // "path": "games/v1management/achievements/resetAllForAllPlayers", 1072 // "scopes": [ 1073 // "https://www.googleapis.com/auth/games" 1074 // ] 1075 // } 1076 1077} 1078 1079// method id "gamesManagement.achievements.resetForAllPlayers": 1080 1081type AchievementsResetForAllPlayersCall struct { 1082 s *Service 1083 achievementId string 1084 urlParams_ gensupport.URLParams 1085 ctx_ context.Context 1086 header_ http.Header 1087} 1088 1089// ResetForAllPlayers: Resets the achievement with the given ID for all 1090// players. This method is only available to user accounts for your 1091// developer console. Only draft achievements can be reset. 1092// 1093// - achievementId: The ID of the achievement used by this method. 1094func (r *AchievementsService) ResetForAllPlayers(achievementId string) *AchievementsResetForAllPlayersCall { 1095 c := &AchievementsResetForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1096 c.achievementId = achievementId 1097 return c 1098} 1099 1100// Fields allows partial responses to be retrieved. See 1101// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1102// for more information. 1103func (c *AchievementsResetForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetForAllPlayersCall { 1104 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1105 return c 1106} 1107 1108// Context sets the context to be used in this call's Do method. Any 1109// pending HTTP request will be aborted if the provided context is 1110// canceled. 1111func (c *AchievementsResetForAllPlayersCall) Context(ctx context.Context) *AchievementsResetForAllPlayersCall { 1112 c.ctx_ = ctx 1113 return c 1114} 1115 1116// Header returns an http.Header that can be modified by the caller to 1117// add HTTP headers to the request. 1118func (c *AchievementsResetForAllPlayersCall) Header() http.Header { 1119 if c.header_ == nil { 1120 c.header_ = make(http.Header) 1121 } 1122 return c.header_ 1123} 1124 1125func (c *AchievementsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 1126 reqHeaders := make(http.Header) 1127 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1128 for k, v := range c.header_ { 1129 reqHeaders[k] = v 1130 } 1131 reqHeaders.Set("User-Agent", c.s.userAgent()) 1132 var body io.Reader = nil 1133 c.urlParams_.Set("alt", alt) 1134 c.urlParams_.Set("prettyPrint", "false") 1135 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/{achievementId}/resetForAllPlayers") 1136 urls += "?" + c.urlParams_.Encode() 1137 req, err := http.NewRequest("POST", urls, body) 1138 if err != nil { 1139 return nil, err 1140 } 1141 req.Header = reqHeaders 1142 googleapi.Expand(req.URL, map[string]string{ 1143 "achievementId": c.achievementId, 1144 }) 1145 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1146} 1147 1148// Do executes the "gamesManagement.achievements.resetForAllPlayers" call. 1149func (c *AchievementsResetForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 1150 gensupport.SetOptions(c.urlParams_, opts...) 1151 res, err := c.doRequest("json") 1152 if err != nil { 1153 return err 1154 } 1155 defer googleapi.CloseBody(res) 1156 if err := googleapi.CheckResponse(res); err != nil { 1157 return err 1158 } 1159 return nil 1160 // { 1161 // "description": "Resets the achievement with the given ID for all players. This method is only available to user accounts for your developer console. Only draft achievements can be reset.", 1162 // "flatPath": "games/v1management/achievements/{achievementId}/resetForAllPlayers", 1163 // "httpMethod": "POST", 1164 // "id": "gamesManagement.achievements.resetForAllPlayers", 1165 // "parameterOrder": [ 1166 // "achievementId" 1167 // ], 1168 // "parameters": { 1169 // "achievementId": { 1170 // "description": "The ID of the achievement used by this method.", 1171 // "location": "path", 1172 // "required": true, 1173 // "type": "string" 1174 // } 1175 // }, 1176 // "path": "games/v1management/achievements/{achievementId}/resetForAllPlayers", 1177 // "scopes": [ 1178 // "https://www.googleapis.com/auth/games" 1179 // ] 1180 // } 1181 1182} 1183 1184// method id "gamesManagement.achievements.resetMultipleForAllPlayers": 1185 1186type AchievementsResetMultipleForAllPlayersCall struct { 1187 s *Service 1188 achievementresetmultipleforallrequest *AchievementResetMultipleForAllRequest 1189 urlParams_ gensupport.URLParams 1190 ctx_ context.Context 1191 header_ http.Header 1192} 1193 1194// ResetMultipleForAllPlayers: Resets achievements with the given IDs 1195// for all players. This method is only available to user accounts for 1196// your developer console. Only draft achievements may be reset. 1197func (r *AchievementsService) ResetMultipleForAllPlayers(achievementresetmultipleforallrequest *AchievementResetMultipleForAllRequest) *AchievementsResetMultipleForAllPlayersCall { 1198 c := &AchievementsResetMultipleForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1199 c.achievementresetmultipleforallrequest = achievementresetmultipleforallrequest 1200 return c 1201} 1202 1203// Fields allows partial responses to be retrieved. See 1204// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1205// for more information. 1206func (c *AchievementsResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetMultipleForAllPlayersCall { 1207 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1208 return c 1209} 1210 1211// Context sets the context to be used in this call's Do method. Any 1212// pending HTTP request will be aborted if the provided context is 1213// canceled. 1214func (c *AchievementsResetMultipleForAllPlayersCall) Context(ctx context.Context) *AchievementsResetMultipleForAllPlayersCall { 1215 c.ctx_ = ctx 1216 return c 1217} 1218 1219// Header returns an http.Header that can be modified by the caller to 1220// add HTTP headers to the request. 1221func (c *AchievementsResetMultipleForAllPlayersCall) Header() http.Header { 1222 if c.header_ == nil { 1223 c.header_ = make(http.Header) 1224 } 1225 return c.header_ 1226} 1227 1228func (c *AchievementsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 1229 reqHeaders := make(http.Header) 1230 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1231 for k, v := range c.header_ { 1232 reqHeaders[k] = v 1233 } 1234 reqHeaders.Set("User-Agent", c.s.userAgent()) 1235 var body io.Reader = nil 1236 body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementresetmultipleforallrequest) 1237 if err != nil { 1238 return nil, err 1239 } 1240 reqHeaders.Set("Content-Type", "application/json") 1241 c.urlParams_.Set("alt", alt) 1242 c.urlParams_.Set("prettyPrint", "false") 1243 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/resetMultipleForAllPlayers") 1244 urls += "?" + c.urlParams_.Encode() 1245 req, err := http.NewRequest("POST", urls, body) 1246 if err != nil { 1247 return nil, err 1248 } 1249 req.Header = reqHeaders 1250 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1251} 1252 1253// Do executes the "gamesManagement.achievements.resetMultipleForAllPlayers" call. 1254func (c *AchievementsResetMultipleForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 1255 gensupport.SetOptions(c.urlParams_, opts...) 1256 res, err := c.doRequest("json") 1257 if err != nil { 1258 return err 1259 } 1260 defer googleapi.CloseBody(res) 1261 if err := googleapi.CheckResponse(res); err != nil { 1262 return err 1263 } 1264 return nil 1265 // { 1266 // "description": "Resets achievements with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft achievements may be reset.", 1267 // "flatPath": "games/v1management/achievements/resetMultipleForAllPlayers", 1268 // "httpMethod": "POST", 1269 // "id": "gamesManagement.achievements.resetMultipleForAllPlayers", 1270 // "parameterOrder": [], 1271 // "parameters": {}, 1272 // "path": "games/v1management/achievements/resetMultipleForAllPlayers", 1273 // "request": { 1274 // "$ref": "AchievementResetMultipleForAllRequest" 1275 // }, 1276 // "scopes": [ 1277 // "https://www.googleapis.com/auth/games" 1278 // ] 1279 // } 1280 1281} 1282 1283// method id "gamesManagement.applications.listHidden": 1284 1285type ApplicationsListHiddenCall struct { 1286 s *Service 1287 applicationId string 1288 urlParams_ gensupport.URLParams 1289 ifNoneMatch_ string 1290 ctx_ context.Context 1291 header_ http.Header 1292} 1293 1294// ListHidden: Get the list of players hidden from the given 1295// application. This method is only available to user accounts for your 1296// developer console. 1297// 1298// - applicationId: The application ID from the Google Play developer 1299// console. 1300func (r *ApplicationsService) ListHidden(applicationId string) *ApplicationsListHiddenCall { 1301 c := &ApplicationsListHiddenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1302 c.applicationId = applicationId 1303 return c 1304} 1305 1306// MaxResults sets the optional parameter "maxResults": The maximum 1307// number of player resources to return in the response, used for 1308// paging. For any response, the actual number of player resources 1309// returned may be less than the specified `maxResults`. 1310func (c *ApplicationsListHiddenCall) MaxResults(maxResults int64) *ApplicationsListHiddenCall { 1311 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 1312 return c 1313} 1314 1315// PageToken sets the optional parameter "pageToken": The token returned 1316// by the previous request. 1317func (c *ApplicationsListHiddenCall) PageToken(pageToken string) *ApplicationsListHiddenCall { 1318 c.urlParams_.Set("pageToken", pageToken) 1319 return c 1320} 1321 1322// Fields allows partial responses to be retrieved. See 1323// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1324// for more information. 1325func (c *ApplicationsListHiddenCall) Fields(s ...googleapi.Field) *ApplicationsListHiddenCall { 1326 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1327 return c 1328} 1329 1330// IfNoneMatch sets the optional parameter which makes the operation 1331// fail if the object's ETag matches the given value. This is useful for 1332// getting updates only after the object has changed since the last 1333// request. Use googleapi.IsNotModified to check whether the response 1334// error from Do is the result of In-None-Match. 1335func (c *ApplicationsListHiddenCall) IfNoneMatch(entityTag string) *ApplicationsListHiddenCall { 1336 c.ifNoneMatch_ = entityTag 1337 return c 1338} 1339 1340// Context sets the context to be used in this call's Do method. Any 1341// pending HTTP request will be aborted if the provided context is 1342// canceled. 1343func (c *ApplicationsListHiddenCall) Context(ctx context.Context) *ApplicationsListHiddenCall { 1344 c.ctx_ = ctx 1345 return c 1346} 1347 1348// Header returns an http.Header that can be modified by the caller to 1349// add HTTP headers to the request. 1350func (c *ApplicationsListHiddenCall) Header() http.Header { 1351 if c.header_ == nil { 1352 c.header_ = make(http.Header) 1353 } 1354 return c.header_ 1355} 1356 1357func (c *ApplicationsListHiddenCall) doRequest(alt string) (*http.Response, error) { 1358 reqHeaders := make(http.Header) 1359 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1360 for k, v := range c.header_ { 1361 reqHeaders[k] = v 1362 } 1363 reqHeaders.Set("User-Agent", c.s.userAgent()) 1364 if c.ifNoneMatch_ != "" { 1365 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1366 } 1367 var body io.Reader = nil 1368 c.urlParams_.Set("alt", alt) 1369 c.urlParams_.Set("prettyPrint", "false") 1370 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden") 1371 urls += "?" + c.urlParams_.Encode() 1372 req, err := http.NewRequest("GET", urls, body) 1373 if err != nil { 1374 return nil, err 1375 } 1376 req.Header = reqHeaders 1377 googleapi.Expand(req.URL, map[string]string{ 1378 "applicationId": c.applicationId, 1379 }) 1380 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1381} 1382 1383// Do executes the "gamesManagement.applications.listHidden" call. 1384// Exactly one of *HiddenPlayerList or error will be non-nil. Any 1385// non-2xx status code is an error. Response headers are in either 1386// *HiddenPlayerList.ServerResponse.Header or (if a response was 1387// returned at all) in error.(*googleapi.Error).Header. Use 1388// googleapi.IsNotModified to check whether the returned error was 1389// because http.StatusNotModified was returned. 1390func (c *ApplicationsListHiddenCall) Do(opts ...googleapi.CallOption) (*HiddenPlayerList, error) { 1391 gensupport.SetOptions(c.urlParams_, opts...) 1392 res, err := c.doRequest("json") 1393 if res != nil && res.StatusCode == http.StatusNotModified { 1394 if res.Body != nil { 1395 res.Body.Close() 1396 } 1397 return nil, &googleapi.Error{ 1398 Code: res.StatusCode, 1399 Header: res.Header, 1400 } 1401 } 1402 if err != nil { 1403 return nil, err 1404 } 1405 defer googleapi.CloseBody(res) 1406 if err := googleapi.CheckResponse(res); err != nil { 1407 return nil, err 1408 } 1409 ret := &HiddenPlayerList{ 1410 ServerResponse: googleapi.ServerResponse{ 1411 Header: res.Header, 1412 HTTPStatusCode: res.StatusCode, 1413 }, 1414 } 1415 target := &ret 1416 if err := gensupport.DecodeResponse(target, res); err != nil { 1417 return nil, err 1418 } 1419 return ret, nil 1420 // { 1421 // "description": "Get the list of players hidden from the given application. This method is only available to user accounts for your developer console.", 1422 // "flatPath": "games/v1management/applications/{applicationId}/players/hidden", 1423 // "httpMethod": "GET", 1424 // "id": "gamesManagement.applications.listHidden", 1425 // "parameterOrder": [ 1426 // "applicationId" 1427 // ], 1428 // "parameters": { 1429 // "applicationId": { 1430 // "description": "The application ID from the Google Play developer console.", 1431 // "location": "path", 1432 // "required": true, 1433 // "type": "string" 1434 // }, 1435 // "maxResults": { 1436 // "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`.", 1437 // "format": "int32", 1438 // "location": "query", 1439 // "type": "integer" 1440 // }, 1441 // "pageToken": { 1442 // "description": "The token returned by the previous request.", 1443 // "location": "query", 1444 // "type": "string" 1445 // } 1446 // }, 1447 // "path": "games/v1management/applications/{applicationId}/players/hidden", 1448 // "response": { 1449 // "$ref": "HiddenPlayerList" 1450 // }, 1451 // "scopes": [ 1452 // "https://www.googleapis.com/auth/games" 1453 // ] 1454 // } 1455 1456} 1457 1458// Pages invokes f for each page of results. 1459// A non-nil error returned from f will halt the iteration. 1460// The provided context supersedes any context provided to the Context method. 1461func (c *ApplicationsListHiddenCall) Pages(ctx context.Context, f func(*HiddenPlayerList) error) error { 1462 c.ctx_ = ctx 1463 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1464 for { 1465 x, err := c.Do() 1466 if err != nil { 1467 return err 1468 } 1469 if err := f(x); err != nil { 1470 return err 1471 } 1472 if x.NextPageToken == "" { 1473 return nil 1474 } 1475 c.PageToken(x.NextPageToken) 1476 } 1477} 1478 1479// method id "gamesManagement.events.reset": 1480 1481type EventsResetCall struct { 1482 s *Service 1483 eventId string 1484 urlParams_ gensupport.URLParams 1485 ctx_ context.Context 1486 header_ http.Header 1487} 1488 1489// Reset: Resets all player progress on the event with the given ID for 1490// the currently authenticated player. This method is only accessible to 1491// whitelisted tester accounts for your application. 1492// 1493// - eventId: The ID of the event. 1494func (r *EventsService) Reset(eventId string) *EventsResetCall { 1495 c := &EventsResetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1496 c.eventId = eventId 1497 return c 1498} 1499 1500// Fields allows partial responses to be retrieved. See 1501// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1502// for more information. 1503func (c *EventsResetCall) Fields(s ...googleapi.Field) *EventsResetCall { 1504 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1505 return c 1506} 1507 1508// Context sets the context to be used in this call's Do method. Any 1509// pending HTTP request will be aborted if the provided context is 1510// canceled. 1511func (c *EventsResetCall) Context(ctx context.Context) *EventsResetCall { 1512 c.ctx_ = ctx 1513 return c 1514} 1515 1516// Header returns an http.Header that can be modified by the caller to 1517// add HTTP headers to the request. 1518func (c *EventsResetCall) Header() http.Header { 1519 if c.header_ == nil { 1520 c.header_ = make(http.Header) 1521 } 1522 return c.header_ 1523} 1524 1525func (c *EventsResetCall) doRequest(alt string) (*http.Response, error) { 1526 reqHeaders := make(http.Header) 1527 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1528 for k, v := range c.header_ { 1529 reqHeaders[k] = v 1530 } 1531 reqHeaders.Set("User-Agent", c.s.userAgent()) 1532 var body io.Reader = nil 1533 c.urlParams_.Set("alt", alt) 1534 c.urlParams_.Set("prettyPrint", "false") 1535 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/{eventId}/reset") 1536 urls += "?" + c.urlParams_.Encode() 1537 req, err := http.NewRequest("POST", urls, body) 1538 if err != nil { 1539 return nil, err 1540 } 1541 req.Header = reqHeaders 1542 googleapi.Expand(req.URL, map[string]string{ 1543 "eventId": c.eventId, 1544 }) 1545 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1546} 1547 1548// Do executes the "gamesManagement.events.reset" call. 1549func (c *EventsResetCall) Do(opts ...googleapi.CallOption) error { 1550 gensupport.SetOptions(c.urlParams_, opts...) 1551 res, err := c.doRequest("json") 1552 if err != nil { 1553 return err 1554 } 1555 defer googleapi.CloseBody(res) 1556 if err := googleapi.CheckResponse(res); err != nil { 1557 return err 1558 } 1559 return nil 1560 // { 1561 // "description": "Resets all player progress on the event with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", 1562 // "flatPath": "games/v1management/events/{eventId}/reset", 1563 // "httpMethod": "POST", 1564 // "id": "gamesManagement.events.reset", 1565 // "parameterOrder": [ 1566 // "eventId" 1567 // ], 1568 // "parameters": { 1569 // "eventId": { 1570 // "description": "The ID of the event.", 1571 // "location": "path", 1572 // "required": true, 1573 // "type": "string" 1574 // } 1575 // }, 1576 // "path": "games/v1management/events/{eventId}/reset", 1577 // "scopes": [ 1578 // "https://www.googleapis.com/auth/games" 1579 // ] 1580 // } 1581 1582} 1583 1584// method id "gamesManagement.events.resetAll": 1585 1586type EventsResetAllCall struct { 1587 s *Service 1588 urlParams_ gensupport.URLParams 1589 ctx_ context.Context 1590 header_ http.Header 1591} 1592 1593// ResetAll: Resets all player progress on all events for the currently 1594// authenticated player. This method is only accessible to whitelisted 1595// tester accounts for your application. 1596func (r *EventsService) ResetAll() *EventsResetAllCall { 1597 c := &EventsResetAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1598 return c 1599} 1600 1601// Fields allows partial responses to be retrieved. See 1602// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1603// for more information. 1604func (c *EventsResetAllCall) Fields(s ...googleapi.Field) *EventsResetAllCall { 1605 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1606 return c 1607} 1608 1609// Context sets the context to be used in this call's Do method. Any 1610// pending HTTP request will be aborted if the provided context is 1611// canceled. 1612func (c *EventsResetAllCall) Context(ctx context.Context) *EventsResetAllCall { 1613 c.ctx_ = ctx 1614 return c 1615} 1616 1617// Header returns an http.Header that can be modified by the caller to 1618// add HTTP headers to the request. 1619func (c *EventsResetAllCall) Header() http.Header { 1620 if c.header_ == nil { 1621 c.header_ = make(http.Header) 1622 } 1623 return c.header_ 1624} 1625 1626func (c *EventsResetAllCall) doRequest(alt string) (*http.Response, error) { 1627 reqHeaders := make(http.Header) 1628 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1629 for k, v := range c.header_ { 1630 reqHeaders[k] = v 1631 } 1632 reqHeaders.Set("User-Agent", c.s.userAgent()) 1633 var body io.Reader = nil 1634 c.urlParams_.Set("alt", alt) 1635 c.urlParams_.Set("prettyPrint", "false") 1636 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/reset") 1637 urls += "?" + c.urlParams_.Encode() 1638 req, err := http.NewRequest("POST", urls, body) 1639 if err != nil { 1640 return nil, err 1641 } 1642 req.Header = reqHeaders 1643 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1644} 1645 1646// Do executes the "gamesManagement.events.resetAll" call. 1647func (c *EventsResetAllCall) Do(opts ...googleapi.CallOption) error { 1648 gensupport.SetOptions(c.urlParams_, opts...) 1649 res, err := c.doRequest("json") 1650 if err != nil { 1651 return err 1652 } 1653 defer googleapi.CloseBody(res) 1654 if err := googleapi.CheckResponse(res); err != nil { 1655 return err 1656 } 1657 return nil 1658 // { 1659 // "description": "Resets all player progress on all events for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", 1660 // "flatPath": "games/v1management/events/reset", 1661 // "httpMethod": "POST", 1662 // "id": "gamesManagement.events.resetAll", 1663 // "parameterOrder": [], 1664 // "parameters": {}, 1665 // "path": "games/v1management/events/reset", 1666 // "scopes": [ 1667 // "https://www.googleapis.com/auth/games" 1668 // ] 1669 // } 1670 1671} 1672 1673// method id "gamesManagement.events.resetAllForAllPlayers": 1674 1675type EventsResetAllForAllPlayersCall struct { 1676 s *Service 1677 urlParams_ gensupport.URLParams 1678 ctx_ context.Context 1679 header_ http.Header 1680} 1681 1682// ResetAllForAllPlayers: Resets all draft events for all players. This 1683// method is only available to user accounts for your developer console. 1684func (r *EventsService) ResetAllForAllPlayers() *EventsResetAllForAllPlayersCall { 1685 c := &EventsResetAllForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1686 return c 1687} 1688 1689// Fields allows partial responses to be retrieved. See 1690// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1691// for more information. 1692func (c *EventsResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetAllForAllPlayersCall { 1693 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1694 return c 1695} 1696 1697// Context sets the context to be used in this call's Do method. Any 1698// pending HTTP request will be aborted if the provided context is 1699// canceled. 1700func (c *EventsResetAllForAllPlayersCall) Context(ctx context.Context) *EventsResetAllForAllPlayersCall { 1701 c.ctx_ = ctx 1702 return c 1703} 1704 1705// Header returns an http.Header that can be modified by the caller to 1706// add HTTP headers to the request. 1707func (c *EventsResetAllForAllPlayersCall) Header() http.Header { 1708 if c.header_ == nil { 1709 c.header_ = make(http.Header) 1710 } 1711 return c.header_ 1712} 1713 1714func (c *EventsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 1715 reqHeaders := make(http.Header) 1716 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1717 for k, v := range c.header_ { 1718 reqHeaders[k] = v 1719 } 1720 reqHeaders.Set("User-Agent", c.s.userAgent()) 1721 var body io.Reader = nil 1722 c.urlParams_.Set("alt", alt) 1723 c.urlParams_.Set("prettyPrint", "false") 1724 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/resetAllForAllPlayers") 1725 urls += "?" + c.urlParams_.Encode() 1726 req, err := http.NewRequest("POST", urls, body) 1727 if err != nil { 1728 return nil, err 1729 } 1730 req.Header = reqHeaders 1731 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1732} 1733 1734// Do executes the "gamesManagement.events.resetAllForAllPlayers" call. 1735func (c *EventsResetAllForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 1736 gensupport.SetOptions(c.urlParams_, opts...) 1737 res, err := c.doRequest("json") 1738 if err != nil { 1739 return err 1740 } 1741 defer googleapi.CloseBody(res) 1742 if err := googleapi.CheckResponse(res); err != nil { 1743 return err 1744 } 1745 return nil 1746 // { 1747 // "description": "Resets all draft events for all players. This method is only available to user accounts for your developer console.", 1748 // "flatPath": "games/v1management/events/resetAllForAllPlayers", 1749 // "httpMethod": "POST", 1750 // "id": "gamesManagement.events.resetAllForAllPlayers", 1751 // "parameterOrder": [], 1752 // "parameters": {}, 1753 // "path": "games/v1management/events/resetAllForAllPlayers", 1754 // "scopes": [ 1755 // "https://www.googleapis.com/auth/games" 1756 // ] 1757 // } 1758 1759} 1760 1761// method id "gamesManagement.events.resetForAllPlayers": 1762 1763type EventsResetForAllPlayersCall struct { 1764 s *Service 1765 eventId string 1766 urlParams_ gensupport.URLParams 1767 ctx_ context.Context 1768 header_ http.Header 1769} 1770 1771// ResetForAllPlayers: Resets the event with the given ID for all 1772// players. This method is only available to user accounts for your 1773// developer console. Only draft events can be reset. 1774// 1775// - eventId: The ID of the event. 1776func (r *EventsService) ResetForAllPlayers(eventId string) *EventsResetForAllPlayersCall { 1777 c := &EventsResetForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1778 c.eventId = eventId 1779 return c 1780} 1781 1782// Fields allows partial responses to be retrieved. See 1783// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1784// for more information. 1785func (c *EventsResetForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetForAllPlayersCall { 1786 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1787 return c 1788} 1789 1790// Context sets the context to be used in this call's Do method. Any 1791// pending HTTP request will be aborted if the provided context is 1792// canceled. 1793func (c *EventsResetForAllPlayersCall) Context(ctx context.Context) *EventsResetForAllPlayersCall { 1794 c.ctx_ = ctx 1795 return c 1796} 1797 1798// Header returns an http.Header that can be modified by the caller to 1799// add HTTP headers to the request. 1800func (c *EventsResetForAllPlayersCall) Header() http.Header { 1801 if c.header_ == nil { 1802 c.header_ = make(http.Header) 1803 } 1804 return c.header_ 1805} 1806 1807func (c *EventsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 1808 reqHeaders := make(http.Header) 1809 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1810 for k, v := range c.header_ { 1811 reqHeaders[k] = v 1812 } 1813 reqHeaders.Set("User-Agent", c.s.userAgent()) 1814 var body io.Reader = nil 1815 c.urlParams_.Set("alt", alt) 1816 c.urlParams_.Set("prettyPrint", "false") 1817 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/{eventId}/resetForAllPlayers") 1818 urls += "?" + c.urlParams_.Encode() 1819 req, err := http.NewRequest("POST", urls, body) 1820 if err != nil { 1821 return nil, err 1822 } 1823 req.Header = reqHeaders 1824 googleapi.Expand(req.URL, map[string]string{ 1825 "eventId": c.eventId, 1826 }) 1827 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1828} 1829 1830// Do executes the "gamesManagement.events.resetForAllPlayers" call. 1831func (c *EventsResetForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 1832 gensupport.SetOptions(c.urlParams_, opts...) 1833 res, err := c.doRequest("json") 1834 if err != nil { 1835 return err 1836 } 1837 defer googleapi.CloseBody(res) 1838 if err := googleapi.CheckResponse(res); err != nil { 1839 return err 1840 } 1841 return nil 1842 // { 1843 // "description": "Resets the event with the given ID for all players. This method is only available to user accounts for your developer console. Only draft events can be reset.", 1844 // "flatPath": "games/v1management/events/{eventId}/resetForAllPlayers", 1845 // "httpMethod": "POST", 1846 // "id": "gamesManagement.events.resetForAllPlayers", 1847 // "parameterOrder": [ 1848 // "eventId" 1849 // ], 1850 // "parameters": { 1851 // "eventId": { 1852 // "description": "The ID of the event.", 1853 // "location": "path", 1854 // "required": true, 1855 // "type": "string" 1856 // } 1857 // }, 1858 // "path": "games/v1management/events/{eventId}/resetForAllPlayers", 1859 // "scopes": [ 1860 // "https://www.googleapis.com/auth/games" 1861 // ] 1862 // } 1863 1864} 1865 1866// method id "gamesManagement.events.resetMultipleForAllPlayers": 1867 1868type EventsResetMultipleForAllPlayersCall struct { 1869 s *Service 1870 eventsresetmultipleforallrequest *EventsResetMultipleForAllRequest 1871 urlParams_ gensupport.URLParams 1872 ctx_ context.Context 1873 header_ http.Header 1874} 1875 1876// ResetMultipleForAllPlayers: Resets events with the given IDs for all 1877// players. This method is only available to user accounts for your 1878// developer console. Only draft events may be reset. 1879func (r *EventsService) ResetMultipleForAllPlayers(eventsresetmultipleforallrequest *EventsResetMultipleForAllRequest) *EventsResetMultipleForAllPlayersCall { 1880 c := &EventsResetMultipleForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1881 c.eventsresetmultipleforallrequest = eventsresetmultipleforallrequest 1882 return c 1883} 1884 1885// Fields allows partial responses to be retrieved. See 1886// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1887// for more information. 1888func (c *EventsResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetMultipleForAllPlayersCall { 1889 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1890 return c 1891} 1892 1893// Context sets the context to be used in this call's Do method. Any 1894// pending HTTP request will be aborted if the provided context is 1895// canceled. 1896func (c *EventsResetMultipleForAllPlayersCall) Context(ctx context.Context) *EventsResetMultipleForAllPlayersCall { 1897 c.ctx_ = ctx 1898 return c 1899} 1900 1901// Header returns an http.Header that can be modified by the caller to 1902// add HTTP headers to the request. 1903func (c *EventsResetMultipleForAllPlayersCall) Header() http.Header { 1904 if c.header_ == nil { 1905 c.header_ = make(http.Header) 1906 } 1907 return c.header_ 1908} 1909 1910func (c *EventsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 1911 reqHeaders := make(http.Header) 1912 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 1913 for k, v := range c.header_ { 1914 reqHeaders[k] = v 1915 } 1916 reqHeaders.Set("User-Agent", c.s.userAgent()) 1917 var body io.Reader = nil 1918 body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventsresetmultipleforallrequest) 1919 if err != nil { 1920 return nil, err 1921 } 1922 reqHeaders.Set("Content-Type", "application/json") 1923 c.urlParams_.Set("alt", alt) 1924 c.urlParams_.Set("prettyPrint", "false") 1925 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/resetMultipleForAllPlayers") 1926 urls += "?" + c.urlParams_.Encode() 1927 req, err := http.NewRequest("POST", urls, body) 1928 if err != nil { 1929 return nil, err 1930 } 1931 req.Header = reqHeaders 1932 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1933} 1934 1935// Do executes the "gamesManagement.events.resetMultipleForAllPlayers" call. 1936func (c *EventsResetMultipleForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 1937 gensupport.SetOptions(c.urlParams_, opts...) 1938 res, err := c.doRequest("json") 1939 if err != nil { 1940 return err 1941 } 1942 defer googleapi.CloseBody(res) 1943 if err := googleapi.CheckResponse(res); err != nil { 1944 return err 1945 } 1946 return nil 1947 // { 1948 // "description": "Resets events with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft events may be reset.", 1949 // "flatPath": "games/v1management/events/resetMultipleForAllPlayers", 1950 // "httpMethod": "POST", 1951 // "id": "gamesManagement.events.resetMultipleForAllPlayers", 1952 // "parameterOrder": [], 1953 // "parameters": {}, 1954 // "path": "games/v1management/events/resetMultipleForAllPlayers", 1955 // "request": { 1956 // "$ref": "EventsResetMultipleForAllRequest" 1957 // }, 1958 // "scopes": [ 1959 // "https://www.googleapis.com/auth/games" 1960 // ] 1961 // } 1962 1963} 1964 1965// method id "gamesManagement.players.hide": 1966 1967type PlayersHideCall struct { 1968 s *Service 1969 applicationId string 1970 playerId string 1971 urlParams_ gensupport.URLParams 1972 ctx_ context.Context 1973 header_ http.Header 1974} 1975 1976// Hide: Hide the given player's leaderboard scores from the given 1977// application. This method is only available to user accounts for your 1978// developer console. 1979// 1980// - applicationId: The application ID from the Google Play developer 1981// console. 1982// - playerId: A player ID. A value of `me` may be used in place of the 1983// authenticated player's ID. 1984func (r *PlayersService) Hide(applicationId string, playerId string) *PlayersHideCall { 1985 c := &PlayersHideCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1986 c.applicationId = applicationId 1987 c.playerId = playerId 1988 return c 1989} 1990 1991// Fields allows partial responses to be retrieved. See 1992// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1993// for more information. 1994func (c *PlayersHideCall) Fields(s ...googleapi.Field) *PlayersHideCall { 1995 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1996 return c 1997} 1998 1999// Context sets the context to be used in this call's Do method. Any 2000// pending HTTP request will be aborted if the provided context is 2001// canceled. 2002func (c *PlayersHideCall) Context(ctx context.Context) *PlayersHideCall { 2003 c.ctx_ = ctx 2004 return c 2005} 2006 2007// Header returns an http.Header that can be modified by the caller to 2008// add HTTP headers to the request. 2009func (c *PlayersHideCall) Header() http.Header { 2010 if c.header_ == nil { 2011 c.header_ = make(http.Header) 2012 } 2013 return c.header_ 2014} 2015 2016func (c *PlayersHideCall) doRequest(alt string) (*http.Response, error) { 2017 reqHeaders := make(http.Header) 2018 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 2019 for k, v := range c.header_ { 2020 reqHeaders[k] = v 2021 } 2022 reqHeaders.Set("User-Agent", c.s.userAgent()) 2023 var body io.Reader = nil 2024 c.urlParams_.Set("alt", alt) 2025 c.urlParams_.Set("prettyPrint", "false") 2026 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden/{playerId}") 2027 urls += "?" + c.urlParams_.Encode() 2028 req, err := http.NewRequest("POST", urls, body) 2029 if err != nil { 2030 return nil, err 2031 } 2032 req.Header = reqHeaders 2033 googleapi.Expand(req.URL, map[string]string{ 2034 "applicationId": c.applicationId, 2035 "playerId": c.playerId, 2036 }) 2037 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2038} 2039 2040// Do executes the "gamesManagement.players.hide" call. 2041func (c *PlayersHideCall) Do(opts ...googleapi.CallOption) error { 2042 gensupport.SetOptions(c.urlParams_, opts...) 2043 res, err := c.doRequest("json") 2044 if err != nil { 2045 return err 2046 } 2047 defer googleapi.CloseBody(res) 2048 if err := googleapi.CheckResponse(res); err != nil { 2049 return err 2050 } 2051 return nil 2052 // { 2053 // "description": "Hide the given player's leaderboard scores from the given application. This method is only available to user accounts for your developer console.", 2054 // "flatPath": "games/v1management/applications/{applicationId}/players/hidden/{playerId}", 2055 // "httpMethod": "POST", 2056 // "id": "gamesManagement.players.hide", 2057 // "parameterOrder": [ 2058 // "applicationId", 2059 // "playerId" 2060 // ], 2061 // "parameters": { 2062 // "applicationId": { 2063 // "description": "The application ID from the Google Play developer console.", 2064 // "location": "path", 2065 // "required": true, 2066 // "type": "string" 2067 // }, 2068 // "playerId": { 2069 // "description": "A player ID. A value of `me` may be used in place of the authenticated player's ID.", 2070 // "location": "path", 2071 // "required": true, 2072 // "type": "string" 2073 // } 2074 // }, 2075 // "path": "games/v1management/applications/{applicationId}/players/hidden/{playerId}", 2076 // "scopes": [ 2077 // "https://www.googleapis.com/auth/games" 2078 // ] 2079 // } 2080 2081} 2082 2083// method id "gamesManagement.players.unhide": 2084 2085type PlayersUnhideCall struct { 2086 s *Service 2087 applicationId string 2088 playerId string 2089 urlParams_ gensupport.URLParams 2090 ctx_ context.Context 2091 header_ http.Header 2092} 2093 2094// Unhide: Unhide the given player's leaderboard scores from the given 2095// application. This method is only available to user accounts for your 2096// developer console. 2097// 2098// - applicationId: The application ID from the Google Play developer 2099// console. 2100// - playerId: A player ID. A value of `me` may be used in place of the 2101// authenticated player's ID. 2102func (r *PlayersService) Unhide(applicationId string, playerId string) *PlayersUnhideCall { 2103 c := &PlayersUnhideCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2104 c.applicationId = applicationId 2105 c.playerId = playerId 2106 return c 2107} 2108 2109// Fields allows partial responses to be retrieved. See 2110// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2111// for more information. 2112func (c *PlayersUnhideCall) Fields(s ...googleapi.Field) *PlayersUnhideCall { 2113 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2114 return c 2115} 2116 2117// Context sets the context to be used in this call's Do method. Any 2118// pending HTTP request will be aborted if the provided context is 2119// canceled. 2120func (c *PlayersUnhideCall) Context(ctx context.Context) *PlayersUnhideCall { 2121 c.ctx_ = ctx 2122 return c 2123} 2124 2125// Header returns an http.Header that can be modified by the caller to 2126// add HTTP headers to the request. 2127func (c *PlayersUnhideCall) Header() http.Header { 2128 if c.header_ == nil { 2129 c.header_ = make(http.Header) 2130 } 2131 return c.header_ 2132} 2133 2134func (c *PlayersUnhideCall) doRequest(alt string) (*http.Response, error) { 2135 reqHeaders := make(http.Header) 2136 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 2137 for k, v := range c.header_ { 2138 reqHeaders[k] = v 2139 } 2140 reqHeaders.Set("User-Agent", c.s.userAgent()) 2141 var body io.Reader = nil 2142 c.urlParams_.Set("alt", alt) 2143 c.urlParams_.Set("prettyPrint", "false") 2144 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden/{playerId}") 2145 urls += "?" + c.urlParams_.Encode() 2146 req, err := http.NewRequest("DELETE", urls, body) 2147 if err != nil { 2148 return nil, err 2149 } 2150 req.Header = reqHeaders 2151 googleapi.Expand(req.URL, map[string]string{ 2152 "applicationId": c.applicationId, 2153 "playerId": c.playerId, 2154 }) 2155 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2156} 2157 2158// Do executes the "gamesManagement.players.unhide" call. 2159func (c *PlayersUnhideCall) Do(opts ...googleapi.CallOption) error { 2160 gensupport.SetOptions(c.urlParams_, opts...) 2161 res, err := c.doRequest("json") 2162 if err != nil { 2163 return err 2164 } 2165 defer googleapi.CloseBody(res) 2166 if err := googleapi.CheckResponse(res); err != nil { 2167 return err 2168 } 2169 return nil 2170 // { 2171 // "description": "Unhide the given player's leaderboard scores from the given application. This method is only available to user accounts for your developer console.", 2172 // "flatPath": "games/v1management/applications/{applicationId}/players/hidden/{playerId}", 2173 // "httpMethod": "DELETE", 2174 // "id": "gamesManagement.players.unhide", 2175 // "parameterOrder": [ 2176 // "applicationId", 2177 // "playerId" 2178 // ], 2179 // "parameters": { 2180 // "applicationId": { 2181 // "description": "The application ID from the Google Play developer console.", 2182 // "location": "path", 2183 // "required": true, 2184 // "type": "string" 2185 // }, 2186 // "playerId": { 2187 // "description": "A player ID. A value of `me` may be used in place of the authenticated player's ID.", 2188 // "location": "path", 2189 // "required": true, 2190 // "type": "string" 2191 // } 2192 // }, 2193 // "path": "games/v1management/applications/{applicationId}/players/hidden/{playerId}", 2194 // "scopes": [ 2195 // "https://www.googleapis.com/auth/games" 2196 // ] 2197 // } 2198 2199} 2200 2201// method id "gamesManagement.scores.reset": 2202 2203type ScoresResetCall struct { 2204 s *Service 2205 leaderboardId string 2206 urlParams_ gensupport.URLParams 2207 ctx_ context.Context 2208 header_ http.Header 2209} 2210 2211// Reset: Resets scores for the leaderboard with the given ID for the 2212// currently authenticated player. This method is only accessible to 2213// whitelisted tester accounts for your application. 2214// 2215// - leaderboardId: The ID of the leaderboard. 2216func (r *ScoresService) Reset(leaderboardId string) *ScoresResetCall { 2217 c := &ScoresResetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2218 c.leaderboardId = leaderboardId 2219 return c 2220} 2221 2222// Fields allows partial responses to be retrieved. See 2223// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2224// for more information. 2225func (c *ScoresResetCall) Fields(s ...googleapi.Field) *ScoresResetCall { 2226 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2227 return c 2228} 2229 2230// Context sets the context to be used in this call's Do method. Any 2231// pending HTTP request will be aborted if the provided context is 2232// canceled. 2233func (c *ScoresResetCall) Context(ctx context.Context) *ScoresResetCall { 2234 c.ctx_ = ctx 2235 return c 2236} 2237 2238// Header returns an http.Header that can be modified by the caller to 2239// add HTTP headers to the request. 2240func (c *ScoresResetCall) Header() http.Header { 2241 if c.header_ == nil { 2242 c.header_ = make(http.Header) 2243 } 2244 return c.header_ 2245} 2246 2247func (c *ScoresResetCall) doRequest(alt string) (*http.Response, error) { 2248 reqHeaders := make(http.Header) 2249 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 2250 for k, v := range c.header_ { 2251 reqHeaders[k] = v 2252 } 2253 reqHeaders.Set("User-Agent", c.s.userAgent()) 2254 var body io.Reader = nil 2255 c.urlParams_.Set("alt", alt) 2256 c.urlParams_.Set("prettyPrint", "false") 2257 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/leaderboards/{leaderboardId}/scores/reset") 2258 urls += "?" + c.urlParams_.Encode() 2259 req, err := http.NewRequest("POST", urls, body) 2260 if err != nil { 2261 return nil, err 2262 } 2263 req.Header = reqHeaders 2264 googleapi.Expand(req.URL, map[string]string{ 2265 "leaderboardId": c.leaderboardId, 2266 }) 2267 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2268} 2269 2270// Do executes the "gamesManagement.scores.reset" call. 2271// Exactly one of *PlayerScoreResetResponse or error will be non-nil. 2272// Any non-2xx status code is an error. Response headers are in either 2273// *PlayerScoreResetResponse.ServerResponse.Header or (if a response was 2274// returned at all) in error.(*googleapi.Error).Header. Use 2275// googleapi.IsNotModified to check whether the returned error was 2276// because http.StatusNotModified was returned. 2277func (c *ScoresResetCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResetResponse, error) { 2278 gensupport.SetOptions(c.urlParams_, opts...) 2279 res, err := c.doRequest("json") 2280 if res != nil && res.StatusCode == http.StatusNotModified { 2281 if res.Body != nil { 2282 res.Body.Close() 2283 } 2284 return nil, &googleapi.Error{ 2285 Code: res.StatusCode, 2286 Header: res.Header, 2287 } 2288 } 2289 if err != nil { 2290 return nil, err 2291 } 2292 defer googleapi.CloseBody(res) 2293 if err := googleapi.CheckResponse(res); err != nil { 2294 return nil, err 2295 } 2296 ret := &PlayerScoreResetResponse{ 2297 ServerResponse: googleapi.ServerResponse{ 2298 Header: res.Header, 2299 HTTPStatusCode: res.StatusCode, 2300 }, 2301 } 2302 target := &ret 2303 if err := gensupport.DecodeResponse(target, res); err != nil { 2304 return nil, err 2305 } 2306 return ret, nil 2307 // { 2308 // "description": "Resets scores for the leaderboard with the given ID for the currently authenticated player. This method is only accessible to whitelisted tester accounts for your application.", 2309 // "flatPath": "games/v1management/leaderboards/{leaderboardId}/scores/reset", 2310 // "httpMethod": "POST", 2311 // "id": "gamesManagement.scores.reset", 2312 // "parameterOrder": [ 2313 // "leaderboardId" 2314 // ], 2315 // "parameters": { 2316 // "leaderboardId": { 2317 // "description": "The ID of the leaderboard.", 2318 // "location": "path", 2319 // "required": true, 2320 // "type": "string" 2321 // } 2322 // }, 2323 // "path": "games/v1management/leaderboards/{leaderboardId}/scores/reset", 2324 // "response": { 2325 // "$ref": "PlayerScoreResetResponse" 2326 // }, 2327 // "scopes": [ 2328 // "https://www.googleapis.com/auth/games" 2329 // ] 2330 // } 2331 2332} 2333 2334// method id "gamesManagement.scores.resetAll": 2335 2336type ScoresResetAllCall struct { 2337 s *Service 2338 urlParams_ gensupport.URLParams 2339 ctx_ context.Context 2340 header_ http.Header 2341} 2342 2343// ResetAll: Resets all scores for all leaderboards for the currently 2344// authenticated players. This method is only accessible to whitelisted 2345// tester accounts for your application. 2346func (r *ScoresService) ResetAll() *ScoresResetAllCall { 2347 c := &ScoresResetAllCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2348 return c 2349} 2350 2351// Fields allows partial responses to be retrieved. See 2352// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2353// for more information. 2354func (c *ScoresResetAllCall) Fields(s ...googleapi.Field) *ScoresResetAllCall { 2355 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2356 return c 2357} 2358 2359// Context sets the context to be used in this call's Do method. Any 2360// pending HTTP request will be aborted if the provided context is 2361// canceled. 2362func (c *ScoresResetAllCall) Context(ctx context.Context) *ScoresResetAllCall { 2363 c.ctx_ = ctx 2364 return c 2365} 2366 2367// Header returns an http.Header that can be modified by the caller to 2368// add HTTP headers to the request. 2369func (c *ScoresResetAllCall) Header() http.Header { 2370 if c.header_ == nil { 2371 c.header_ = make(http.Header) 2372 } 2373 return c.header_ 2374} 2375 2376func (c *ScoresResetAllCall) doRequest(alt string) (*http.Response, error) { 2377 reqHeaders := make(http.Header) 2378 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 2379 for k, v := range c.header_ { 2380 reqHeaders[k] = v 2381 } 2382 reqHeaders.Set("User-Agent", c.s.userAgent()) 2383 var body io.Reader = nil 2384 c.urlParams_.Set("alt", alt) 2385 c.urlParams_.Set("prettyPrint", "false") 2386 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/scores/reset") 2387 urls += "?" + c.urlParams_.Encode() 2388 req, err := http.NewRequest("POST", urls, body) 2389 if err != nil { 2390 return nil, err 2391 } 2392 req.Header = reqHeaders 2393 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2394} 2395 2396// Do executes the "gamesManagement.scores.resetAll" call. 2397// Exactly one of *PlayerScoreResetAllResponse or error will be non-nil. 2398// Any non-2xx status code is an error. Response headers are in either 2399// *PlayerScoreResetAllResponse.ServerResponse.Header or (if a response 2400// was returned at all) in error.(*googleapi.Error).Header. Use 2401// googleapi.IsNotModified to check whether the returned error was 2402// because http.StatusNotModified was returned. 2403func (c *ScoresResetAllCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResetAllResponse, error) { 2404 gensupport.SetOptions(c.urlParams_, opts...) 2405 res, err := c.doRequest("json") 2406 if res != nil && res.StatusCode == http.StatusNotModified { 2407 if res.Body != nil { 2408 res.Body.Close() 2409 } 2410 return nil, &googleapi.Error{ 2411 Code: res.StatusCode, 2412 Header: res.Header, 2413 } 2414 } 2415 if err != nil { 2416 return nil, err 2417 } 2418 defer googleapi.CloseBody(res) 2419 if err := googleapi.CheckResponse(res); err != nil { 2420 return nil, err 2421 } 2422 ret := &PlayerScoreResetAllResponse{ 2423 ServerResponse: googleapi.ServerResponse{ 2424 Header: res.Header, 2425 HTTPStatusCode: res.StatusCode, 2426 }, 2427 } 2428 target := &ret 2429 if err := gensupport.DecodeResponse(target, res); err != nil { 2430 return nil, err 2431 } 2432 return ret, nil 2433 // { 2434 // "description": "Resets all scores for all leaderboards for the currently authenticated players. This method is only accessible to whitelisted tester accounts for your application.", 2435 // "flatPath": "games/v1management/scores/reset", 2436 // "httpMethod": "POST", 2437 // "id": "gamesManagement.scores.resetAll", 2438 // "parameterOrder": [], 2439 // "parameters": {}, 2440 // "path": "games/v1management/scores/reset", 2441 // "response": { 2442 // "$ref": "PlayerScoreResetAllResponse" 2443 // }, 2444 // "scopes": [ 2445 // "https://www.googleapis.com/auth/games" 2446 // ] 2447 // } 2448 2449} 2450 2451// method id "gamesManagement.scores.resetAllForAllPlayers": 2452 2453type ScoresResetAllForAllPlayersCall struct { 2454 s *Service 2455 urlParams_ gensupport.URLParams 2456 ctx_ context.Context 2457 header_ http.Header 2458} 2459 2460// ResetAllForAllPlayers: Resets scores for all draft leaderboards for 2461// all players. This method is only available to user accounts for your 2462// developer console. 2463func (r *ScoresService) ResetAllForAllPlayers() *ScoresResetAllForAllPlayersCall { 2464 c := &ScoresResetAllForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2465 return c 2466} 2467 2468// Fields allows partial responses to be retrieved. See 2469// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2470// for more information. 2471func (c *ScoresResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetAllForAllPlayersCall { 2472 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2473 return c 2474} 2475 2476// Context sets the context to be used in this call's Do method. Any 2477// pending HTTP request will be aborted if the provided context is 2478// canceled. 2479func (c *ScoresResetAllForAllPlayersCall) Context(ctx context.Context) *ScoresResetAllForAllPlayersCall { 2480 c.ctx_ = ctx 2481 return c 2482} 2483 2484// Header returns an http.Header that can be modified by the caller to 2485// add HTTP headers to the request. 2486func (c *ScoresResetAllForAllPlayersCall) Header() http.Header { 2487 if c.header_ == nil { 2488 c.header_ = make(http.Header) 2489 } 2490 return c.header_ 2491} 2492 2493func (c *ScoresResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 2494 reqHeaders := make(http.Header) 2495 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 2496 for k, v := range c.header_ { 2497 reqHeaders[k] = v 2498 } 2499 reqHeaders.Set("User-Agent", c.s.userAgent()) 2500 var body io.Reader = nil 2501 c.urlParams_.Set("alt", alt) 2502 c.urlParams_.Set("prettyPrint", "false") 2503 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/scores/resetAllForAllPlayers") 2504 urls += "?" + c.urlParams_.Encode() 2505 req, err := http.NewRequest("POST", urls, body) 2506 if err != nil { 2507 return nil, err 2508 } 2509 req.Header = reqHeaders 2510 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2511} 2512 2513// Do executes the "gamesManagement.scores.resetAllForAllPlayers" call. 2514func (c *ScoresResetAllForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 2515 gensupport.SetOptions(c.urlParams_, opts...) 2516 res, err := c.doRequest("json") 2517 if err != nil { 2518 return err 2519 } 2520 defer googleapi.CloseBody(res) 2521 if err := googleapi.CheckResponse(res); err != nil { 2522 return err 2523 } 2524 return nil 2525 // { 2526 // "description": "Resets scores for all draft leaderboards for all players. This method is only available to user accounts for your developer console.", 2527 // "flatPath": "games/v1management/scores/resetAllForAllPlayers", 2528 // "httpMethod": "POST", 2529 // "id": "gamesManagement.scores.resetAllForAllPlayers", 2530 // "parameterOrder": [], 2531 // "parameters": {}, 2532 // "path": "games/v1management/scores/resetAllForAllPlayers", 2533 // "scopes": [ 2534 // "https://www.googleapis.com/auth/games" 2535 // ] 2536 // } 2537 2538} 2539 2540// method id "gamesManagement.scores.resetForAllPlayers": 2541 2542type ScoresResetForAllPlayersCall struct { 2543 s *Service 2544 leaderboardId string 2545 urlParams_ gensupport.URLParams 2546 ctx_ context.Context 2547 header_ http.Header 2548} 2549 2550// ResetForAllPlayers: Resets scores for the leaderboard with the given 2551// ID for all players. This method is only available to user accounts 2552// for your developer console. Only draft leaderboards can be reset. 2553// 2554// - leaderboardId: The ID of the leaderboard. 2555func (r *ScoresService) ResetForAllPlayers(leaderboardId string) *ScoresResetForAllPlayersCall { 2556 c := &ScoresResetForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2557 c.leaderboardId = leaderboardId 2558 return c 2559} 2560 2561// Fields allows partial responses to be retrieved. See 2562// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2563// for more information. 2564func (c *ScoresResetForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetForAllPlayersCall { 2565 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2566 return c 2567} 2568 2569// Context sets the context to be used in this call's Do method. Any 2570// pending HTTP request will be aborted if the provided context is 2571// canceled. 2572func (c *ScoresResetForAllPlayersCall) Context(ctx context.Context) *ScoresResetForAllPlayersCall { 2573 c.ctx_ = ctx 2574 return c 2575} 2576 2577// Header returns an http.Header that can be modified by the caller to 2578// add HTTP headers to the request. 2579func (c *ScoresResetForAllPlayersCall) Header() http.Header { 2580 if c.header_ == nil { 2581 c.header_ = make(http.Header) 2582 } 2583 return c.header_ 2584} 2585 2586func (c *ScoresResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 2587 reqHeaders := make(http.Header) 2588 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 2589 for k, v := range c.header_ { 2590 reqHeaders[k] = v 2591 } 2592 reqHeaders.Set("User-Agent", c.s.userAgent()) 2593 var body io.Reader = nil 2594 c.urlParams_.Set("alt", alt) 2595 c.urlParams_.Set("prettyPrint", "false") 2596 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/leaderboards/{leaderboardId}/scores/resetForAllPlayers") 2597 urls += "?" + c.urlParams_.Encode() 2598 req, err := http.NewRequest("POST", urls, body) 2599 if err != nil { 2600 return nil, err 2601 } 2602 req.Header = reqHeaders 2603 googleapi.Expand(req.URL, map[string]string{ 2604 "leaderboardId": c.leaderboardId, 2605 }) 2606 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2607} 2608 2609// Do executes the "gamesManagement.scores.resetForAllPlayers" call. 2610func (c *ScoresResetForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 2611 gensupport.SetOptions(c.urlParams_, opts...) 2612 res, err := c.doRequest("json") 2613 if err != nil { 2614 return err 2615 } 2616 defer googleapi.CloseBody(res) 2617 if err := googleapi.CheckResponse(res); err != nil { 2618 return err 2619 } 2620 return nil 2621 // { 2622 // "description": "Resets scores for the leaderboard with the given ID for all players. This method is only available to user accounts for your developer console. Only draft leaderboards can be reset.", 2623 // "flatPath": "games/v1management/leaderboards/{leaderboardId}/scores/resetForAllPlayers", 2624 // "httpMethod": "POST", 2625 // "id": "gamesManagement.scores.resetForAllPlayers", 2626 // "parameterOrder": [ 2627 // "leaderboardId" 2628 // ], 2629 // "parameters": { 2630 // "leaderboardId": { 2631 // "description": "The ID of the leaderboard.", 2632 // "location": "path", 2633 // "required": true, 2634 // "type": "string" 2635 // } 2636 // }, 2637 // "path": "games/v1management/leaderboards/{leaderboardId}/scores/resetForAllPlayers", 2638 // "scopes": [ 2639 // "https://www.googleapis.com/auth/games" 2640 // ] 2641 // } 2642 2643} 2644 2645// method id "gamesManagement.scores.resetMultipleForAllPlayers": 2646 2647type ScoresResetMultipleForAllPlayersCall struct { 2648 s *Service 2649 scoresresetmultipleforallrequest *ScoresResetMultipleForAllRequest 2650 urlParams_ gensupport.URLParams 2651 ctx_ context.Context 2652 header_ http.Header 2653} 2654 2655// ResetMultipleForAllPlayers: Resets scores for the leaderboards with 2656// the given IDs for all players. This method is only available to user 2657// accounts for your developer console. Only draft leaderboards may be 2658// reset. 2659func (r *ScoresService) ResetMultipleForAllPlayers(scoresresetmultipleforallrequest *ScoresResetMultipleForAllRequest) *ScoresResetMultipleForAllPlayersCall { 2660 c := &ScoresResetMultipleForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2661 c.scoresresetmultipleforallrequest = scoresresetmultipleforallrequest 2662 return c 2663} 2664 2665// Fields allows partial responses to be retrieved. See 2666// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2667// for more information. 2668func (c *ScoresResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetMultipleForAllPlayersCall { 2669 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2670 return c 2671} 2672 2673// Context sets the context to be used in this call's Do method. Any 2674// pending HTTP request will be aborted if the provided context is 2675// canceled. 2676func (c *ScoresResetMultipleForAllPlayersCall) Context(ctx context.Context) *ScoresResetMultipleForAllPlayersCall { 2677 c.ctx_ = ctx 2678 return c 2679} 2680 2681// Header returns an http.Header that can be modified by the caller to 2682// add HTTP headers to the request. 2683func (c *ScoresResetMultipleForAllPlayersCall) Header() http.Header { 2684 if c.header_ == nil { 2685 c.header_ = make(http.Header) 2686 } 2687 return c.header_ 2688} 2689 2690func (c *ScoresResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) { 2691 reqHeaders := make(http.Header) 2692 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 2693 for k, v := range c.header_ { 2694 reqHeaders[k] = v 2695 } 2696 reqHeaders.Set("User-Agent", c.s.userAgent()) 2697 var body io.Reader = nil 2698 body, err := googleapi.WithoutDataWrapper.JSONReader(c.scoresresetmultipleforallrequest) 2699 if err != nil { 2700 return nil, err 2701 } 2702 reqHeaders.Set("Content-Type", "application/json") 2703 c.urlParams_.Set("alt", alt) 2704 c.urlParams_.Set("prettyPrint", "false") 2705 urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/scores/resetMultipleForAllPlayers") 2706 urls += "?" + c.urlParams_.Encode() 2707 req, err := http.NewRequest("POST", urls, body) 2708 if err != nil { 2709 return nil, err 2710 } 2711 req.Header = reqHeaders 2712 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2713} 2714 2715// Do executes the "gamesManagement.scores.resetMultipleForAllPlayers" call. 2716func (c *ScoresResetMultipleForAllPlayersCall) Do(opts ...googleapi.CallOption) error { 2717 gensupport.SetOptions(c.urlParams_, opts...) 2718 res, err := c.doRequest("json") 2719 if err != nil { 2720 return err 2721 } 2722 defer googleapi.CloseBody(res) 2723 if err := googleapi.CheckResponse(res); err != nil { 2724 return err 2725 } 2726 return nil 2727 // { 2728 // "description": "Resets scores for the leaderboards with the given IDs for all players. This method is only available to user accounts for your developer console. Only draft leaderboards may be reset.", 2729 // "flatPath": "games/v1management/scores/resetMultipleForAllPlayers", 2730 // "httpMethod": "POST", 2731 // "id": "gamesManagement.scores.resetMultipleForAllPlayers", 2732 // "parameterOrder": [], 2733 // "parameters": {}, 2734 // "path": "games/v1management/scores/resetMultipleForAllPlayers", 2735 // "request": { 2736 // "$ref": "ScoresResetMultipleForAllRequest" 2737 // }, 2738 // "scopes": [ 2739 // "https://www.googleapis.com/auth/games" 2740 // ] 2741 // } 2742 2743} 2744