...

Source file src/google.golang.org/api/gamesmanagement/v1management/gamesmanagement-gen.go

Documentation: google.golang.org/api/gamesmanagement/v1management

     1  // Copyright 2024 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  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/gamesmanagement/v1management"
    27  //	...
    28  //	ctx := context.Background()
    29  //	gamesmanagementService, err := gamesmanagement.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	gamesmanagementService, err := gamesmanagement.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	gamesmanagementService, err := gamesmanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package gamesmanagement // import "google.golang.org/api/gamesmanagement/v1management"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "gamesManagement:v1management"
    90  const apiName = "gamesManagement"
    91  const apiVersion = "v1management"
    92  const basePath = "https://gamesmanagement.googleapis.com/"
    93  const basePathTemplate = "https://gamesmanagement.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://gamesmanagement.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// Create, edit, and delete your Google Play Games activity
    99  	GamesScope = "https://www.googleapis.com/auth/games"
   100  )
   101  
   102  // NewService creates a new Service.
   103  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   104  	scopesOption := internaloption.WithDefaultScopes(
   105  		"https://www.googleapis.com/auth/games",
   106  	)
   107  	// NOTE: prepend, so we don't override user-specified scopes.
   108  	opts = append([]option.ClientOption{scopesOption}, opts...)
   109  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   110  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   111  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   112  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   113  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	s, err := New(client)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	if endpoint != "" {
   122  		s.BasePath = endpoint
   123  	}
   124  	return s, nil
   125  }
   126  
   127  // New creates a new Service. It uses the provided http.Client for requests.
   128  //
   129  // Deprecated: please use NewService instead.
   130  // To provide a custom HTTP client, use option.WithHTTPClient.
   131  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   132  func New(client *http.Client) (*Service, error) {
   133  	if client == nil {
   134  		return nil, errors.New("client is nil")
   135  	}
   136  	s := &Service{client: client, BasePath: basePath}
   137  	s.Achievements = NewAchievementsService(s)
   138  	s.Applications = NewApplicationsService(s)
   139  	s.Events = NewEventsService(s)
   140  	s.Players = NewPlayersService(s)
   141  	s.Scores = NewScoresService(s)
   142  	return s, nil
   143  }
   144  
   145  type Service struct {
   146  	client    *http.Client
   147  	BasePath  string // API endpoint base URL
   148  	UserAgent string // optional additional User-Agent fragment
   149  
   150  	Achievements *AchievementsService
   151  
   152  	Applications *ApplicationsService
   153  
   154  	Events *EventsService
   155  
   156  	Players *PlayersService
   157  
   158  	Scores *ScoresService
   159  }
   160  
   161  func (s *Service) userAgent() string {
   162  	if s.UserAgent == "" {
   163  		return googleapi.UserAgent
   164  	}
   165  	return googleapi.UserAgent + " " + s.UserAgent
   166  }
   167  
   168  func NewAchievementsService(s *Service) *AchievementsService {
   169  	rs := &AchievementsService{s: s}
   170  	return rs
   171  }
   172  
   173  type AchievementsService struct {
   174  	s *Service
   175  }
   176  
   177  func NewApplicationsService(s *Service) *ApplicationsService {
   178  	rs := &ApplicationsService{s: s}
   179  	return rs
   180  }
   181  
   182  type ApplicationsService struct {
   183  	s *Service
   184  }
   185  
   186  func NewEventsService(s *Service) *EventsService {
   187  	rs := &EventsService{s: s}
   188  	return rs
   189  }
   190  
   191  type EventsService struct {
   192  	s *Service
   193  }
   194  
   195  func NewPlayersService(s *Service) *PlayersService {
   196  	rs := &PlayersService{s: s}
   197  	return rs
   198  }
   199  
   200  type PlayersService struct {
   201  	s *Service
   202  }
   203  
   204  func NewScoresService(s *Service) *ScoresService {
   205  	rs := &ScoresService{s: s}
   206  	return rs
   207  }
   208  
   209  type ScoresService struct {
   210  	s *Service
   211  }
   212  
   213  // AchievementResetAllResponse: Achievement reset all response.
   214  type AchievementResetAllResponse struct {
   215  	// Kind: Uniquely identifies the type of this resource. Value is always the
   216  	// fixed string `gamesManagement#achievementResetAllResponse`.
   217  	Kind string `json:"kind,omitempty"`
   218  	// Results: The achievement reset results.
   219  	Results []*AchievementResetResponse `json:"results,omitempty"`
   220  
   221  	// ServerResponse contains the HTTP response code and headers from the server.
   222  	googleapi.ServerResponse `json:"-"`
   223  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
   224  	// include in API requests. By default, fields with empty or default values are
   225  	// omitted from API requests. See
   226  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   227  	// details.
   228  	ForceSendFields []string `json:"-"`
   229  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
   230  	// with the JSON null value. By default, fields with empty values are omitted
   231  	// from API requests. See
   232  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   233  	NullFields []string `json:"-"`
   234  }
   235  
   236  func (s *AchievementResetAllResponse) MarshalJSON() ([]byte, error) {
   237  	type NoMethod AchievementResetAllResponse
   238  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   239  }
   240  
   241  type AchievementResetMultipleForAllRequest struct {
   242  	// AchievementIds: The IDs of achievements to reset.
   243  	AchievementIds []string `json:"achievement_ids,omitempty"`
   244  	// Kind: Uniquely identifies the type of this resource. Value is always the
   245  	// fixed string `gamesManagement#achievementResetMultipleForAllRequest`.
   246  	Kind string `json:"kind,omitempty"`
   247  	// ForceSendFields is a list of field names (e.g. "AchievementIds") to
   248  	// unconditionally include in API requests. By default, fields with empty or
   249  	// default values are omitted from API requests. See
   250  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   251  	// details.
   252  	ForceSendFields []string `json:"-"`
   253  	// NullFields is a list of field names (e.g. "AchievementIds") to include in
   254  	// API requests with the JSON null value. By default, fields with empty values
   255  	// are omitted from API requests. See
   256  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   257  	NullFields []string `json:"-"`
   258  }
   259  
   260  func (s *AchievementResetMultipleForAllRequest) MarshalJSON() ([]byte, error) {
   261  	type NoMethod AchievementResetMultipleForAllRequest
   262  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   263  }
   264  
   265  // AchievementResetResponse: An achievement reset response.
   266  type AchievementResetResponse struct {
   267  	// CurrentState: The current state of the achievement. This is the same as the
   268  	// initial state of the achievement. Possible values are: - "HIDDEN"-
   269  	// Achievement is hidden. - "REVEALED" - Achievement is revealed. -
   270  	// "UNLOCKED" - Achievement is unlocked.
   271  	CurrentState string `json:"currentState,omitempty"`
   272  	// DefinitionId: The ID of an achievement for which player state has been
   273  	// updated.
   274  	DefinitionId string `json:"definitionId,omitempty"`
   275  	// Kind: Uniquely identifies the type of this resource. Value is always the
   276  	// fixed string `gamesManagement#achievementResetResponse`.
   277  	Kind string `json:"kind,omitempty"`
   278  	// UpdateOccurred: Flag to indicate if the requested update actually occurred.
   279  	UpdateOccurred bool `json:"updateOccurred,omitempty"`
   280  
   281  	// ServerResponse contains the HTTP response code and headers from the server.
   282  	googleapi.ServerResponse `json:"-"`
   283  	// ForceSendFields is a list of field names (e.g. "CurrentState") to
   284  	// unconditionally include in API requests. By default, fields with empty or
   285  	// default values are omitted from API requests. See
   286  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   287  	// details.
   288  	ForceSendFields []string `json:"-"`
   289  	// NullFields is a list of field names (e.g. "CurrentState") to include in API
   290  	// requests with the JSON null value. By default, fields with empty values are
   291  	// omitted from API requests. See
   292  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   293  	NullFields []string `json:"-"`
   294  }
   295  
   296  func (s *AchievementResetResponse) MarshalJSON() ([]byte, error) {
   297  	type NoMethod AchievementResetResponse
   298  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   299  }
   300  
   301  // EventsResetMultipleForAllRequest: Multiple events reset all request.
   302  type EventsResetMultipleForAllRequest struct {
   303  	// EventIds: The IDs of events to reset.
   304  	EventIds []string `json:"event_ids,omitempty"`
   305  	// Kind: Uniquely identifies the type of this resource. Value is always the
   306  	// fixed string `gamesManagement#eventsResetMultipleForAllRequest`.
   307  	Kind string `json:"kind,omitempty"`
   308  	// ForceSendFields is a list of field names (e.g. "EventIds") to
   309  	// unconditionally include in API requests. By default, fields with empty or
   310  	// default values are omitted from API requests. See
   311  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   312  	// details.
   313  	ForceSendFields []string `json:"-"`
   314  	// NullFields is a list of field names (e.g. "EventIds") to include in API
   315  	// requests with the JSON null value. By default, fields with empty values are
   316  	// omitted from API requests. See
   317  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   318  	NullFields []string `json:"-"`
   319  }
   320  
   321  func (s *EventsResetMultipleForAllRequest) MarshalJSON() ([]byte, error) {
   322  	type NoMethod EventsResetMultipleForAllRequest
   323  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   324  }
   325  
   326  // GamesPlayerExperienceInfoResource: 1P/3P metadata about the player's
   327  // experience.
   328  type GamesPlayerExperienceInfoResource struct {
   329  	// CurrentExperiencePoints: The current number of experience points for the
   330  	// player.
   331  	CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"`
   332  	// CurrentLevel: The current level of the player.
   333  	CurrentLevel *GamesPlayerLevelResource `json:"currentLevel,omitempty"`
   334  	// LastLevelUpTimestampMillis: The timestamp when the player was leveled up, in
   335  	// millis since Unix epoch UTC.
   336  	LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"`
   337  	// NextLevel: The next level of the player. If the current level is the maximum
   338  	// level, this should be same as the current level.
   339  	NextLevel *GamesPlayerLevelResource `json:"nextLevel,omitempty"`
   340  	// ForceSendFields is a list of field names (e.g. "CurrentExperiencePoints") to
   341  	// unconditionally include in API requests. By default, fields with empty or
   342  	// default values are omitted from API requests. See
   343  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   344  	// details.
   345  	ForceSendFields []string `json:"-"`
   346  	// NullFields is a list of field names (e.g. "CurrentExperiencePoints") to
   347  	// include in API requests with the JSON null value. By default, fields with
   348  	// empty values are omitted from API requests. See
   349  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   350  	NullFields []string `json:"-"`
   351  }
   352  
   353  func (s *GamesPlayerExperienceInfoResource) MarshalJSON() ([]byte, error) {
   354  	type NoMethod GamesPlayerExperienceInfoResource
   355  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   356  }
   357  
   358  // GamesPlayerLevelResource: 1P/3P metadata about a user's level.
   359  type GamesPlayerLevelResource struct {
   360  	// Level: The level for the user.
   361  	Level int64 `json:"level,omitempty"`
   362  	// MaxExperiencePoints: The maximum experience points for this level.
   363  	MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"`
   364  	// MinExperiencePoints: The minimum experience points for this level.
   365  	MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"`
   366  	// ForceSendFields is a list of field names (e.g. "Level") to unconditionally
   367  	// include in API requests. By default, fields with empty or default values are
   368  	// omitted from API requests. See
   369  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   370  	// details.
   371  	ForceSendFields []string `json:"-"`
   372  	// NullFields is a list of field names (e.g. "Level") to include in API
   373  	// requests with the JSON null value. By default, fields with empty values are
   374  	// omitted from API requests. See
   375  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   376  	NullFields []string `json:"-"`
   377  }
   378  
   379  func (s *GamesPlayerLevelResource) MarshalJSON() ([]byte, error) {
   380  	type NoMethod GamesPlayerLevelResource
   381  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   382  }
   383  
   384  // HiddenPlayer: The HiddenPlayer resource.
   385  type HiddenPlayer struct {
   386  	// HiddenTimeMillis: Output only. The time this player was hidden.
   387  	HiddenTimeMillis int64 `json:"hiddenTimeMillis,omitempty,string"`
   388  	// Kind: Output only. Uniquely identifies the type of this resource. Value is
   389  	// always the fixed string `gamesManagement#hiddenPlayer`.
   390  	Kind string `json:"kind,omitempty"`
   391  	// Player: Output only. The player information.
   392  	Player *Player `json:"player,omitempty"`
   393  	// ForceSendFields is a list of field names (e.g. "HiddenTimeMillis") to
   394  	// unconditionally include in API requests. By default, fields with empty or
   395  	// default values are omitted from API requests. See
   396  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   397  	// details.
   398  	ForceSendFields []string `json:"-"`
   399  	// NullFields is a list of field names (e.g. "HiddenTimeMillis") to include in
   400  	// API requests with the JSON null value. By default, fields with empty values
   401  	// are omitted from API requests. See
   402  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   403  	NullFields []string `json:"-"`
   404  }
   405  
   406  func (s *HiddenPlayer) MarshalJSON() ([]byte, error) {
   407  	type NoMethod HiddenPlayer
   408  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   409  }
   410  
   411  // HiddenPlayerList: A list of hidden players.
   412  type HiddenPlayerList struct {
   413  	// Items: The players.
   414  	Items []*HiddenPlayer `json:"items,omitempty"`
   415  	// Kind: Uniquely identifies the type of this resource. Value is always the
   416  	// fixed string `gamesManagement#hiddenPlayerList`.
   417  	Kind string `json:"kind,omitempty"`
   418  	// NextPageToken: The pagination token for the next page of results.
   419  	NextPageToken string `json:"nextPageToken,omitempty"`
   420  
   421  	// ServerResponse contains the HTTP response code and headers from the server.
   422  	googleapi.ServerResponse `json:"-"`
   423  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
   424  	// include in API requests. By default, fields with empty or default values are
   425  	// omitted from API requests. See
   426  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   427  	// details.
   428  	ForceSendFields []string `json:"-"`
   429  	// NullFields is a list of field names (e.g. "Items") to include in API
   430  	// requests with the JSON null value. By default, fields with empty values are
   431  	// omitted from API requests. See
   432  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   433  	NullFields []string `json:"-"`
   434  }
   435  
   436  func (s *HiddenPlayerList) MarshalJSON() ([]byte, error) {
   437  	type NoMethod HiddenPlayerList
   438  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   439  }
   440  
   441  // Player: A Player resource.
   442  type Player struct {
   443  	// AvatarImageUrl: The base URL for the image that represents the player.
   444  	AvatarImageUrl string `json:"avatarImageUrl,omitempty"`
   445  	// BannerUrlLandscape: The url to the landscape mode player banner image.
   446  	BannerUrlLandscape string `json:"bannerUrlLandscape,omitempty"`
   447  	// BannerUrlPortrait: The url to the portrait mode player banner image.
   448  	BannerUrlPortrait string `json:"bannerUrlPortrait,omitempty"`
   449  	// DisplayName: The name to display for the player.
   450  	DisplayName string `json:"displayName,omitempty"`
   451  	// ExperienceInfo: An object to represent Play Game experience information for
   452  	// the player.
   453  	ExperienceInfo *GamesPlayerExperienceInfoResource `json:"experienceInfo,omitempty"`
   454  	// Kind: Uniquely identifies the type of this resource. Value is always the
   455  	// fixed string `gamesManagement#player`.
   456  	Kind string `json:"kind,omitempty"`
   457  	// Name: An object representation of the individual components of the player's
   458  	// name. For some players, these fields may not be present.
   459  	Name *PlayerName `json:"name,omitempty"`
   460  	// OriginalPlayerId: The player ID that was used for this player the first time
   461  	// they signed into the game in question. This is only populated for calls to
   462  	// player.get for the requesting player, only if the player ID has subsequently
   463  	// changed, and only to clients that support remapping player IDs.
   464  	OriginalPlayerId string `json:"originalPlayerId,omitempty"`
   465  	// PlayerId: The ID of the player.
   466  	PlayerId string `json:"playerId,omitempty"`
   467  	// ProfileSettings: The player's profile settings. Controls whether or not the
   468  	// player's profile is visible to other players.
   469  	ProfileSettings *ProfileSettings `json:"profileSettings,omitempty"`
   470  	// Title: The player's title rewarded for their game activities.
   471  	Title string `json:"title,omitempty"`
   472  	// ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to
   473  	// unconditionally include in API requests. By default, fields with empty or
   474  	// default values are omitted from API requests. See
   475  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   476  	// details.
   477  	ForceSendFields []string `json:"-"`
   478  	// NullFields is a list of field names (e.g. "AvatarImageUrl") to include in
   479  	// API requests with the JSON null value. By default, fields with empty values
   480  	// are omitted from API requests. See
   481  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   482  	NullFields []string `json:"-"`
   483  }
   484  
   485  func (s *Player) MarshalJSON() ([]byte, error) {
   486  	type NoMethod Player
   487  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   488  }
   489  
   490  // PlayerName: An object representation of the individual components of the
   491  // player's name. For some players, these fields may not be present.
   492  type PlayerName struct {
   493  	// FamilyName: The family name of this player. In some places, this is known as
   494  	// the last name.
   495  	FamilyName string `json:"familyName,omitempty"`
   496  	// GivenName: The given name of this player. In some places, this is known as
   497  	// the first name.
   498  	GivenName string `json:"givenName,omitempty"`
   499  	// ForceSendFields is a list of field names (e.g. "FamilyName") to
   500  	// unconditionally include in API requests. By default, fields with empty or
   501  	// default values are omitted from API requests. See
   502  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   503  	// details.
   504  	ForceSendFields []string `json:"-"`
   505  	// NullFields is a list of field names (e.g. "FamilyName") to include in API
   506  	// requests with the JSON null value. By default, fields with empty values are
   507  	// omitted from API requests. See
   508  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   509  	NullFields []string `json:"-"`
   510  }
   511  
   512  func (s *PlayerName) MarshalJSON() ([]byte, error) {
   513  	type NoMethod PlayerName
   514  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   515  }
   516  
   517  // PlayerScoreResetAllResponse: A list of leaderboard reset resources.
   518  type PlayerScoreResetAllResponse struct {
   519  	// Kind: Uniquely identifies the type of this resource. Value is always the
   520  	// fixed string `gamesManagement#playerScoreResetAllResponse`.
   521  	Kind string `json:"kind,omitempty"`
   522  	// Results: The leaderboard reset results.
   523  	Results []*PlayerScoreResetResponse `json:"results,omitempty"`
   524  
   525  	// ServerResponse contains the HTTP response code and headers from the server.
   526  	googleapi.ServerResponse `json:"-"`
   527  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
   528  	// include in API requests. By default, fields with empty or default values are
   529  	// omitted from API requests. See
   530  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   531  	// details.
   532  	ForceSendFields []string `json:"-"`
   533  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
   534  	// with the JSON null value. By default, fields with empty values are omitted
   535  	// from API requests. See
   536  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   537  	NullFields []string `json:"-"`
   538  }
   539  
   540  func (s *PlayerScoreResetAllResponse) MarshalJSON() ([]byte, error) {
   541  	type NoMethod PlayerScoreResetAllResponse
   542  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   543  }
   544  
   545  // PlayerScoreResetResponse: A list of reset leaderboard entry resources.
   546  type PlayerScoreResetResponse struct {
   547  	// DefinitionId: The ID of an leaderboard for which player state has been
   548  	// updated.
   549  	DefinitionId string `json:"definitionId,omitempty"`
   550  	// Kind: Uniquely identifies the type of this resource. Value is always the
   551  	// fixed string `gamesManagement#playerScoreResetResponse`.
   552  	Kind string `json:"kind,omitempty"`
   553  	// ResetScoreTimeSpans: The time spans of the updated score. Possible values
   554  	// are: - "ALL_TIME" - The score is an all-time score. - "WEEKLY" - The
   555  	// score is a weekly score. - "DAILY" - The score is a daily score.
   556  	ResetScoreTimeSpans []string `json:"resetScoreTimeSpans,omitempty"`
   557  
   558  	// ServerResponse contains the HTTP response code and headers from the server.
   559  	googleapi.ServerResponse `json:"-"`
   560  	// ForceSendFields is a list of field names (e.g. "DefinitionId") to
   561  	// unconditionally include in API requests. By default, fields with empty or
   562  	// default values are omitted from API requests. See
   563  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   564  	// details.
   565  	ForceSendFields []string `json:"-"`
   566  	// NullFields is a list of field names (e.g. "DefinitionId") to include in API
   567  	// requests with the JSON null value. By default, fields with empty values are
   568  	// omitted from API requests. See
   569  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   570  	NullFields []string `json:"-"`
   571  }
   572  
   573  func (s *PlayerScoreResetResponse) MarshalJSON() ([]byte, error) {
   574  	type NoMethod PlayerScoreResetResponse
   575  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   576  }
   577  
   578  // ProfileSettings: Profile settings
   579  type ProfileSettings struct {
   580  	// Kind: Uniquely identifies the type of this resource. Value is always the
   581  	// fixed string `gamesManagement#profileSettings`.
   582  	Kind           string `json:"kind,omitempty"`
   583  	ProfileVisible bool   `json:"profileVisible,omitempty"`
   584  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
   585  	// include in API requests. By default, fields with empty or default values are
   586  	// omitted from API requests. See
   587  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   588  	// details.
   589  	ForceSendFields []string `json:"-"`
   590  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
   591  	// with the JSON null value. By default, fields with empty values are omitted
   592  	// from API requests. See
   593  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   594  	NullFields []string `json:"-"`
   595  }
   596  
   597  func (s *ProfileSettings) MarshalJSON() ([]byte, error) {
   598  	type NoMethod ProfileSettings
   599  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   600  }
   601  
   602  type ScoresResetMultipleForAllRequest struct {
   603  	// Kind: Uniquely identifies the type of this resource. Value is always the
   604  	// fixed string `gamesManagement#scoresResetMultipleForAllRequest`.
   605  	Kind string `json:"kind,omitempty"`
   606  	// LeaderboardIds: The IDs of leaderboards to reset.
   607  	LeaderboardIds []string `json:"leaderboard_ids,omitempty"`
   608  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
   609  	// include in API requests. By default, fields with empty or default values are
   610  	// omitted from API requests. See
   611  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   612  	// details.
   613  	ForceSendFields []string `json:"-"`
   614  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
   615  	// with the JSON null value. By default, fields with empty values are omitted
   616  	// from API requests. See
   617  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   618  	NullFields []string `json:"-"`
   619  }
   620  
   621  func (s *ScoresResetMultipleForAllRequest) MarshalJSON() ([]byte, error) {
   622  	type NoMethod ScoresResetMultipleForAllRequest
   623  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   624  }
   625  
   626  type AchievementsResetCall struct {
   627  	s             *Service
   628  	achievementId string
   629  	urlParams_    gensupport.URLParams
   630  	ctx_          context.Context
   631  	header_       http.Header
   632  }
   633  
   634  // Reset: Resets the achievement with the given ID for the currently
   635  // authenticated player. This method is only accessible to whitelisted tester
   636  // accounts for your application.
   637  //
   638  // - achievementId: The ID of the achievement used by this method.
   639  func (r *AchievementsService) Reset(achievementId string) *AchievementsResetCall {
   640  	c := &AchievementsResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   641  	c.achievementId = achievementId
   642  	return c
   643  }
   644  
   645  // Fields allows partial responses to be retrieved. See
   646  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   647  // details.
   648  func (c *AchievementsResetCall) Fields(s ...googleapi.Field) *AchievementsResetCall {
   649  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   650  	return c
   651  }
   652  
   653  // Context sets the context to be used in this call's Do method.
   654  func (c *AchievementsResetCall) Context(ctx context.Context) *AchievementsResetCall {
   655  	c.ctx_ = ctx
   656  	return c
   657  }
   658  
   659  // Header returns a http.Header that can be modified by the caller to add
   660  // headers to the request.
   661  func (c *AchievementsResetCall) Header() http.Header {
   662  	if c.header_ == nil {
   663  		c.header_ = make(http.Header)
   664  	}
   665  	return c.header_
   666  }
   667  
   668  func (c *AchievementsResetCall) doRequest(alt string) (*http.Response, error) {
   669  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   670  	var body io.Reader = nil
   671  	c.urlParams_.Set("alt", alt)
   672  	c.urlParams_.Set("prettyPrint", "false")
   673  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/{achievementId}/reset")
   674  	urls += "?" + c.urlParams_.Encode()
   675  	req, err := http.NewRequest("POST", urls, body)
   676  	if err != nil {
   677  		return nil, err
   678  	}
   679  	req.Header = reqHeaders
   680  	googleapi.Expand(req.URL, map[string]string{
   681  		"achievementId": c.achievementId,
   682  	})
   683  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   684  }
   685  
   686  // Do executes the "gamesManagement.achievements.reset" call.
   687  // Any non-2xx status code is an error. Response headers are in either
   688  // *AchievementResetResponse.ServerResponse.Header or (if a response was
   689  // returned at all) in error.(*googleapi.Error).Header. Use
   690  // googleapi.IsNotModified to check whether the returned error was because
   691  // http.StatusNotModified was returned.
   692  func (c *AchievementsResetCall) Do(opts ...googleapi.CallOption) (*AchievementResetResponse, error) {
   693  	gensupport.SetOptions(c.urlParams_, opts...)
   694  	res, err := c.doRequest("json")
   695  	if res != nil && res.StatusCode == http.StatusNotModified {
   696  		if res.Body != nil {
   697  			res.Body.Close()
   698  		}
   699  		return nil, gensupport.WrapError(&googleapi.Error{
   700  			Code:   res.StatusCode,
   701  			Header: res.Header,
   702  		})
   703  	}
   704  	if err != nil {
   705  		return nil, err
   706  	}
   707  	defer googleapi.CloseBody(res)
   708  	if err := googleapi.CheckResponse(res); err != nil {
   709  		return nil, gensupport.WrapError(err)
   710  	}
   711  	ret := &AchievementResetResponse{
   712  		ServerResponse: googleapi.ServerResponse{
   713  			Header:         res.Header,
   714  			HTTPStatusCode: res.StatusCode,
   715  		},
   716  	}
   717  	target := &ret
   718  	if err := gensupport.DecodeResponse(target, res); err != nil {
   719  		return nil, err
   720  	}
   721  	return ret, nil
   722  }
   723  
   724  type AchievementsResetAllCall struct {
   725  	s          *Service
   726  	urlParams_ gensupport.URLParams
   727  	ctx_       context.Context
   728  	header_    http.Header
   729  }
   730  
   731  // ResetAll: Resets all achievements for the currently authenticated player for
   732  // your application. This method is only accessible to whitelisted tester
   733  // accounts for your application.
   734  func (r *AchievementsService) ResetAll() *AchievementsResetAllCall {
   735  	c := &AchievementsResetAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   736  	return c
   737  }
   738  
   739  // Fields allows partial responses to be retrieved. See
   740  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   741  // details.
   742  func (c *AchievementsResetAllCall) Fields(s ...googleapi.Field) *AchievementsResetAllCall {
   743  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   744  	return c
   745  }
   746  
   747  // Context sets the context to be used in this call's Do method.
   748  func (c *AchievementsResetAllCall) Context(ctx context.Context) *AchievementsResetAllCall {
   749  	c.ctx_ = ctx
   750  	return c
   751  }
   752  
   753  // Header returns a http.Header that can be modified by the caller to add
   754  // headers to the request.
   755  func (c *AchievementsResetAllCall) Header() http.Header {
   756  	if c.header_ == nil {
   757  		c.header_ = make(http.Header)
   758  	}
   759  	return c.header_
   760  }
   761  
   762  func (c *AchievementsResetAllCall) doRequest(alt string) (*http.Response, error) {
   763  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   764  	var body io.Reader = nil
   765  	c.urlParams_.Set("alt", alt)
   766  	c.urlParams_.Set("prettyPrint", "false")
   767  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/reset")
   768  	urls += "?" + c.urlParams_.Encode()
   769  	req, err := http.NewRequest("POST", urls, body)
   770  	if err != nil {
   771  		return nil, err
   772  	}
   773  	req.Header = reqHeaders
   774  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   775  }
   776  
   777  // Do executes the "gamesManagement.achievements.resetAll" call.
   778  // Any non-2xx status code is an error. Response headers are in either
   779  // *AchievementResetAllResponse.ServerResponse.Header or (if a response was
   780  // returned at all) in error.(*googleapi.Error).Header. Use
   781  // googleapi.IsNotModified to check whether the returned error was because
   782  // http.StatusNotModified was returned.
   783  func (c *AchievementsResetAllCall) Do(opts ...googleapi.CallOption) (*AchievementResetAllResponse, error) {
   784  	gensupport.SetOptions(c.urlParams_, opts...)
   785  	res, err := c.doRequest("json")
   786  	if res != nil && res.StatusCode == http.StatusNotModified {
   787  		if res.Body != nil {
   788  			res.Body.Close()
   789  		}
   790  		return nil, gensupport.WrapError(&googleapi.Error{
   791  			Code:   res.StatusCode,
   792  			Header: res.Header,
   793  		})
   794  	}
   795  	if err != nil {
   796  		return nil, err
   797  	}
   798  	defer googleapi.CloseBody(res)
   799  	if err := googleapi.CheckResponse(res); err != nil {
   800  		return nil, gensupport.WrapError(err)
   801  	}
   802  	ret := &AchievementResetAllResponse{
   803  		ServerResponse: googleapi.ServerResponse{
   804  			Header:         res.Header,
   805  			HTTPStatusCode: res.StatusCode,
   806  		},
   807  	}
   808  	target := &ret
   809  	if err := gensupport.DecodeResponse(target, res); err != nil {
   810  		return nil, err
   811  	}
   812  	return ret, nil
   813  }
   814  
   815  type AchievementsResetAllForAllPlayersCall struct {
   816  	s          *Service
   817  	urlParams_ gensupport.URLParams
   818  	ctx_       context.Context
   819  	header_    http.Header
   820  }
   821  
   822  // ResetAllForAllPlayers: Resets all draft achievements for all players. This
   823  // method is only available to user accounts for your developer console.
   824  func (r *AchievementsService) ResetAllForAllPlayers() *AchievementsResetAllForAllPlayersCall {
   825  	c := &AchievementsResetAllForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   826  	return c
   827  }
   828  
   829  // Fields allows partial responses to be retrieved. See
   830  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   831  // details.
   832  func (c *AchievementsResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetAllForAllPlayersCall {
   833  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   834  	return c
   835  }
   836  
   837  // Context sets the context to be used in this call's Do method.
   838  func (c *AchievementsResetAllForAllPlayersCall) Context(ctx context.Context) *AchievementsResetAllForAllPlayersCall {
   839  	c.ctx_ = ctx
   840  	return c
   841  }
   842  
   843  // Header returns a http.Header that can be modified by the caller to add
   844  // headers to the request.
   845  func (c *AchievementsResetAllForAllPlayersCall) Header() http.Header {
   846  	if c.header_ == nil {
   847  		c.header_ = make(http.Header)
   848  	}
   849  	return c.header_
   850  }
   851  
   852  func (c *AchievementsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
   853  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   854  	var body io.Reader = nil
   855  	c.urlParams_.Set("alt", alt)
   856  	c.urlParams_.Set("prettyPrint", "false")
   857  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/resetAllForAllPlayers")
   858  	urls += "?" + c.urlParams_.Encode()
   859  	req, err := http.NewRequest("POST", urls, body)
   860  	if err != nil {
   861  		return nil, err
   862  	}
   863  	req.Header = reqHeaders
   864  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   865  }
   866  
   867  // Do executes the "gamesManagement.achievements.resetAllForAllPlayers" call.
   868  func (c *AchievementsResetAllForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
   869  	gensupport.SetOptions(c.urlParams_, opts...)
   870  	res, err := c.doRequest("json")
   871  	if err != nil {
   872  		return err
   873  	}
   874  	defer googleapi.CloseBody(res)
   875  	if err := googleapi.CheckResponse(res); err != nil {
   876  		return gensupport.WrapError(err)
   877  	}
   878  	return nil
   879  }
   880  
   881  type AchievementsResetForAllPlayersCall struct {
   882  	s             *Service
   883  	achievementId string
   884  	urlParams_    gensupport.URLParams
   885  	ctx_          context.Context
   886  	header_       http.Header
   887  }
   888  
   889  // ResetForAllPlayers: Resets the achievement with the given ID for all
   890  // players. This method is only available to user accounts for your developer
   891  // console. Only draft achievements can be reset.
   892  //
   893  // - achievementId: The ID of the achievement used by this method.
   894  func (r *AchievementsService) ResetForAllPlayers(achievementId string) *AchievementsResetForAllPlayersCall {
   895  	c := &AchievementsResetForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   896  	c.achievementId = achievementId
   897  	return c
   898  }
   899  
   900  // Fields allows partial responses to be retrieved. See
   901  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   902  // details.
   903  func (c *AchievementsResetForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetForAllPlayersCall {
   904  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   905  	return c
   906  }
   907  
   908  // Context sets the context to be used in this call's Do method.
   909  func (c *AchievementsResetForAllPlayersCall) Context(ctx context.Context) *AchievementsResetForAllPlayersCall {
   910  	c.ctx_ = ctx
   911  	return c
   912  }
   913  
   914  // Header returns a http.Header that can be modified by the caller to add
   915  // headers to the request.
   916  func (c *AchievementsResetForAllPlayersCall) Header() http.Header {
   917  	if c.header_ == nil {
   918  		c.header_ = make(http.Header)
   919  	}
   920  	return c.header_
   921  }
   922  
   923  func (c *AchievementsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
   924  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   925  	var body io.Reader = nil
   926  	c.urlParams_.Set("alt", alt)
   927  	c.urlParams_.Set("prettyPrint", "false")
   928  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/{achievementId}/resetForAllPlayers")
   929  	urls += "?" + c.urlParams_.Encode()
   930  	req, err := http.NewRequest("POST", urls, body)
   931  	if err != nil {
   932  		return nil, err
   933  	}
   934  	req.Header = reqHeaders
   935  	googleapi.Expand(req.URL, map[string]string{
   936  		"achievementId": c.achievementId,
   937  	})
   938  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   939  }
   940  
   941  // Do executes the "gamesManagement.achievements.resetForAllPlayers" call.
   942  func (c *AchievementsResetForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
   943  	gensupport.SetOptions(c.urlParams_, opts...)
   944  	res, err := c.doRequest("json")
   945  	if err != nil {
   946  		return err
   947  	}
   948  	defer googleapi.CloseBody(res)
   949  	if err := googleapi.CheckResponse(res); err != nil {
   950  		return gensupport.WrapError(err)
   951  	}
   952  	return nil
   953  }
   954  
   955  type AchievementsResetMultipleForAllPlayersCall struct {
   956  	s                                     *Service
   957  	achievementresetmultipleforallrequest *AchievementResetMultipleForAllRequest
   958  	urlParams_                            gensupport.URLParams
   959  	ctx_                                  context.Context
   960  	header_                               http.Header
   961  }
   962  
   963  // ResetMultipleForAllPlayers: Resets achievements with the given IDs for all
   964  // players. This method is only available to user accounts for your developer
   965  // console. Only draft achievements may be reset.
   966  func (r *AchievementsService) ResetMultipleForAllPlayers(achievementresetmultipleforallrequest *AchievementResetMultipleForAllRequest) *AchievementsResetMultipleForAllPlayersCall {
   967  	c := &AchievementsResetMultipleForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   968  	c.achievementresetmultipleforallrequest = achievementresetmultipleforallrequest
   969  	return c
   970  }
   971  
   972  // Fields allows partial responses to be retrieved. See
   973  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   974  // details.
   975  func (c *AchievementsResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *AchievementsResetMultipleForAllPlayersCall {
   976  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   977  	return c
   978  }
   979  
   980  // Context sets the context to be used in this call's Do method.
   981  func (c *AchievementsResetMultipleForAllPlayersCall) Context(ctx context.Context) *AchievementsResetMultipleForAllPlayersCall {
   982  	c.ctx_ = ctx
   983  	return c
   984  }
   985  
   986  // Header returns a http.Header that can be modified by the caller to add
   987  // headers to the request.
   988  func (c *AchievementsResetMultipleForAllPlayersCall) Header() http.Header {
   989  	if c.header_ == nil {
   990  		c.header_ = make(http.Header)
   991  	}
   992  	return c.header_
   993  }
   994  
   995  func (c *AchievementsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
   996  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   997  	var body io.Reader = nil
   998  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementresetmultipleforallrequest)
   999  	if err != nil {
  1000  		return nil, err
  1001  	}
  1002  	c.urlParams_.Set("alt", alt)
  1003  	c.urlParams_.Set("prettyPrint", "false")
  1004  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/achievements/resetMultipleForAllPlayers")
  1005  	urls += "?" + c.urlParams_.Encode()
  1006  	req, err := http.NewRequest("POST", urls, body)
  1007  	if err != nil {
  1008  		return nil, err
  1009  	}
  1010  	req.Header = reqHeaders
  1011  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1012  }
  1013  
  1014  // Do executes the "gamesManagement.achievements.resetMultipleForAllPlayers" call.
  1015  func (c *AchievementsResetMultipleForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
  1016  	gensupport.SetOptions(c.urlParams_, opts...)
  1017  	res, err := c.doRequest("json")
  1018  	if err != nil {
  1019  		return err
  1020  	}
  1021  	defer googleapi.CloseBody(res)
  1022  	if err := googleapi.CheckResponse(res); err != nil {
  1023  		return gensupport.WrapError(err)
  1024  	}
  1025  	return nil
  1026  }
  1027  
  1028  type ApplicationsListHiddenCall struct {
  1029  	s             *Service
  1030  	applicationId string
  1031  	urlParams_    gensupport.URLParams
  1032  	ifNoneMatch_  string
  1033  	ctx_          context.Context
  1034  	header_       http.Header
  1035  }
  1036  
  1037  // ListHidden: Get the list of players hidden from the given application. This
  1038  // method is only available to user accounts for your developer console.
  1039  //
  1040  // - applicationId: The application ID from the Google Play developer console.
  1041  func (r *ApplicationsService) ListHidden(applicationId string) *ApplicationsListHiddenCall {
  1042  	c := &ApplicationsListHiddenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1043  	c.applicationId = applicationId
  1044  	return c
  1045  }
  1046  
  1047  // MaxResults sets the optional parameter "maxResults": The maximum number of
  1048  // player resources to return in the response, used for paging. For any
  1049  // response, the actual number of player resources returned may be less than
  1050  // the specified `maxResults`.
  1051  func (c *ApplicationsListHiddenCall) MaxResults(maxResults int64) *ApplicationsListHiddenCall {
  1052  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1053  	return c
  1054  }
  1055  
  1056  // PageToken sets the optional parameter "pageToken": The token returned by the
  1057  // previous request.
  1058  func (c *ApplicationsListHiddenCall) PageToken(pageToken string) *ApplicationsListHiddenCall {
  1059  	c.urlParams_.Set("pageToken", pageToken)
  1060  	return c
  1061  }
  1062  
  1063  // Fields allows partial responses to be retrieved. See
  1064  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1065  // details.
  1066  func (c *ApplicationsListHiddenCall) Fields(s ...googleapi.Field) *ApplicationsListHiddenCall {
  1067  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1068  	return c
  1069  }
  1070  
  1071  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1072  // object's ETag matches the given value. This is useful for getting updates
  1073  // only after the object has changed since the last request.
  1074  func (c *ApplicationsListHiddenCall) IfNoneMatch(entityTag string) *ApplicationsListHiddenCall {
  1075  	c.ifNoneMatch_ = entityTag
  1076  	return c
  1077  }
  1078  
  1079  // Context sets the context to be used in this call's Do method.
  1080  func (c *ApplicationsListHiddenCall) Context(ctx context.Context) *ApplicationsListHiddenCall {
  1081  	c.ctx_ = ctx
  1082  	return c
  1083  }
  1084  
  1085  // Header returns a http.Header that can be modified by the caller to add
  1086  // headers to the request.
  1087  func (c *ApplicationsListHiddenCall) Header() http.Header {
  1088  	if c.header_ == nil {
  1089  		c.header_ = make(http.Header)
  1090  	}
  1091  	return c.header_
  1092  }
  1093  
  1094  func (c *ApplicationsListHiddenCall) doRequest(alt string) (*http.Response, error) {
  1095  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1096  	if c.ifNoneMatch_ != "" {
  1097  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1098  	}
  1099  	var body io.Reader = nil
  1100  	c.urlParams_.Set("alt", alt)
  1101  	c.urlParams_.Set("prettyPrint", "false")
  1102  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden")
  1103  	urls += "?" + c.urlParams_.Encode()
  1104  	req, err := http.NewRequest("GET", urls, body)
  1105  	if err != nil {
  1106  		return nil, err
  1107  	}
  1108  	req.Header = reqHeaders
  1109  	googleapi.Expand(req.URL, map[string]string{
  1110  		"applicationId": c.applicationId,
  1111  	})
  1112  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1113  }
  1114  
  1115  // Do executes the "gamesManagement.applications.listHidden" call.
  1116  // Any non-2xx status code is an error. Response headers are in either
  1117  // *HiddenPlayerList.ServerResponse.Header or (if a response was returned at
  1118  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1119  // check whether the returned error was because http.StatusNotModified was
  1120  // returned.
  1121  func (c *ApplicationsListHiddenCall) Do(opts ...googleapi.CallOption) (*HiddenPlayerList, error) {
  1122  	gensupport.SetOptions(c.urlParams_, opts...)
  1123  	res, err := c.doRequest("json")
  1124  	if res != nil && res.StatusCode == http.StatusNotModified {
  1125  		if res.Body != nil {
  1126  			res.Body.Close()
  1127  		}
  1128  		return nil, gensupport.WrapError(&googleapi.Error{
  1129  			Code:   res.StatusCode,
  1130  			Header: res.Header,
  1131  		})
  1132  	}
  1133  	if err != nil {
  1134  		return nil, err
  1135  	}
  1136  	defer googleapi.CloseBody(res)
  1137  	if err := googleapi.CheckResponse(res); err != nil {
  1138  		return nil, gensupport.WrapError(err)
  1139  	}
  1140  	ret := &HiddenPlayerList{
  1141  		ServerResponse: googleapi.ServerResponse{
  1142  			Header:         res.Header,
  1143  			HTTPStatusCode: res.StatusCode,
  1144  		},
  1145  	}
  1146  	target := &ret
  1147  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1148  		return nil, err
  1149  	}
  1150  	return ret, nil
  1151  }
  1152  
  1153  // Pages invokes f for each page of results.
  1154  // A non-nil error returned from f will halt the iteration.
  1155  // The provided context supersedes any context provided to the Context method.
  1156  func (c *ApplicationsListHiddenCall) Pages(ctx context.Context, f func(*HiddenPlayerList) error) error {
  1157  	c.ctx_ = ctx
  1158  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1159  	for {
  1160  		x, err := c.Do()
  1161  		if err != nil {
  1162  			return err
  1163  		}
  1164  		if err := f(x); err != nil {
  1165  			return err
  1166  		}
  1167  		if x.NextPageToken == "" {
  1168  			return nil
  1169  		}
  1170  		c.PageToken(x.NextPageToken)
  1171  	}
  1172  }
  1173  
  1174  type EventsResetCall struct {
  1175  	s          *Service
  1176  	eventId    string
  1177  	urlParams_ gensupport.URLParams
  1178  	ctx_       context.Context
  1179  	header_    http.Header
  1180  }
  1181  
  1182  // Reset: Resets all player progress on the event with the given ID for the
  1183  // currently authenticated player. This method is only accessible to
  1184  // whitelisted tester accounts for your application.
  1185  //
  1186  // - eventId: The ID of the event.
  1187  func (r *EventsService) Reset(eventId string) *EventsResetCall {
  1188  	c := &EventsResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1189  	c.eventId = eventId
  1190  	return c
  1191  }
  1192  
  1193  // Fields allows partial responses to be retrieved. See
  1194  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1195  // details.
  1196  func (c *EventsResetCall) Fields(s ...googleapi.Field) *EventsResetCall {
  1197  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1198  	return c
  1199  }
  1200  
  1201  // Context sets the context to be used in this call's Do method.
  1202  func (c *EventsResetCall) Context(ctx context.Context) *EventsResetCall {
  1203  	c.ctx_ = ctx
  1204  	return c
  1205  }
  1206  
  1207  // Header returns a http.Header that can be modified by the caller to add
  1208  // headers to the request.
  1209  func (c *EventsResetCall) Header() http.Header {
  1210  	if c.header_ == nil {
  1211  		c.header_ = make(http.Header)
  1212  	}
  1213  	return c.header_
  1214  }
  1215  
  1216  func (c *EventsResetCall) doRequest(alt string) (*http.Response, error) {
  1217  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1218  	var body io.Reader = nil
  1219  	c.urlParams_.Set("alt", alt)
  1220  	c.urlParams_.Set("prettyPrint", "false")
  1221  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/{eventId}/reset")
  1222  	urls += "?" + c.urlParams_.Encode()
  1223  	req, err := http.NewRequest("POST", urls, body)
  1224  	if err != nil {
  1225  		return nil, err
  1226  	}
  1227  	req.Header = reqHeaders
  1228  	googleapi.Expand(req.URL, map[string]string{
  1229  		"eventId": c.eventId,
  1230  	})
  1231  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1232  }
  1233  
  1234  // Do executes the "gamesManagement.events.reset" call.
  1235  func (c *EventsResetCall) Do(opts ...googleapi.CallOption) error {
  1236  	gensupport.SetOptions(c.urlParams_, opts...)
  1237  	res, err := c.doRequest("json")
  1238  	if err != nil {
  1239  		return err
  1240  	}
  1241  	defer googleapi.CloseBody(res)
  1242  	if err := googleapi.CheckResponse(res); err != nil {
  1243  		return gensupport.WrapError(err)
  1244  	}
  1245  	return nil
  1246  }
  1247  
  1248  type EventsResetAllCall struct {
  1249  	s          *Service
  1250  	urlParams_ gensupport.URLParams
  1251  	ctx_       context.Context
  1252  	header_    http.Header
  1253  }
  1254  
  1255  // ResetAll: Resets all player progress on all events for the currently
  1256  // authenticated player. This method is only accessible to whitelisted tester
  1257  // accounts for your application.
  1258  func (r *EventsService) ResetAll() *EventsResetAllCall {
  1259  	c := &EventsResetAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1260  	return c
  1261  }
  1262  
  1263  // Fields allows partial responses to be retrieved. See
  1264  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1265  // details.
  1266  func (c *EventsResetAllCall) Fields(s ...googleapi.Field) *EventsResetAllCall {
  1267  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1268  	return c
  1269  }
  1270  
  1271  // Context sets the context to be used in this call's Do method.
  1272  func (c *EventsResetAllCall) Context(ctx context.Context) *EventsResetAllCall {
  1273  	c.ctx_ = ctx
  1274  	return c
  1275  }
  1276  
  1277  // Header returns a http.Header that can be modified by the caller to add
  1278  // headers to the request.
  1279  func (c *EventsResetAllCall) Header() http.Header {
  1280  	if c.header_ == nil {
  1281  		c.header_ = make(http.Header)
  1282  	}
  1283  	return c.header_
  1284  }
  1285  
  1286  func (c *EventsResetAllCall) doRequest(alt string) (*http.Response, error) {
  1287  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1288  	var body io.Reader = nil
  1289  	c.urlParams_.Set("alt", alt)
  1290  	c.urlParams_.Set("prettyPrint", "false")
  1291  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/reset")
  1292  	urls += "?" + c.urlParams_.Encode()
  1293  	req, err := http.NewRequest("POST", urls, body)
  1294  	if err != nil {
  1295  		return nil, err
  1296  	}
  1297  	req.Header = reqHeaders
  1298  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1299  }
  1300  
  1301  // Do executes the "gamesManagement.events.resetAll" call.
  1302  func (c *EventsResetAllCall) Do(opts ...googleapi.CallOption) error {
  1303  	gensupport.SetOptions(c.urlParams_, opts...)
  1304  	res, err := c.doRequest("json")
  1305  	if err != nil {
  1306  		return err
  1307  	}
  1308  	defer googleapi.CloseBody(res)
  1309  	if err := googleapi.CheckResponse(res); err != nil {
  1310  		return gensupport.WrapError(err)
  1311  	}
  1312  	return nil
  1313  }
  1314  
  1315  type EventsResetAllForAllPlayersCall struct {
  1316  	s          *Service
  1317  	urlParams_ gensupport.URLParams
  1318  	ctx_       context.Context
  1319  	header_    http.Header
  1320  }
  1321  
  1322  // ResetAllForAllPlayers: Resets all draft events for all players. This method
  1323  // is only available to user accounts for your developer console.
  1324  func (r *EventsService) ResetAllForAllPlayers() *EventsResetAllForAllPlayersCall {
  1325  	c := &EventsResetAllForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1326  	return c
  1327  }
  1328  
  1329  // Fields allows partial responses to be retrieved. See
  1330  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1331  // details.
  1332  func (c *EventsResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetAllForAllPlayersCall {
  1333  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1334  	return c
  1335  }
  1336  
  1337  // Context sets the context to be used in this call's Do method.
  1338  func (c *EventsResetAllForAllPlayersCall) Context(ctx context.Context) *EventsResetAllForAllPlayersCall {
  1339  	c.ctx_ = ctx
  1340  	return c
  1341  }
  1342  
  1343  // Header returns a http.Header that can be modified by the caller to add
  1344  // headers to the request.
  1345  func (c *EventsResetAllForAllPlayersCall) Header() http.Header {
  1346  	if c.header_ == nil {
  1347  		c.header_ = make(http.Header)
  1348  	}
  1349  	return c.header_
  1350  }
  1351  
  1352  func (c *EventsResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
  1353  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1354  	var body io.Reader = nil
  1355  	c.urlParams_.Set("alt", alt)
  1356  	c.urlParams_.Set("prettyPrint", "false")
  1357  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/resetAllForAllPlayers")
  1358  	urls += "?" + c.urlParams_.Encode()
  1359  	req, err := http.NewRequest("POST", urls, body)
  1360  	if err != nil {
  1361  		return nil, err
  1362  	}
  1363  	req.Header = reqHeaders
  1364  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1365  }
  1366  
  1367  // Do executes the "gamesManagement.events.resetAllForAllPlayers" call.
  1368  func (c *EventsResetAllForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
  1369  	gensupport.SetOptions(c.urlParams_, opts...)
  1370  	res, err := c.doRequest("json")
  1371  	if err != nil {
  1372  		return err
  1373  	}
  1374  	defer googleapi.CloseBody(res)
  1375  	if err := googleapi.CheckResponse(res); err != nil {
  1376  		return gensupport.WrapError(err)
  1377  	}
  1378  	return nil
  1379  }
  1380  
  1381  type EventsResetForAllPlayersCall struct {
  1382  	s          *Service
  1383  	eventId    string
  1384  	urlParams_ gensupport.URLParams
  1385  	ctx_       context.Context
  1386  	header_    http.Header
  1387  }
  1388  
  1389  // ResetForAllPlayers: Resets the event with the given ID for all players. This
  1390  // method is only available to user accounts for your developer console. Only
  1391  // draft events can be reset.
  1392  //
  1393  // - eventId: The ID of the event.
  1394  func (r *EventsService) ResetForAllPlayers(eventId string) *EventsResetForAllPlayersCall {
  1395  	c := &EventsResetForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1396  	c.eventId = eventId
  1397  	return c
  1398  }
  1399  
  1400  // Fields allows partial responses to be retrieved. See
  1401  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1402  // details.
  1403  func (c *EventsResetForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetForAllPlayersCall {
  1404  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1405  	return c
  1406  }
  1407  
  1408  // Context sets the context to be used in this call's Do method.
  1409  func (c *EventsResetForAllPlayersCall) Context(ctx context.Context) *EventsResetForAllPlayersCall {
  1410  	c.ctx_ = ctx
  1411  	return c
  1412  }
  1413  
  1414  // Header returns a http.Header that can be modified by the caller to add
  1415  // headers to the request.
  1416  func (c *EventsResetForAllPlayersCall) Header() http.Header {
  1417  	if c.header_ == nil {
  1418  		c.header_ = make(http.Header)
  1419  	}
  1420  	return c.header_
  1421  }
  1422  
  1423  func (c *EventsResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
  1424  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1425  	var body io.Reader = nil
  1426  	c.urlParams_.Set("alt", alt)
  1427  	c.urlParams_.Set("prettyPrint", "false")
  1428  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/{eventId}/resetForAllPlayers")
  1429  	urls += "?" + c.urlParams_.Encode()
  1430  	req, err := http.NewRequest("POST", urls, body)
  1431  	if err != nil {
  1432  		return nil, err
  1433  	}
  1434  	req.Header = reqHeaders
  1435  	googleapi.Expand(req.URL, map[string]string{
  1436  		"eventId": c.eventId,
  1437  	})
  1438  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1439  }
  1440  
  1441  // Do executes the "gamesManagement.events.resetForAllPlayers" call.
  1442  func (c *EventsResetForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
  1443  	gensupport.SetOptions(c.urlParams_, opts...)
  1444  	res, err := c.doRequest("json")
  1445  	if err != nil {
  1446  		return err
  1447  	}
  1448  	defer googleapi.CloseBody(res)
  1449  	if err := googleapi.CheckResponse(res); err != nil {
  1450  		return gensupport.WrapError(err)
  1451  	}
  1452  	return nil
  1453  }
  1454  
  1455  type EventsResetMultipleForAllPlayersCall struct {
  1456  	s                                *Service
  1457  	eventsresetmultipleforallrequest *EventsResetMultipleForAllRequest
  1458  	urlParams_                       gensupport.URLParams
  1459  	ctx_                             context.Context
  1460  	header_                          http.Header
  1461  }
  1462  
  1463  // ResetMultipleForAllPlayers: Resets events with the given IDs for all
  1464  // players. This method is only available to user accounts for your developer
  1465  // console. Only draft events may be reset.
  1466  func (r *EventsService) ResetMultipleForAllPlayers(eventsresetmultipleforallrequest *EventsResetMultipleForAllRequest) *EventsResetMultipleForAllPlayersCall {
  1467  	c := &EventsResetMultipleForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1468  	c.eventsresetmultipleforallrequest = eventsresetmultipleforallrequest
  1469  	return c
  1470  }
  1471  
  1472  // Fields allows partial responses to be retrieved. See
  1473  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1474  // details.
  1475  func (c *EventsResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *EventsResetMultipleForAllPlayersCall {
  1476  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1477  	return c
  1478  }
  1479  
  1480  // Context sets the context to be used in this call's Do method.
  1481  func (c *EventsResetMultipleForAllPlayersCall) Context(ctx context.Context) *EventsResetMultipleForAllPlayersCall {
  1482  	c.ctx_ = ctx
  1483  	return c
  1484  }
  1485  
  1486  // Header returns a http.Header that can be modified by the caller to add
  1487  // headers to the request.
  1488  func (c *EventsResetMultipleForAllPlayersCall) Header() http.Header {
  1489  	if c.header_ == nil {
  1490  		c.header_ = make(http.Header)
  1491  	}
  1492  	return c.header_
  1493  }
  1494  
  1495  func (c *EventsResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
  1496  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1497  	var body io.Reader = nil
  1498  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventsresetmultipleforallrequest)
  1499  	if err != nil {
  1500  		return nil, err
  1501  	}
  1502  	c.urlParams_.Set("alt", alt)
  1503  	c.urlParams_.Set("prettyPrint", "false")
  1504  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/events/resetMultipleForAllPlayers")
  1505  	urls += "?" + c.urlParams_.Encode()
  1506  	req, err := http.NewRequest("POST", urls, body)
  1507  	if err != nil {
  1508  		return nil, err
  1509  	}
  1510  	req.Header = reqHeaders
  1511  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1512  }
  1513  
  1514  // Do executes the "gamesManagement.events.resetMultipleForAllPlayers" call.
  1515  func (c *EventsResetMultipleForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
  1516  	gensupport.SetOptions(c.urlParams_, opts...)
  1517  	res, err := c.doRequest("json")
  1518  	if err != nil {
  1519  		return err
  1520  	}
  1521  	defer googleapi.CloseBody(res)
  1522  	if err := googleapi.CheckResponse(res); err != nil {
  1523  		return gensupport.WrapError(err)
  1524  	}
  1525  	return nil
  1526  }
  1527  
  1528  type PlayersHideCall struct {
  1529  	s             *Service
  1530  	applicationId string
  1531  	playerId      string
  1532  	urlParams_    gensupport.URLParams
  1533  	ctx_          context.Context
  1534  	header_       http.Header
  1535  }
  1536  
  1537  // Hide: Hide the given player's leaderboard scores from the given application.
  1538  // This method is only available to user accounts for your developer console.
  1539  //
  1540  //   - applicationId: The application ID from the Google Play developer console.
  1541  //   - playerId: A player ID. A value of `me` may be used in place of the
  1542  //     authenticated player's ID.
  1543  func (r *PlayersService) Hide(applicationId string, playerId string) *PlayersHideCall {
  1544  	c := &PlayersHideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1545  	c.applicationId = applicationId
  1546  	c.playerId = playerId
  1547  	return c
  1548  }
  1549  
  1550  // Fields allows partial responses to be retrieved. See
  1551  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1552  // details.
  1553  func (c *PlayersHideCall) Fields(s ...googleapi.Field) *PlayersHideCall {
  1554  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1555  	return c
  1556  }
  1557  
  1558  // Context sets the context to be used in this call's Do method.
  1559  func (c *PlayersHideCall) Context(ctx context.Context) *PlayersHideCall {
  1560  	c.ctx_ = ctx
  1561  	return c
  1562  }
  1563  
  1564  // Header returns a http.Header that can be modified by the caller to add
  1565  // headers to the request.
  1566  func (c *PlayersHideCall) Header() http.Header {
  1567  	if c.header_ == nil {
  1568  		c.header_ = make(http.Header)
  1569  	}
  1570  	return c.header_
  1571  }
  1572  
  1573  func (c *PlayersHideCall) doRequest(alt string) (*http.Response, error) {
  1574  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1575  	var body io.Reader = nil
  1576  	c.urlParams_.Set("alt", alt)
  1577  	c.urlParams_.Set("prettyPrint", "false")
  1578  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden/{playerId}")
  1579  	urls += "?" + c.urlParams_.Encode()
  1580  	req, err := http.NewRequest("POST", urls, body)
  1581  	if err != nil {
  1582  		return nil, err
  1583  	}
  1584  	req.Header = reqHeaders
  1585  	googleapi.Expand(req.URL, map[string]string{
  1586  		"applicationId": c.applicationId,
  1587  		"playerId":      c.playerId,
  1588  	})
  1589  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1590  }
  1591  
  1592  // Do executes the "gamesManagement.players.hide" call.
  1593  func (c *PlayersHideCall) Do(opts ...googleapi.CallOption) error {
  1594  	gensupport.SetOptions(c.urlParams_, opts...)
  1595  	res, err := c.doRequest("json")
  1596  	if err != nil {
  1597  		return err
  1598  	}
  1599  	defer googleapi.CloseBody(res)
  1600  	if err := googleapi.CheckResponse(res); err != nil {
  1601  		return gensupport.WrapError(err)
  1602  	}
  1603  	return nil
  1604  }
  1605  
  1606  type PlayersUnhideCall struct {
  1607  	s             *Service
  1608  	applicationId string
  1609  	playerId      string
  1610  	urlParams_    gensupport.URLParams
  1611  	ctx_          context.Context
  1612  	header_       http.Header
  1613  }
  1614  
  1615  // Unhide: Unhide the given player's leaderboard scores from the given
  1616  // application. This method is only available to user accounts for your
  1617  // developer console.
  1618  //
  1619  //   - applicationId: The application ID from the Google Play developer console.
  1620  //   - playerId: A player ID. A value of `me` may be used in place of the
  1621  //     authenticated player's ID.
  1622  func (r *PlayersService) Unhide(applicationId string, playerId string) *PlayersUnhideCall {
  1623  	c := &PlayersUnhideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1624  	c.applicationId = applicationId
  1625  	c.playerId = playerId
  1626  	return c
  1627  }
  1628  
  1629  // Fields allows partial responses to be retrieved. See
  1630  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1631  // details.
  1632  func (c *PlayersUnhideCall) Fields(s ...googleapi.Field) *PlayersUnhideCall {
  1633  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1634  	return c
  1635  }
  1636  
  1637  // Context sets the context to be used in this call's Do method.
  1638  func (c *PlayersUnhideCall) Context(ctx context.Context) *PlayersUnhideCall {
  1639  	c.ctx_ = ctx
  1640  	return c
  1641  }
  1642  
  1643  // Header returns a http.Header that can be modified by the caller to add
  1644  // headers to the request.
  1645  func (c *PlayersUnhideCall) Header() http.Header {
  1646  	if c.header_ == nil {
  1647  		c.header_ = make(http.Header)
  1648  	}
  1649  	return c.header_
  1650  }
  1651  
  1652  func (c *PlayersUnhideCall) doRequest(alt string) (*http.Response, error) {
  1653  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1654  	var body io.Reader = nil
  1655  	c.urlParams_.Set("alt", alt)
  1656  	c.urlParams_.Set("prettyPrint", "false")
  1657  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/applications/{applicationId}/players/hidden/{playerId}")
  1658  	urls += "?" + c.urlParams_.Encode()
  1659  	req, err := http.NewRequest("DELETE", urls, body)
  1660  	if err != nil {
  1661  		return nil, err
  1662  	}
  1663  	req.Header = reqHeaders
  1664  	googleapi.Expand(req.URL, map[string]string{
  1665  		"applicationId": c.applicationId,
  1666  		"playerId":      c.playerId,
  1667  	})
  1668  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1669  }
  1670  
  1671  // Do executes the "gamesManagement.players.unhide" call.
  1672  func (c *PlayersUnhideCall) Do(opts ...googleapi.CallOption) error {
  1673  	gensupport.SetOptions(c.urlParams_, opts...)
  1674  	res, err := c.doRequest("json")
  1675  	if err != nil {
  1676  		return err
  1677  	}
  1678  	defer googleapi.CloseBody(res)
  1679  	if err := googleapi.CheckResponse(res); err != nil {
  1680  		return gensupport.WrapError(err)
  1681  	}
  1682  	return nil
  1683  }
  1684  
  1685  type ScoresResetCall struct {
  1686  	s             *Service
  1687  	leaderboardId string
  1688  	urlParams_    gensupport.URLParams
  1689  	ctx_          context.Context
  1690  	header_       http.Header
  1691  }
  1692  
  1693  // Reset: Resets scores for the leaderboard with the given ID for the currently
  1694  // authenticated player. This method is only accessible to whitelisted tester
  1695  // accounts for your application.
  1696  //
  1697  // - leaderboardId: The ID of the leaderboard.
  1698  func (r *ScoresService) Reset(leaderboardId string) *ScoresResetCall {
  1699  	c := &ScoresResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1700  	c.leaderboardId = leaderboardId
  1701  	return c
  1702  }
  1703  
  1704  // Fields allows partial responses to be retrieved. See
  1705  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1706  // details.
  1707  func (c *ScoresResetCall) Fields(s ...googleapi.Field) *ScoresResetCall {
  1708  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1709  	return c
  1710  }
  1711  
  1712  // Context sets the context to be used in this call's Do method.
  1713  func (c *ScoresResetCall) Context(ctx context.Context) *ScoresResetCall {
  1714  	c.ctx_ = ctx
  1715  	return c
  1716  }
  1717  
  1718  // Header returns a http.Header that can be modified by the caller to add
  1719  // headers to the request.
  1720  func (c *ScoresResetCall) Header() http.Header {
  1721  	if c.header_ == nil {
  1722  		c.header_ = make(http.Header)
  1723  	}
  1724  	return c.header_
  1725  }
  1726  
  1727  func (c *ScoresResetCall) doRequest(alt string) (*http.Response, error) {
  1728  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1729  	var body io.Reader = nil
  1730  	c.urlParams_.Set("alt", alt)
  1731  	c.urlParams_.Set("prettyPrint", "false")
  1732  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/leaderboards/{leaderboardId}/scores/reset")
  1733  	urls += "?" + c.urlParams_.Encode()
  1734  	req, err := http.NewRequest("POST", urls, body)
  1735  	if err != nil {
  1736  		return nil, err
  1737  	}
  1738  	req.Header = reqHeaders
  1739  	googleapi.Expand(req.URL, map[string]string{
  1740  		"leaderboardId": c.leaderboardId,
  1741  	})
  1742  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1743  }
  1744  
  1745  // Do executes the "gamesManagement.scores.reset" call.
  1746  // Any non-2xx status code is an error. Response headers are in either
  1747  // *PlayerScoreResetResponse.ServerResponse.Header or (if a response was
  1748  // returned at all) in error.(*googleapi.Error).Header. Use
  1749  // googleapi.IsNotModified to check whether the returned error was because
  1750  // http.StatusNotModified was returned.
  1751  func (c *ScoresResetCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResetResponse, error) {
  1752  	gensupport.SetOptions(c.urlParams_, opts...)
  1753  	res, err := c.doRequest("json")
  1754  	if res != nil && res.StatusCode == http.StatusNotModified {
  1755  		if res.Body != nil {
  1756  			res.Body.Close()
  1757  		}
  1758  		return nil, gensupport.WrapError(&googleapi.Error{
  1759  			Code:   res.StatusCode,
  1760  			Header: res.Header,
  1761  		})
  1762  	}
  1763  	if err != nil {
  1764  		return nil, err
  1765  	}
  1766  	defer googleapi.CloseBody(res)
  1767  	if err := googleapi.CheckResponse(res); err != nil {
  1768  		return nil, gensupport.WrapError(err)
  1769  	}
  1770  	ret := &PlayerScoreResetResponse{
  1771  		ServerResponse: googleapi.ServerResponse{
  1772  			Header:         res.Header,
  1773  			HTTPStatusCode: res.StatusCode,
  1774  		},
  1775  	}
  1776  	target := &ret
  1777  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1778  		return nil, err
  1779  	}
  1780  	return ret, nil
  1781  }
  1782  
  1783  type ScoresResetAllCall struct {
  1784  	s          *Service
  1785  	urlParams_ gensupport.URLParams
  1786  	ctx_       context.Context
  1787  	header_    http.Header
  1788  }
  1789  
  1790  // ResetAll: Resets all scores for all leaderboards for the currently
  1791  // authenticated players. This method is only accessible to whitelisted tester
  1792  // accounts for your application.
  1793  func (r *ScoresService) ResetAll() *ScoresResetAllCall {
  1794  	c := &ScoresResetAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1795  	return c
  1796  }
  1797  
  1798  // Fields allows partial responses to be retrieved. See
  1799  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1800  // details.
  1801  func (c *ScoresResetAllCall) Fields(s ...googleapi.Field) *ScoresResetAllCall {
  1802  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1803  	return c
  1804  }
  1805  
  1806  // Context sets the context to be used in this call's Do method.
  1807  func (c *ScoresResetAllCall) Context(ctx context.Context) *ScoresResetAllCall {
  1808  	c.ctx_ = ctx
  1809  	return c
  1810  }
  1811  
  1812  // Header returns a http.Header that can be modified by the caller to add
  1813  // headers to the request.
  1814  func (c *ScoresResetAllCall) Header() http.Header {
  1815  	if c.header_ == nil {
  1816  		c.header_ = make(http.Header)
  1817  	}
  1818  	return c.header_
  1819  }
  1820  
  1821  func (c *ScoresResetAllCall) doRequest(alt string) (*http.Response, error) {
  1822  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1823  	var body io.Reader = nil
  1824  	c.urlParams_.Set("alt", alt)
  1825  	c.urlParams_.Set("prettyPrint", "false")
  1826  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/scores/reset")
  1827  	urls += "?" + c.urlParams_.Encode()
  1828  	req, err := http.NewRequest("POST", urls, body)
  1829  	if err != nil {
  1830  		return nil, err
  1831  	}
  1832  	req.Header = reqHeaders
  1833  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1834  }
  1835  
  1836  // Do executes the "gamesManagement.scores.resetAll" call.
  1837  // Any non-2xx status code is an error. Response headers are in either
  1838  // *PlayerScoreResetAllResponse.ServerResponse.Header or (if a response was
  1839  // returned at all) in error.(*googleapi.Error).Header. Use
  1840  // googleapi.IsNotModified to check whether the returned error was because
  1841  // http.StatusNotModified was returned.
  1842  func (c *ScoresResetAllCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResetAllResponse, error) {
  1843  	gensupport.SetOptions(c.urlParams_, opts...)
  1844  	res, err := c.doRequest("json")
  1845  	if res != nil && res.StatusCode == http.StatusNotModified {
  1846  		if res.Body != nil {
  1847  			res.Body.Close()
  1848  		}
  1849  		return nil, gensupport.WrapError(&googleapi.Error{
  1850  			Code:   res.StatusCode,
  1851  			Header: res.Header,
  1852  		})
  1853  	}
  1854  	if err != nil {
  1855  		return nil, err
  1856  	}
  1857  	defer googleapi.CloseBody(res)
  1858  	if err := googleapi.CheckResponse(res); err != nil {
  1859  		return nil, gensupport.WrapError(err)
  1860  	}
  1861  	ret := &PlayerScoreResetAllResponse{
  1862  		ServerResponse: googleapi.ServerResponse{
  1863  			Header:         res.Header,
  1864  			HTTPStatusCode: res.StatusCode,
  1865  		},
  1866  	}
  1867  	target := &ret
  1868  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1869  		return nil, err
  1870  	}
  1871  	return ret, nil
  1872  }
  1873  
  1874  type ScoresResetAllForAllPlayersCall struct {
  1875  	s          *Service
  1876  	urlParams_ gensupport.URLParams
  1877  	ctx_       context.Context
  1878  	header_    http.Header
  1879  }
  1880  
  1881  // ResetAllForAllPlayers: Resets scores for all draft leaderboards for all
  1882  // players. This method is only available to user accounts for your developer
  1883  // console.
  1884  func (r *ScoresService) ResetAllForAllPlayers() *ScoresResetAllForAllPlayersCall {
  1885  	c := &ScoresResetAllForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1886  	return c
  1887  }
  1888  
  1889  // Fields allows partial responses to be retrieved. See
  1890  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1891  // details.
  1892  func (c *ScoresResetAllForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetAllForAllPlayersCall {
  1893  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1894  	return c
  1895  }
  1896  
  1897  // Context sets the context to be used in this call's Do method.
  1898  func (c *ScoresResetAllForAllPlayersCall) Context(ctx context.Context) *ScoresResetAllForAllPlayersCall {
  1899  	c.ctx_ = ctx
  1900  	return c
  1901  }
  1902  
  1903  // Header returns a http.Header that can be modified by the caller to add
  1904  // headers to the request.
  1905  func (c *ScoresResetAllForAllPlayersCall) Header() http.Header {
  1906  	if c.header_ == nil {
  1907  		c.header_ = make(http.Header)
  1908  	}
  1909  	return c.header_
  1910  }
  1911  
  1912  func (c *ScoresResetAllForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
  1913  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1914  	var body io.Reader = nil
  1915  	c.urlParams_.Set("alt", alt)
  1916  	c.urlParams_.Set("prettyPrint", "false")
  1917  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/scores/resetAllForAllPlayers")
  1918  	urls += "?" + c.urlParams_.Encode()
  1919  	req, err := http.NewRequest("POST", urls, body)
  1920  	if err != nil {
  1921  		return nil, err
  1922  	}
  1923  	req.Header = reqHeaders
  1924  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1925  }
  1926  
  1927  // Do executes the "gamesManagement.scores.resetAllForAllPlayers" call.
  1928  func (c *ScoresResetAllForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
  1929  	gensupport.SetOptions(c.urlParams_, opts...)
  1930  	res, err := c.doRequest("json")
  1931  	if err != nil {
  1932  		return err
  1933  	}
  1934  	defer googleapi.CloseBody(res)
  1935  	if err := googleapi.CheckResponse(res); err != nil {
  1936  		return gensupport.WrapError(err)
  1937  	}
  1938  	return nil
  1939  }
  1940  
  1941  type ScoresResetForAllPlayersCall struct {
  1942  	s             *Service
  1943  	leaderboardId string
  1944  	urlParams_    gensupport.URLParams
  1945  	ctx_          context.Context
  1946  	header_       http.Header
  1947  }
  1948  
  1949  // ResetForAllPlayers: Resets scores for the leaderboard with the given ID for
  1950  // all players. This method is only available to user accounts for your
  1951  // developer console. Only draft leaderboards can be reset.
  1952  //
  1953  // - leaderboardId: The ID of the leaderboard.
  1954  func (r *ScoresService) ResetForAllPlayers(leaderboardId string) *ScoresResetForAllPlayersCall {
  1955  	c := &ScoresResetForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1956  	c.leaderboardId = leaderboardId
  1957  	return c
  1958  }
  1959  
  1960  // Fields allows partial responses to be retrieved. See
  1961  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1962  // details.
  1963  func (c *ScoresResetForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetForAllPlayersCall {
  1964  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1965  	return c
  1966  }
  1967  
  1968  // Context sets the context to be used in this call's Do method.
  1969  func (c *ScoresResetForAllPlayersCall) Context(ctx context.Context) *ScoresResetForAllPlayersCall {
  1970  	c.ctx_ = ctx
  1971  	return c
  1972  }
  1973  
  1974  // Header returns a http.Header that can be modified by the caller to add
  1975  // headers to the request.
  1976  func (c *ScoresResetForAllPlayersCall) Header() http.Header {
  1977  	if c.header_ == nil {
  1978  		c.header_ = make(http.Header)
  1979  	}
  1980  	return c.header_
  1981  }
  1982  
  1983  func (c *ScoresResetForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
  1984  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1985  	var body io.Reader = nil
  1986  	c.urlParams_.Set("alt", alt)
  1987  	c.urlParams_.Set("prettyPrint", "false")
  1988  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/leaderboards/{leaderboardId}/scores/resetForAllPlayers")
  1989  	urls += "?" + c.urlParams_.Encode()
  1990  	req, err := http.NewRequest("POST", urls, body)
  1991  	if err != nil {
  1992  		return nil, err
  1993  	}
  1994  	req.Header = reqHeaders
  1995  	googleapi.Expand(req.URL, map[string]string{
  1996  		"leaderboardId": c.leaderboardId,
  1997  	})
  1998  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1999  }
  2000  
  2001  // Do executes the "gamesManagement.scores.resetForAllPlayers" call.
  2002  func (c *ScoresResetForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
  2003  	gensupport.SetOptions(c.urlParams_, opts...)
  2004  	res, err := c.doRequest("json")
  2005  	if err != nil {
  2006  		return err
  2007  	}
  2008  	defer googleapi.CloseBody(res)
  2009  	if err := googleapi.CheckResponse(res); err != nil {
  2010  		return gensupport.WrapError(err)
  2011  	}
  2012  	return nil
  2013  }
  2014  
  2015  type ScoresResetMultipleForAllPlayersCall struct {
  2016  	s                                *Service
  2017  	scoresresetmultipleforallrequest *ScoresResetMultipleForAllRequest
  2018  	urlParams_                       gensupport.URLParams
  2019  	ctx_                             context.Context
  2020  	header_                          http.Header
  2021  }
  2022  
  2023  // ResetMultipleForAllPlayers: Resets scores for the leaderboards with the
  2024  // given IDs for all players. This method is only available to user accounts
  2025  // for your developer console. Only draft leaderboards may be reset.
  2026  func (r *ScoresService) ResetMultipleForAllPlayers(scoresresetmultipleforallrequest *ScoresResetMultipleForAllRequest) *ScoresResetMultipleForAllPlayersCall {
  2027  	c := &ScoresResetMultipleForAllPlayersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2028  	c.scoresresetmultipleforallrequest = scoresresetmultipleforallrequest
  2029  	return c
  2030  }
  2031  
  2032  // Fields allows partial responses to be retrieved. See
  2033  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2034  // details.
  2035  func (c *ScoresResetMultipleForAllPlayersCall) Fields(s ...googleapi.Field) *ScoresResetMultipleForAllPlayersCall {
  2036  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2037  	return c
  2038  }
  2039  
  2040  // Context sets the context to be used in this call's Do method.
  2041  func (c *ScoresResetMultipleForAllPlayersCall) Context(ctx context.Context) *ScoresResetMultipleForAllPlayersCall {
  2042  	c.ctx_ = ctx
  2043  	return c
  2044  }
  2045  
  2046  // Header returns a http.Header that can be modified by the caller to add
  2047  // headers to the request.
  2048  func (c *ScoresResetMultipleForAllPlayersCall) Header() http.Header {
  2049  	if c.header_ == nil {
  2050  		c.header_ = make(http.Header)
  2051  	}
  2052  	return c.header_
  2053  }
  2054  
  2055  func (c *ScoresResetMultipleForAllPlayersCall) doRequest(alt string) (*http.Response, error) {
  2056  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2057  	var body io.Reader = nil
  2058  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.scoresresetmultipleforallrequest)
  2059  	if err != nil {
  2060  		return nil, err
  2061  	}
  2062  	c.urlParams_.Set("alt", alt)
  2063  	c.urlParams_.Set("prettyPrint", "false")
  2064  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1management/scores/resetMultipleForAllPlayers")
  2065  	urls += "?" + c.urlParams_.Encode()
  2066  	req, err := http.NewRequest("POST", urls, body)
  2067  	if err != nil {
  2068  		return nil, err
  2069  	}
  2070  	req.Header = reqHeaders
  2071  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2072  }
  2073  
  2074  // Do executes the "gamesManagement.scores.resetMultipleForAllPlayers" call.
  2075  func (c *ScoresResetMultipleForAllPlayersCall) Do(opts ...googleapi.CallOption) error {
  2076  	gensupport.SetOptions(c.urlParams_, opts...)
  2077  	res, err := c.doRequest("json")
  2078  	if err != nil {
  2079  		return err
  2080  	}
  2081  	defer googleapi.CloseBody(res)
  2082  	if err := googleapi.CheckResponse(res); err != nil {
  2083  		return gensupport.WrapError(err)
  2084  	}
  2085  	return nil
  2086  }
  2087  

View as plain text