...

Source file src/google.golang.org/api/gamesconfiguration/v1configuration/gamesconfiguration-gen.go

Documentation: google.golang.org/api/gamesconfiguration/v1configuration

     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 gamesconfiguration provides access to the Google Play Game Services Publishing API.
     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/gamesconfiguration/v1configuration"
    27  //	...
    28  //	ctx := context.Background()
    29  //	gamesconfigurationService, err := gamesconfiguration.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  //	gamesconfigurationService, err := gamesconfiguration.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  //	gamesconfigurationService, err := gamesconfiguration.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package gamesconfiguration // import "google.golang.org/api/gamesconfiguration/v1configuration"
    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 = "gamesConfiguration:v1configuration"
    90  const apiName = "gamesConfiguration"
    91  const apiVersion = "v1configuration"
    92  const basePath = "https://gamesconfiguration.googleapis.com/"
    93  const basePathTemplate = "https://gamesconfiguration.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://gamesconfiguration.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// View and manage your Google Play Developer account
    99  	AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher"
   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/androidpublisher",
   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.AchievementConfigurations = NewAchievementConfigurationsService(s)
   138  	s.LeaderboardConfigurations = NewLeaderboardConfigurationsService(s)
   139  	return s, nil
   140  }
   141  
   142  type Service struct {
   143  	client    *http.Client
   144  	BasePath  string // API endpoint base URL
   145  	UserAgent string // optional additional User-Agent fragment
   146  
   147  	AchievementConfigurations *AchievementConfigurationsService
   148  
   149  	LeaderboardConfigurations *LeaderboardConfigurationsService
   150  }
   151  
   152  func (s *Service) userAgent() string {
   153  	if s.UserAgent == "" {
   154  		return googleapi.UserAgent
   155  	}
   156  	return googleapi.UserAgent + " " + s.UserAgent
   157  }
   158  
   159  func NewAchievementConfigurationsService(s *Service) *AchievementConfigurationsService {
   160  	rs := &AchievementConfigurationsService{s: s}
   161  	return rs
   162  }
   163  
   164  type AchievementConfigurationsService struct {
   165  	s *Service
   166  }
   167  
   168  func NewLeaderboardConfigurationsService(s *Service) *LeaderboardConfigurationsService {
   169  	rs := &LeaderboardConfigurationsService{s: s}
   170  	return rs
   171  }
   172  
   173  type LeaderboardConfigurationsService struct {
   174  	s *Service
   175  }
   176  
   177  // AchievementConfiguration: An achievement configuration resource.
   178  type AchievementConfiguration struct {
   179  	// AchievementType: The type of the achievement.
   180  	//
   181  	// Possible values:
   182  	//   "ACHIEVEMENT_TYPE_UNSPECIFIED" - Default value. This value is unused.
   183  	//   "STANDARD" - Achievement is either locked or unlocked.
   184  	//   "INCREMENTAL" - Achievement is incremental.
   185  	AchievementType string `json:"achievementType,omitempty"`
   186  	// Draft: The draft data of the achievement.
   187  	Draft *AchievementConfigurationDetail `json:"draft,omitempty"`
   188  	// Id: The ID of the achievement.
   189  	Id string `json:"id,omitempty"`
   190  	// InitialState: The initial state of the achievement.
   191  	//
   192  	// Possible values:
   193  	//   "INITIAL_STATE_UNSPECIFIED" - Default value. This value is unused.
   194  	//   "HIDDEN" - Achievement is hidden.
   195  	//   "REVEALED" - Achievement is revealed.
   196  	InitialState string `json:"initialState,omitempty"`
   197  	// Kind: Uniquely identifies the type of this resource. Value is always the
   198  	// fixed string `gamesConfiguration#achievementConfiguration`.
   199  	Kind string `json:"kind,omitempty"`
   200  	// Published: The read-only published data of the achievement.
   201  	Published *AchievementConfigurationDetail `json:"published,omitempty"`
   202  	// StepsToUnlock: Steps to unlock. Only applicable to incremental achievements.
   203  	StepsToUnlock int64 `json:"stepsToUnlock,omitempty"`
   204  	// Token: The token for this resource.
   205  	Token string `json:"token,omitempty"`
   206  
   207  	// ServerResponse contains the HTTP response code and headers from the server.
   208  	googleapi.ServerResponse `json:"-"`
   209  	// ForceSendFields is a list of field names (e.g. "AchievementType") to
   210  	// unconditionally include in API requests. By default, fields with empty or
   211  	// default values are omitted from API requests. See
   212  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   213  	// details.
   214  	ForceSendFields []string `json:"-"`
   215  	// NullFields is a list of field names (e.g. "AchievementType") to include in
   216  	// API requests with the JSON null value. By default, fields with empty values
   217  	// are omitted from API requests. See
   218  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   219  	NullFields []string `json:"-"`
   220  }
   221  
   222  func (s *AchievementConfiguration) MarshalJSON() ([]byte, error) {
   223  	type NoMethod AchievementConfiguration
   224  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   225  }
   226  
   227  // AchievementConfigurationDetail: An achievement configuration detail.
   228  type AchievementConfigurationDetail struct {
   229  	// Description: Localized strings for the achievement description.
   230  	Description *LocalizedStringBundle `json:"description,omitempty"`
   231  	// IconUrl: The icon url of this achievement. Writes to this field are ignored.
   232  	IconUrl string `json:"iconUrl,omitempty"`
   233  	// Kind: Uniquely identifies the type of this resource. Value is always the
   234  	// fixed string `gamesConfiguration#achievementConfigurationDetail`.
   235  	Kind string `json:"kind,omitempty"`
   236  	// Name: Localized strings for the achievement name.
   237  	Name *LocalizedStringBundle `json:"name,omitempty"`
   238  	// PointValue: Point value for the achievement.
   239  	PointValue int64 `json:"pointValue,omitempty"`
   240  	// SortRank: The sort rank of this achievement. Writes to this field are
   241  	// ignored.
   242  	SortRank int64 `json:"sortRank,omitempty"`
   243  	// ForceSendFields is a list of field names (e.g. "Description") to
   244  	// unconditionally include in API requests. By default, fields with empty or
   245  	// default values are omitted from API requests. See
   246  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   247  	// details.
   248  	ForceSendFields []string `json:"-"`
   249  	// NullFields is a list of field names (e.g. "Description") to include in API
   250  	// requests with the JSON null value. By default, fields with empty values are
   251  	// omitted from API requests. See
   252  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   253  	NullFields []string `json:"-"`
   254  }
   255  
   256  func (s *AchievementConfigurationDetail) MarshalJSON() ([]byte, error) {
   257  	type NoMethod AchievementConfigurationDetail
   258  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   259  }
   260  
   261  // AchievementConfigurationListResponse: A ListConfigurations response.
   262  type AchievementConfigurationListResponse struct {
   263  	// Items: The achievement configurations.
   264  	Items []*AchievementConfiguration `json:"items,omitempty"`
   265  	// Kind: Uniquely identifies the type of this resource. Value is always the
   266  	// fixed string `gamesConfiguration#achievementConfigurationListResponse`.
   267  	Kind string `json:"kind,omitempty"`
   268  	// NextPageToken: The pagination token for the next page of results.
   269  	NextPageToken string `json:"nextPageToken,omitempty"`
   270  
   271  	// ServerResponse contains the HTTP response code and headers from the server.
   272  	googleapi.ServerResponse `json:"-"`
   273  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
   274  	// include in API requests. By default, fields with empty or default values are
   275  	// omitted from API requests. See
   276  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   277  	// details.
   278  	ForceSendFields []string `json:"-"`
   279  	// NullFields is a list of field names (e.g. "Items") to include in API
   280  	// requests with the JSON null value. By default, fields with empty values are
   281  	// omitted from API requests. See
   282  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   283  	NullFields []string `json:"-"`
   284  }
   285  
   286  func (s *AchievementConfigurationListResponse) MarshalJSON() ([]byte, error) {
   287  	type NoMethod AchievementConfigurationListResponse
   288  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   289  }
   290  
   291  // GamesNumberAffixConfiguration: A number affix resource.
   292  type GamesNumberAffixConfiguration struct {
   293  	// Few: When the language requires special treatment of "small" numbers (as
   294  	// with 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, 13, or
   295  	// 14 in Polish).
   296  	Few *LocalizedStringBundle `json:"few,omitempty"`
   297  	// Many: When the language requires special treatment of "large" numbers (as
   298  	// with numbers ending 11-99 in Maltese).
   299  	Many *LocalizedStringBundle `json:"many,omitempty"`
   300  	// One: When the language requires special treatment of numbers like one (as
   301  	// with the number 1 in English and most other languages; in Russian, any
   302  	// number ending in 1 but not ending in 11 is in this class).
   303  	One *LocalizedStringBundle `json:"one,omitempty"`
   304  	// Other: When the language does not require special treatment of the given
   305  	// quantity (as with all numbers in Chinese, or 42 in English).
   306  	Other *LocalizedStringBundle `json:"other,omitempty"`
   307  	// Two: When the language requires special treatment of numbers like two (as
   308  	// with 2 in Welsh, or 102 in Slovenian).
   309  	Two *LocalizedStringBundle `json:"two,omitempty"`
   310  	// Zero: When the language requires special treatment of the number 0 (as in
   311  	// Arabic).
   312  	Zero *LocalizedStringBundle `json:"zero,omitempty"`
   313  	// ForceSendFields is a list of field names (e.g. "Few") to unconditionally
   314  	// include in API requests. By default, fields with empty or default values are
   315  	// omitted from API requests. See
   316  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   317  	// details.
   318  	ForceSendFields []string `json:"-"`
   319  	// NullFields is a list of field names (e.g. "Few") to include in API requests
   320  	// with the JSON null value. By default, fields with empty values are omitted
   321  	// from API requests. See
   322  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   323  	NullFields []string `json:"-"`
   324  }
   325  
   326  func (s *GamesNumberAffixConfiguration) MarshalJSON() ([]byte, error) {
   327  	type NoMethod GamesNumberAffixConfiguration
   328  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   329  }
   330  
   331  // GamesNumberFormatConfiguration: A number format resource.
   332  type GamesNumberFormatConfiguration struct {
   333  	// CurrencyCode: The curreny code string. Only used for CURRENCY format type.
   334  	CurrencyCode string `json:"currencyCode,omitempty"`
   335  	// NumDecimalPlaces: The number of decimal places for number. Only used for
   336  	// NUMERIC format type.
   337  	NumDecimalPlaces int64 `json:"numDecimalPlaces,omitempty"`
   338  	// NumberFormatType: The formatting for the number.
   339  	//
   340  	// Possible values:
   341  	//   "NUMBER_FORMAT_TYPE_UNSPECIFIED" - Default value. This value is unused.
   342  	//   "NUMERIC" - Numbers are formatted to have no digits or fixed number of
   343  	// digits after the decimal point according to locale. An optional custom unit
   344  	// can be added.
   345  	//   "TIME_DURATION" - Numbers are formatted to hours, minutes and seconds.
   346  	//   "CURRENCY" - Numbers are formatted to currency according to locale.
   347  	NumberFormatType string `json:"numberFormatType,omitempty"`
   348  	// Suffix: An optional suffix for the NUMERIC format type. These strings follow
   349  	// the same plural rules as all Android string resources.
   350  	Suffix *GamesNumberAffixConfiguration `json:"suffix,omitempty"`
   351  	// ForceSendFields is a list of field names (e.g. "CurrencyCode") to
   352  	// unconditionally include in API requests. By default, fields with empty or
   353  	// default values are omitted from API requests. See
   354  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   355  	// details.
   356  	ForceSendFields []string `json:"-"`
   357  	// NullFields is a list of field names (e.g. "CurrencyCode") to include in API
   358  	// requests with the JSON null value. By default, fields with empty values are
   359  	// omitted from API requests. See
   360  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   361  	NullFields []string `json:"-"`
   362  }
   363  
   364  func (s *GamesNumberFormatConfiguration) MarshalJSON() ([]byte, error) {
   365  	type NoMethod GamesNumberFormatConfiguration
   366  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   367  }
   368  
   369  // LeaderboardConfiguration: An leaderboard configuration resource.
   370  type LeaderboardConfiguration struct {
   371  	// Draft: The draft data of the leaderboard.
   372  	Draft *LeaderboardConfigurationDetail `json:"draft,omitempty"`
   373  	// Id: The ID of the leaderboard.
   374  	Id string `json:"id,omitempty"`
   375  	// Kind: Uniquely identifies the type of this resource. Value is always the
   376  	// fixed string `gamesConfiguration#leaderboardConfiguration`.
   377  	Kind string `json:"kind,omitempty"`
   378  	// Published: The read-only published data of the leaderboard.
   379  	Published *LeaderboardConfigurationDetail `json:"published,omitempty"`
   380  	// ScoreMax: Maximum score that can be posted to this leaderboard.
   381  	ScoreMax int64 `json:"scoreMax,omitempty,string"`
   382  	// ScoreMin: Minimum score that can be posted to this leaderboard.
   383  	ScoreMin int64 `json:"scoreMin,omitempty,string"`
   384  	// Possible values:
   385  	//   "SCORE_ORDER_UNSPECIFIED" - Default value. This value is unused.
   386  	//   "LARGER_IS_BETTER" - Larger scores posted are ranked higher.
   387  	//   "SMALLER_IS_BETTER" - Smaller scores posted are ranked higher.
   388  	ScoreOrder string `json:"scoreOrder,omitempty"`
   389  	// Token: The token for this resource.
   390  	Token string `json:"token,omitempty"`
   391  
   392  	// ServerResponse contains the HTTP response code and headers from the server.
   393  	googleapi.ServerResponse `json:"-"`
   394  	// ForceSendFields is a list of field names (e.g. "Draft") to unconditionally
   395  	// include in API requests. By default, fields with empty or default values are
   396  	// omitted from API requests. See
   397  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   398  	// details.
   399  	ForceSendFields []string `json:"-"`
   400  	// NullFields is a list of field names (e.g. "Draft") to include in API
   401  	// requests with the JSON null value. By default, fields with empty values are
   402  	// omitted from API requests. See
   403  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   404  	NullFields []string `json:"-"`
   405  }
   406  
   407  func (s *LeaderboardConfiguration) MarshalJSON() ([]byte, error) {
   408  	type NoMethod LeaderboardConfiguration
   409  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   410  }
   411  
   412  // LeaderboardConfigurationDetail: A leaderboard configuration detail.
   413  type LeaderboardConfigurationDetail struct {
   414  	// IconUrl: The icon url of this leaderboard. Writes to this field are ignored.
   415  	IconUrl string `json:"iconUrl,omitempty"`
   416  	// Kind: Uniquely identifies the type of this resource. Value is always the
   417  	// fixed string `gamesConfiguration#leaderboardConfigurationDetail`.
   418  	Kind string `json:"kind,omitempty"`
   419  	// Name: Localized strings for the leaderboard name.
   420  	Name *LocalizedStringBundle `json:"name,omitempty"`
   421  	// ScoreFormat: The score formatting for the leaderboard.
   422  	ScoreFormat *GamesNumberFormatConfiguration `json:"scoreFormat,omitempty"`
   423  	// SortRank: The sort rank of this leaderboard. Writes to this field are
   424  	// ignored.
   425  	SortRank int64 `json:"sortRank,omitempty"`
   426  	// ForceSendFields is a list of field names (e.g. "IconUrl") to unconditionally
   427  	// include in API requests. By default, fields with empty or default values are
   428  	// omitted from API requests. See
   429  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   430  	// details.
   431  	ForceSendFields []string `json:"-"`
   432  	// NullFields is a list of field names (e.g. "IconUrl") to include in API
   433  	// requests with the JSON null value. By default, fields with empty values are
   434  	// omitted from API requests. See
   435  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   436  	NullFields []string `json:"-"`
   437  }
   438  
   439  func (s *LeaderboardConfigurationDetail) MarshalJSON() ([]byte, error) {
   440  	type NoMethod LeaderboardConfigurationDetail
   441  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   442  }
   443  
   444  // LeaderboardConfigurationListResponse: A ListConfigurations response.
   445  type LeaderboardConfigurationListResponse struct {
   446  	// Items: The leaderboard configurations.
   447  	Items []*LeaderboardConfiguration `json:"items,omitempty"`
   448  	// Kind: Uniquely identifies the type of this resource. Value is always the
   449  	// fixed string `gamesConfiguration#leaderboardConfigurationListResponse`.
   450  	Kind string `json:"kind,omitempty"`
   451  	// NextPageToken: The pagination token for the next page of results.
   452  	NextPageToken string `json:"nextPageToken,omitempty"`
   453  
   454  	// ServerResponse contains the HTTP response code and headers from the server.
   455  	googleapi.ServerResponse `json:"-"`
   456  	// ForceSendFields is a list of field names (e.g. "Items") to unconditionally
   457  	// include in API requests. By default, fields with empty or default values are
   458  	// omitted from API requests. See
   459  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   460  	// details.
   461  	ForceSendFields []string `json:"-"`
   462  	// NullFields is a list of field names (e.g. "Items") to include in API
   463  	// requests with the JSON null value. By default, fields with empty values are
   464  	// omitted from API requests. See
   465  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   466  	NullFields []string `json:"-"`
   467  }
   468  
   469  func (s *LeaderboardConfigurationListResponse) MarshalJSON() ([]byte, error) {
   470  	type NoMethod LeaderboardConfigurationListResponse
   471  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   472  }
   473  
   474  // LocalizedString: A localized string resource.
   475  type LocalizedString struct {
   476  	// Kind: Uniquely identifies the type of this resource. Value is always the
   477  	// fixed string `gamesConfiguration#localizedString`.
   478  	Kind string `json:"kind,omitempty"`
   479  	// Locale: The locale string.
   480  	Locale string `json:"locale,omitempty"`
   481  	// Value: The string value.
   482  	Value string `json:"value,omitempty"`
   483  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
   484  	// include in API requests. By default, fields with empty or default values are
   485  	// omitted from API requests. See
   486  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   487  	// details.
   488  	ForceSendFields []string `json:"-"`
   489  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
   490  	// with the JSON null value. By default, fields with empty values are omitted
   491  	// from API requests. See
   492  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   493  	NullFields []string `json:"-"`
   494  }
   495  
   496  func (s *LocalizedString) MarshalJSON() ([]byte, error) {
   497  	type NoMethod LocalizedString
   498  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   499  }
   500  
   501  // LocalizedStringBundle: A localized string bundle resource.
   502  type LocalizedStringBundle struct {
   503  	// Kind: Uniquely identifies the type of this resource. Value is always the
   504  	// fixed string `gamesConfiguration#localizedStringBundle`.
   505  	Kind string `json:"kind,omitempty"`
   506  	// Translations: The locale strings.
   507  	Translations []*LocalizedString `json:"translations,omitempty"`
   508  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
   509  	// include in API requests. By default, fields with empty or default values are
   510  	// omitted from API requests. See
   511  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   512  	// details.
   513  	ForceSendFields []string `json:"-"`
   514  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
   515  	// with the JSON null value. By default, fields with empty values are omitted
   516  	// from API requests. See
   517  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   518  	NullFields []string `json:"-"`
   519  }
   520  
   521  func (s *LocalizedStringBundle) MarshalJSON() ([]byte, error) {
   522  	type NoMethod LocalizedStringBundle
   523  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   524  }
   525  
   526  type AchievementConfigurationsDeleteCall struct {
   527  	s             *Service
   528  	achievementId string
   529  	urlParams_    gensupport.URLParams
   530  	ctx_          context.Context
   531  	header_       http.Header
   532  }
   533  
   534  // Delete: Delete the achievement configuration with the given ID.
   535  //
   536  // - achievementId: The ID of the achievement used by this method.
   537  func (r *AchievementConfigurationsService) Delete(achievementId string) *AchievementConfigurationsDeleteCall {
   538  	c := &AchievementConfigurationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   539  	c.achievementId = achievementId
   540  	return c
   541  }
   542  
   543  // Fields allows partial responses to be retrieved. See
   544  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   545  // details.
   546  func (c *AchievementConfigurationsDeleteCall) Fields(s ...googleapi.Field) *AchievementConfigurationsDeleteCall {
   547  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   548  	return c
   549  }
   550  
   551  // Context sets the context to be used in this call's Do method.
   552  func (c *AchievementConfigurationsDeleteCall) Context(ctx context.Context) *AchievementConfigurationsDeleteCall {
   553  	c.ctx_ = ctx
   554  	return c
   555  }
   556  
   557  // Header returns a http.Header that can be modified by the caller to add
   558  // headers to the request.
   559  func (c *AchievementConfigurationsDeleteCall) Header() http.Header {
   560  	if c.header_ == nil {
   561  		c.header_ = make(http.Header)
   562  	}
   563  	return c.header_
   564  }
   565  
   566  func (c *AchievementConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) {
   567  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   568  	var body io.Reader = nil
   569  	c.urlParams_.Set("alt", alt)
   570  	c.urlParams_.Set("prettyPrint", "false")
   571  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/achievements/{achievementId}")
   572  	urls += "?" + c.urlParams_.Encode()
   573  	req, err := http.NewRequest("DELETE", urls, body)
   574  	if err != nil {
   575  		return nil, err
   576  	}
   577  	req.Header = reqHeaders
   578  	googleapi.Expand(req.URL, map[string]string{
   579  		"achievementId": c.achievementId,
   580  	})
   581  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   582  }
   583  
   584  // Do executes the "gamesConfiguration.achievementConfigurations.delete" call.
   585  func (c *AchievementConfigurationsDeleteCall) Do(opts ...googleapi.CallOption) error {
   586  	gensupport.SetOptions(c.urlParams_, opts...)
   587  	res, err := c.doRequest("json")
   588  	if err != nil {
   589  		return err
   590  	}
   591  	defer googleapi.CloseBody(res)
   592  	if err := googleapi.CheckResponse(res); err != nil {
   593  		return gensupport.WrapError(err)
   594  	}
   595  	return nil
   596  }
   597  
   598  type AchievementConfigurationsGetCall struct {
   599  	s             *Service
   600  	achievementId string
   601  	urlParams_    gensupport.URLParams
   602  	ifNoneMatch_  string
   603  	ctx_          context.Context
   604  	header_       http.Header
   605  }
   606  
   607  // Get: Retrieves the metadata of the achievement configuration with the given
   608  // ID.
   609  //
   610  // - achievementId: The ID of the achievement used by this method.
   611  func (r *AchievementConfigurationsService) Get(achievementId string) *AchievementConfigurationsGetCall {
   612  	c := &AchievementConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   613  	c.achievementId = achievementId
   614  	return c
   615  }
   616  
   617  // Fields allows partial responses to be retrieved. See
   618  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   619  // details.
   620  func (c *AchievementConfigurationsGetCall) Fields(s ...googleapi.Field) *AchievementConfigurationsGetCall {
   621  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   622  	return c
   623  }
   624  
   625  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   626  // object's ETag matches the given value. This is useful for getting updates
   627  // only after the object has changed since the last request.
   628  func (c *AchievementConfigurationsGetCall) IfNoneMatch(entityTag string) *AchievementConfigurationsGetCall {
   629  	c.ifNoneMatch_ = entityTag
   630  	return c
   631  }
   632  
   633  // Context sets the context to be used in this call's Do method.
   634  func (c *AchievementConfigurationsGetCall) Context(ctx context.Context) *AchievementConfigurationsGetCall {
   635  	c.ctx_ = ctx
   636  	return c
   637  }
   638  
   639  // Header returns a http.Header that can be modified by the caller to add
   640  // headers to the request.
   641  func (c *AchievementConfigurationsGetCall) Header() http.Header {
   642  	if c.header_ == nil {
   643  		c.header_ = make(http.Header)
   644  	}
   645  	return c.header_
   646  }
   647  
   648  func (c *AchievementConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
   649  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   650  	if c.ifNoneMatch_ != "" {
   651  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   652  	}
   653  	var body io.Reader = nil
   654  	c.urlParams_.Set("alt", alt)
   655  	c.urlParams_.Set("prettyPrint", "false")
   656  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/achievements/{achievementId}")
   657  	urls += "?" + c.urlParams_.Encode()
   658  	req, err := http.NewRequest("GET", urls, body)
   659  	if err != nil {
   660  		return nil, err
   661  	}
   662  	req.Header = reqHeaders
   663  	googleapi.Expand(req.URL, map[string]string{
   664  		"achievementId": c.achievementId,
   665  	})
   666  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   667  }
   668  
   669  // Do executes the "gamesConfiguration.achievementConfigurations.get" call.
   670  // Any non-2xx status code is an error. Response headers are in either
   671  // *AchievementConfiguration.ServerResponse.Header or (if a response was
   672  // returned at all) in error.(*googleapi.Error).Header. Use
   673  // googleapi.IsNotModified to check whether the returned error was because
   674  // http.StatusNotModified was returned.
   675  func (c *AchievementConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*AchievementConfiguration, error) {
   676  	gensupport.SetOptions(c.urlParams_, opts...)
   677  	res, err := c.doRequest("json")
   678  	if res != nil && res.StatusCode == http.StatusNotModified {
   679  		if res.Body != nil {
   680  			res.Body.Close()
   681  		}
   682  		return nil, gensupport.WrapError(&googleapi.Error{
   683  			Code:   res.StatusCode,
   684  			Header: res.Header,
   685  		})
   686  	}
   687  	if err != nil {
   688  		return nil, err
   689  	}
   690  	defer googleapi.CloseBody(res)
   691  	if err := googleapi.CheckResponse(res); err != nil {
   692  		return nil, gensupport.WrapError(err)
   693  	}
   694  	ret := &AchievementConfiguration{
   695  		ServerResponse: googleapi.ServerResponse{
   696  			Header:         res.Header,
   697  			HTTPStatusCode: res.StatusCode,
   698  		},
   699  	}
   700  	target := &ret
   701  	if err := gensupport.DecodeResponse(target, res); err != nil {
   702  		return nil, err
   703  	}
   704  	return ret, nil
   705  }
   706  
   707  type AchievementConfigurationsInsertCall struct {
   708  	s                        *Service
   709  	applicationId            string
   710  	achievementconfiguration *AchievementConfiguration
   711  	urlParams_               gensupport.URLParams
   712  	ctx_                     context.Context
   713  	header_                  http.Header
   714  }
   715  
   716  // Insert: Insert a new achievement configuration in this application.
   717  //
   718  // - applicationId: The application ID from the Google Play developer console.
   719  func (r *AchievementConfigurationsService) Insert(applicationId string, achievementconfiguration *AchievementConfiguration) *AchievementConfigurationsInsertCall {
   720  	c := &AchievementConfigurationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   721  	c.applicationId = applicationId
   722  	c.achievementconfiguration = achievementconfiguration
   723  	return c
   724  }
   725  
   726  // Fields allows partial responses to be retrieved. See
   727  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   728  // details.
   729  func (c *AchievementConfigurationsInsertCall) Fields(s ...googleapi.Field) *AchievementConfigurationsInsertCall {
   730  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   731  	return c
   732  }
   733  
   734  // Context sets the context to be used in this call's Do method.
   735  func (c *AchievementConfigurationsInsertCall) Context(ctx context.Context) *AchievementConfigurationsInsertCall {
   736  	c.ctx_ = ctx
   737  	return c
   738  }
   739  
   740  // Header returns a http.Header that can be modified by the caller to add
   741  // headers to the request.
   742  func (c *AchievementConfigurationsInsertCall) Header() http.Header {
   743  	if c.header_ == nil {
   744  		c.header_ = make(http.Header)
   745  	}
   746  	return c.header_
   747  }
   748  
   749  func (c *AchievementConfigurationsInsertCall) doRequest(alt string) (*http.Response, error) {
   750  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   751  	var body io.Reader = nil
   752  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration)
   753  	if err != nil {
   754  		return nil, err
   755  	}
   756  	c.urlParams_.Set("alt", alt)
   757  	c.urlParams_.Set("prettyPrint", "false")
   758  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/applications/{applicationId}/achievements")
   759  	urls += "?" + c.urlParams_.Encode()
   760  	req, err := http.NewRequest("POST", urls, body)
   761  	if err != nil {
   762  		return nil, err
   763  	}
   764  	req.Header = reqHeaders
   765  	googleapi.Expand(req.URL, map[string]string{
   766  		"applicationId": c.applicationId,
   767  	})
   768  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   769  }
   770  
   771  // Do executes the "gamesConfiguration.achievementConfigurations.insert" call.
   772  // Any non-2xx status code is an error. Response headers are in either
   773  // *AchievementConfiguration.ServerResponse.Header or (if a response was
   774  // returned at all) in error.(*googleapi.Error).Header. Use
   775  // googleapi.IsNotModified to check whether the returned error was because
   776  // http.StatusNotModified was returned.
   777  func (c *AchievementConfigurationsInsertCall) Do(opts ...googleapi.CallOption) (*AchievementConfiguration, error) {
   778  	gensupport.SetOptions(c.urlParams_, opts...)
   779  	res, err := c.doRequest("json")
   780  	if res != nil && res.StatusCode == http.StatusNotModified {
   781  		if res.Body != nil {
   782  			res.Body.Close()
   783  		}
   784  		return nil, gensupport.WrapError(&googleapi.Error{
   785  			Code:   res.StatusCode,
   786  			Header: res.Header,
   787  		})
   788  	}
   789  	if err != nil {
   790  		return nil, err
   791  	}
   792  	defer googleapi.CloseBody(res)
   793  	if err := googleapi.CheckResponse(res); err != nil {
   794  		return nil, gensupport.WrapError(err)
   795  	}
   796  	ret := &AchievementConfiguration{
   797  		ServerResponse: googleapi.ServerResponse{
   798  			Header:         res.Header,
   799  			HTTPStatusCode: res.StatusCode,
   800  		},
   801  	}
   802  	target := &ret
   803  	if err := gensupport.DecodeResponse(target, res); err != nil {
   804  		return nil, err
   805  	}
   806  	return ret, nil
   807  }
   808  
   809  type AchievementConfigurationsListCall struct {
   810  	s             *Service
   811  	applicationId string
   812  	urlParams_    gensupport.URLParams
   813  	ifNoneMatch_  string
   814  	ctx_          context.Context
   815  	header_       http.Header
   816  }
   817  
   818  // List: Returns a list of the achievement configurations in this application.
   819  //
   820  // - applicationId: The application ID from the Google Play developer console.
   821  func (r *AchievementConfigurationsService) List(applicationId string) *AchievementConfigurationsListCall {
   822  	c := &AchievementConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   823  	c.applicationId = applicationId
   824  	return c
   825  }
   826  
   827  // MaxResults sets the optional parameter "maxResults": The maximum number of
   828  // resource configurations to return in the response, used for paging. For any
   829  // response, the actual number of resources returned may be less than the
   830  // specified `maxResults`.
   831  func (c *AchievementConfigurationsListCall) MaxResults(maxResults int64) *AchievementConfigurationsListCall {
   832  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
   833  	return c
   834  }
   835  
   836  // PageToken sets the optional parameter "pageToken": The token returned by the
   837  // previous request.
   838  func (c *AchievementConfigurationsListCall) PageToken(pageToken string) *AchievementConfigurationsListCall {
   839  	c.urlParams_.Set("pageToken", pageToken)
   840  	return c
   841  }
   842  
   843  // Fields allows partial responses to be retrieved. See
   844  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   845  // details.
   846  func (c *AchievementConfigurationsListCall) Fields(s ...googleapi.Field) *AchievementConfigurationsListCall {
   847  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   848  	return c
   849  }
   850  
   851  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   852  // object's ETag matches the given value. This is useful for getting updates
   853  // only after the object has changed since the last request.
   854  func (c *AchievementConfigurationsListCall) IfNoneMatch(entityTag string) *AchievementConfigurationsListCall {
   855  	c.ifNoneMatch_ = entityTag
   856  	return c
   857  }
   858  
   859  // Context sets the context to be used in this call's Do method.
   860  func (c *AchievementConfigurationsListCall) Context(ctx context.Context) *AchievementConfigurationsListCall {
   861  	c.ctx_ = ctx
   862  	return c
   863  }
   864  
   865  // Header returns a http.Header that can be modified by the caller to add
   866  // headers to the request.
   867  func (c *AchievementConfigurationsListCall) Header() http.Header {
   868  	if c.header_ == nil {
   869  		c.header_ = make(http.Header)
   870  	}
   871  	return c.header_
   872  }
   873  
   874  func (c *AchievementConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
   875  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   876  	if c.ifNoneMatch_ != "" {
   877  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   878  	}
   879  	var body io.Reader = nil
   880  	c.urlParams_.Set("alt", alt)
   881  	c.urlParams_.Set("prettyPrint", "false")
   882  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/applications/{applicationId}/achievements")
   883  	urls += "?" + c.urlParams_.Encode()
   884  	req, err := http.NewRequest("GET", urls, body)
   885  	if err != nil {
   886  		return nil, err
   887  	}
   888  	req.Header = reqHeaders
   889  	googleapi.Expand(req.URL, map[string]string{
   890  		"applicationId": c.applicationId,
   891  	})
   892  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   893  }
   894  
   895  // Do executes the "gamesConfiguration.achievementConfigurations.list" call.
   896  // Any non-2xx status code is an error. Response headers are in either
   897  // *AchievementConfigurationListResponse.ServerResponse.Header or (if a
   898  // response was returned at all) in error.(*googleapi.Error).Header. Use
   899  // googleapi.IsNotModified to check whether the returned error was because
   900  // http.StatusNotModified was returned.
   901  func (c *AchievementConfigurationsListCall) Do(opts ...googleapi.CallOption) (*AchievementConfigurationListResponse, error) {
   902  	gensupport.SetOptions(c.urlParams_, opts...)
   903  	res, err := c.doRequest("json")
   904  	if res != nil && res.StatusCode == http.StatusNotModified {
   905  		if res.Body != nil {
   906  			res.Body.Close()
   907  		}
   908  		return nil, gensupport.WrapError(&googleapi.Error{
   909  			Code:   res.StatusCode,
   910  			Header: res.Header,
   911  		})
   912  	}
   913  	if err != nil {
   914  		return nil, err
   915  	}
   916  	defer googleapi.CloseBody(res)
   917  	if err := googleapi.CheckResponse(res); err != nil {
   918  		return nil, gensupport.WrapError(err)
   919  	}
   920  	ret := &AchievementConfigurationListResponse{
   921  		ServerResponse: googleapi.ServerResponse{
   922  			Header:         res.Header,
   923  			HTTPStatusCode: res.StatusCode,
   924  		},
   925  	}
   926  	target := &ret
   927  	if err := gensupport.DecodeResponse(target, res); err != nil {
   928  		return nil, err
   929  	}
   930  	return ret, nil
   931  }
   932  
   933  // Pages invokes f for each page of results.
   934  // A non-nil error returned from f will halt the iteration.
   935  // The provided context supersedes any context provided to the Context method.
   936  func (c *AchievementConfigurationsListCall) Pages(ctx context.Context, f func(*AchievementConfigurationListResponse) error) error {
   937  	c.ctx_ = ctx
   938  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   939  	for {
   940  		x, err := c.Do()
   941  		if err != nil {
   942  			return err
   943  		}
   944  		if err := f(x); err != nil {
   945  			return err
   946  		}
   947  		if x.NextPageToken == "" {
   948  			return nil
   949  		}
   950  		c.PageToken(x.NextPageToken)
   951  	}
   952  }
   953  
   954  type AchievementConfigurationsUpdateCall struct {
   955  	s                        *Service
   956  	achievementId            string
   957  	achievementconfiguration *AchievementConfiguration
   958  	urlParams_               gensupport.URLParams
   959  	ctx_                     context.Context
   960  	header_                  http.Header
   961  }
   962  
   963  // Update: Update the metadata of the achievement configuration with the given
   964  // ID.
   965  //
   966  // - achievementId: The ID of the achievement used by this method.
   967  func (r *AchievementConfigurationsService) Update(achievementId string, achievementconfiguration *AchievementConfiguration) *AchievementConfigurationsUpdateCall {
   968  	c := &AchievementConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   969  	c.achievementId = achievementId
   970  	c.achievementconfiguration = achievementconfiguration
   971  	return c
   972  }
   973  
   974  // Fields allows partial responses to be retrieved. See
   975  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   976  // details.
   977  func (c *AchievementConfigurationsUpdateCall) Fields(s ...googleapi.Field) *AchievementConfigurationsUpdateCall {
   978  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   979  	return c
   980  }
   981  
   982  // Context sets the context to be used in this call's Do method.
   983  func (c *AchievementConfigurationsUpdateCall) Context(ctx context.Context) *AchievementConfigurationsUpdateCall {
   984  	c.ctx_ = ctx
   985  	return c
   986  }
   987  
   988  // Header returns a http.Header that can be modified by the caller to add
   989  // headers to the request.
   990  func (c *AchievementConfigurationsUpdateCall) Header() http.Header {
   991  	if c.header_ == nil {
   992  		c.header_ = make(http.Header)
   993  	}
   994  	return c.header_
   995  }
   996  
   997  func (c *AchievementConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
   998  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
   999  	var body io.Reader = nil
  1000  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration)
  1001  	if err != nil {
  1002  		return nil, err
  1003  	}
  1004  	c.urlParams_.Set("alt", alt)
  1005  	c.urlParams_.Set("prettyPrint", "false")
  1006  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/achievements/{achievementId}")
  1007  	urls += "?" + c.urlParams_.Encode()
  1008  	req, err := http.NewRequest("PUT", urls, body)
  1009  	if err != nil {
  1010  		return nil, err
  1011  	}
  1012  	req.Header = reqHeaders
  1013  	googleapi.Expand(req.URL, map[string]string{
  1014  		"achievementId": c.achievementId,
  1015  	})
  1016  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1017  }
  1018  
  1019  // Do executes the "gamesConfiguration.achievementConfigurations.update" call.
  1020  // Any non-2xx status code is an error. Response headers are in either
  1021  // *AchievementConfiguration.ServerResponse.Header or (if a response was
  1022  // returned at all) in error.(*googleapi.Error).Header. Use
  1023  // googleapi.IsNotModified to check whether the returned error was because
  1024  // http.StatusNotModified was returned.
  1025  func (c *AchievementConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*AchievementConfiguration, error) {
  1026  	gensupport.SetOptions(c.urlParams_, opts...)
  1027  	res, err := c.doRequest("json")
  1028  	if res != nil && res.StatusCode == http.StatusNotModified {
  1029  		if res.Body != nil {
  1030  			res.Body.Close()
  1031  		}
  1032  		return nil, gensupport.WrapError(&googleapi.Error{
  1033  			Code:   res.StatusCode,
  1034  			Header: res.Header,
  1035  		})
  1036  	}
  1037  	if err != nil {
  1038  		return nil, err
  1039  	}
  1040  	defer googleapi.CloseBody(res)
  1041  	if err := googleapi.CheckResponse(res); err != nil {
  1042  		return nil, gensupport.WrapError(err)
  1043  	}
  1044  	ret := &AchievementConfiguration{
  1045  		ServerResponse: googleapi.ServerResponse{
  1046  			Header:         res.Header,
  1047  			HTTPStatusCode: res.StatusCode,
  1048  		},
  1049  	}
  1050  	target := &ret
  1051  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1052  		return nil, err
  1053  	}
  1054  	return ret, nil
  1055  }
  1056  
  1057  type LeaderboardConfigurationsDeleteCall struct {
  1058  	s             *Service
  1059  	leaderboardId string
  1060  	urlParams_    gensupport.URLParams
  1061  	ctx_          context.Context
  1062  	header_       http.Header
  1063  }
  1064  
  1065  // Delete: Delete the leaderboard configuration with the given ID.
  1066  //
  1067  // - leaderboardId: The ID of the leaderboard.
  1068  func (r *LeaderboardConfigurationsService) Delete(leaderboardId string) *LeaderboardConfigurationsDeleteCall {
  1069  	c := &LeaderboardConfigurationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1070  	c.leaderboardId = leaderboardId
  1071  	return c
  1072  }
  1073  
  1074  // Fields allows partial responses to be retrieved. See
  1075  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1076  // details.
  1077  func (c *LeaderboardConfigurationsDeleteCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsDeleteCall {
  1078  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1079  	return c
  1080  }
  1081  
  1082  // Context sets the context to be used in this call's Do method.
  1083  func (c *LeaderboardConfigurationsDeleteCall) Context(ctx context.Context) *LeaderboardConfigurationsDeleteCall {
  1084  	c.ctx_ = ctx
  1085  	return c
  1086  }
  1087  
  1088  // Header returns a http.Header that can be modified by the caller to add
  1089  // headers to the request.
  1090  func (c *LeaderboardConfigurationsDeleteCall) Header() http.Header {
  1091  	if c.header_ == nil {
  1092  		c.header_ = make(http.Header)
  1093  	}
  1094  	return c.header_
  1095  }
  1096  
  1097  func (c *LeaderboardConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1098  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  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/v1configuration/leaderboards/{leaderboardId}")
  1103  	urls += "?" + c.urlParams_.Encode()
  1104  	req, err := http.NewRequest("DELETE", urls, body)
  1105  	if err != nil {
  1106  		return nil, err
  1107  	}
  1108  	req.Header = reqHeaders
  1109  	googleapi.Expand(req.URL, map[string]string{
  1110  		"leaderboardId": c.leaderboardId,
  1111  	})
  1112  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1113  }
  1114  
  1115  // Do executes the "gamesConfiguration.leaderboardConfigurations.delete" call.
  1116  func (c *LeaderboardConfigurationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1117  	gensupport.SetOptions(c.urlParams_, opts...)
  1118  	res, err := c.doRequest("json")
  1119  	if err != nil {
  1120  		return err
  1121  	}
  1122  	defer googleapi.CloseBody(res)
  1123  	if err := googleapi.CheckResponse(res); err != nil {
  1124  		return gensupport.WrapError(err)
  1125  	}
  1126  	return nil
  1127  }
  1128  
  1129  type LeaderboardConfigurationsGetCall struct {
  1130  	s             *Service
  1131  	leaderboardId string
  1132  	urlParams_    gensupport.URLParams
  1133  	ifNoneMatch_  string
  1134  	ctx_          context.Context
  1135  	header_       http.Header
  1136  }
  1137  
  1138  // Get: Retrieves the metadata of the leaderboard configuration with the given
  1139  // ID.
  1140  //
  1141  // - leaderboardId: The ID of the leaderboard.
  1142  func (r *LeaderboardConfigurationsService) Get(leaderboardId string) *LeaderboardConfigurationsGetCall {
  1143  	c := &LeaderboardConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1144  	c.leaderboardId = leaderboardId
  1145  	return c
  1146  }
  1147  
  1148  // Fields allows partial responses to be retrieved. See
  1149  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1150  // details.
  1151  func (c *LeaderboardConfigurationsGetCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsGetCall {
  1152  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1153  	return c
  1154  }
  1155  
  1156  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1157  // object's ETag matches the given value. This is useful for getting updates
  1158  // only after the object has changed since the last request.
  1159  func (c *LeaderboardConfigurationsGetCall) IfNoneMatch(entityTag string) *LeaderboardConfigurationsGetCall {
  1160  	c.ifNoneMatch_ = entityTag
  1161  	return c
  1162  }
  1163  
  1164  // Context sets the context to be used in this call's Do method.
  1165  func (c *LeaderboardConfigurationsGetCall) Context(ctx context.Context) *LeaderboardConfigurationsGetCall {
  1166  	c.ctx_ = ctx
  1167  	return c
  1168  }
  1169  
  1170  // Header returns a http.Header that can be modified by the caller to add
  1171  // headers to the request.
  1172  func (c *LeaderboardConfigurationsGetCall) Header() http.Header {
  1173  	if c.header_ == nil {
  1174  		c.header_ = make(http.Header)
  1175  	}
  1176  	return c.header_
  1177  }
  1178  
  1179  func (c *LeaderboardConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  1180  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1181  	if c.ifNoneMatch_ != "" {
  1182  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1183  	}
  1184  	var body io.Reader = nil
  1185  	c.urlParams_.Set("alt", alt)
  1186  	c.urlParams_.Set("prettyPrint", "false")
  1187  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/leaderboards/{leaderboardId}")
  1188  	urls += "?" + c.urlParams_.Encode()
  1189  	req, err := http.NewRequest("GET", urls, body)
  1190  	if err != nil {
  1191  		return nil, err
  1192  	}
  1193  	req.Header = reqHeaders
  1194  	googleapi.Expand(req.URL, map[string]string{
  1195  		"leaderboardId": c.leaderboardId,
  1196  	})
  1197  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1198  }
  1199  
  1200  // Do executes the "gamesConfiguration.leaderboardConfigurations.get" call.
  1201  // Any non-2xx status code is an error. Response headers are in either
  1202  // *LeaderboardConfiguration.ServerResponse.Header or (if a response was
  1203  // returned at all) in error.(*googleapi.Error).Header. Use
  1204  // googleapi.IsNotModified to check whether the returned error was because
  1205  // http.StatusNotModified was returned.
  1206  func (c *LeaderboardConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfiguration, error) {
  1207  	gensupport.SetOptions(c.urlParams_, opts...)
  1208  	res, err := c.doRequest("json")
  1209  	if res != nil && res.StatusCode == http.StatusNotModified {
  1210  		if res.Body != nil {
  1211  			res.Body.Close()
  1212  		}
  1213  		return nil, gensupport.WrapError(&googleapi.Error{
  1214  			Code:   res.StatusCode,
  1215  			Header: res.Header,
  1216  		})
  1217  	}
  1218  	if err != nil {
  1219  		return nil, err
  1220  	}
  1221  	defer googleapi.CloseBody(res)
  1222  	if err := googleapi.CheckResponse(res); err != nil {
  1223  		return nil, gensupport.WrapError(err)
  1224  	}
  1225  	ret := &LeaderboardConfiguration{
  1226  		ServerResponse: googleapi.ServerResponse{
  1227  			Header:         res.Header,
  1228  			HTTPStatusCode: res.StatusCode,
  1229  		},
  1230  	}
  1231  	target := &ret
  1232  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1233  		return nil, err
  1234  	}
  1235  	return ret, nil
  1236  }
  1237  
  1238  type LeaderboardConfigurationsInsertCall struct {
  1239  	s                        *Service
  1240  	applicationId            string
  1241  	leaderboardconfiguration *LeaderboardConfiguration
  1242  	urlParams_               gensupport.URLParams
  1243  	ctx_                     context.Context
  1244  	header_                  http.Header
  1245  }
  1246  
  1247  // Insert: Insert a new leaderboard configuration in this application.
  1248  //
  1249  // - applicationId: The application ID from the Google Play developer console.
  1250  func (r *LeaderboardConfigurationsService) Insert(applicationId string, leaderboardconfiguration *LeaderboardConfiguration) *LeaderboardConfigurationsInsertCall {
  1251  	c := &LeaderboardConfigurationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1252  	c.applicationId = applicationId
  1253  	c.leaderboardconfiguration = leaderboardconfiguration
  1254  	return c
  1255  }
  1256  
  1257  // Fields allows partial responses to be retrieved. See
  1258  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1259  // details.
  1260  func (c *LeaderboardConfigurationsInsertCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsInsertCall {
  1261  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1262  	return c
  1263  }
  1264  
  1265  // Context sets the context to be used in this call's Do method.
  1266  func (c *LeaderboardConfigurationsInsertCall) Context(ctx context.Context) *LeaderboardConfigurationsInsertCall {
  1267  	c.ctx_ = ctx
  1268  	return c
  1269  }
  1270  
  1271  // Header returns a http.Header that can be modified by the caller to add
  1272  // headers to the request.
  1273  func (c *LeaderboardConfigurationsInsertCall) Header() http.Header {
  1274  	if c.header_ == nil {
  1275  		c.header_ = make(http.Header)
  1276  	}
  1277  	return c.header_
  1278  }
  1279  
  1280  func (c *LeaderboardConfigurationsInsertCall) doRequest(alt string) (*http.Response, error) {
  1281  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1282  	var body io.Reader = nil
  1283  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration)
  1284  	if err != nil {
  1285  		return nil, err
  1286  	}
  1287  	c.urlParams_.Set("alt", alt)
  1288  	c.urlParams_.Set("prettyPrint", "false")
  1289  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/applications/{applicationId}/leaderboards")
  1290  	urls += "?" + c.urlParams_.Encode()
  1291  	req, err := http.NewRequest("POST", urls, body)
  1292  	if err != nil {
  1293  		return nil, err
  1294  	}
  1295  	req.Header = reqHeaders
  1296  	googleapi.Expand(req.URL, map[string]string{
  1297  		"applicationId": c.applicationId,
  1298  	})
  1299  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1300  }
  1301  
  1302  // Do executes the "gamesConfiguration.leaderboardConfigurations.insert" call.
  1303  // Any non-2xx status code is an error. Response headers are in either
  1304  // *LeaderboardConfiguration.ServerResponse.Header or (if a response was
  1305  // returned at all) in error.(*googleapi.Error).Header. Use
  1306  // googleapi.IsNotModified to check whether the returned error was because
  1307  // http.StatusNotModified was returned.
  1308  func (c *LeaderboardConfigurationsInsertCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfiguration, error) {
  1309  	gensupport.SetOptions(c.urlParams_, opts...)
  1310  	res, err := c.doRequest("json")
  1311  	if res != nil && res.StatusCode == http.StatusNotModified {
  1312  		if res.Body != nil {
  1313  			res.Body.Close()
  1314  		}
  1315  		return nil, gensupport.WrapError(&googleapi.Error{
  1316  			Code:   res.StatusCode,
  1317  			Header: res.Header,
  1318  		})
  1319  	}
  1320  	if err != nil {
  1321  		return nil, err
  1322  	}
  1323  	defer googleapi.CloseBody(res)
  1324  	if err := googleapi.CheckResponse(res); err != nil {
  1325  		return nil, gensupport.WrapError(err)
  1326  	}
  1327  	ret := &LeaderboardConfiguration{
  1328  		ServerResponse: googleapi.ServerResponse{
  1329  			Header:         res.Header,
  1330  			HTTPStatusCode: res.StatusCode,
  1331  		},
  1332  	}
  1333  	target := &ret
  1334  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1335  		return nil, err
  1336  	}
  1337  	return ret, nil
  1338  }
  1339  
  1340  type LeaderboardConfigurationsListCall struct {
  1341  	s             *Service
  1342  	applicationId string
  1343  	urlParams_    gensupport.URLParams
  1344  	ifNoneMatch_  string
  1345  	ctx_          context.Context
  1346  	header_       http.Header
  1347  }
  1348  
  1349  // List: Returns a list of the leaderboard configurations in this application.
  1350  //
  1351  // - applicationId: The application ID from the Google Play developer console.
  1352  func (r *LeaderboardConfigurationsService) List(applicationId string) *LeaderboardConfigurationsListCall {
  1353  	c := &LeaderboardConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1354  	c.applicationId = applicationId
  1355  	return c
  1356  }
  1357  
  1358  // MaxResults sets the optional parameter "maxResults": The maximum number of
  1359  // resource configurations to return in the response, used for paging. For any
  1360  // response, the actual number of resources returned may be less than the
  1361  // specified `maxResults`.
  1362  func (c *LeaderboardConfigurationsListCall) MaxResults(maxResults int64) *LeaderboardConfigurationsListCall {
  1363  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1364  	return c
  1365  }
  1366  
  1367  // PageToken sets the optional parameter "pageToken": The token returned by the
  1368  // previous request.
  1369  func (c *LeaderboardConfigurationsListCall) PageToken(pageToken string) *LeaderboardConfigurationsListCall {
  1370  	c.urlParams_.Set("pageToken", pageToken)
  1371  	return c
  1372  }
  1373  
  1374  // Fields allows partial responses to be retrieved. See
  1375  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1376  // details.
  1377  func (c *LeaderboardConfigurationsListCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsListCall {
  1378  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1379  	return c
  1380  }
  1381  
  1382  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1383  // object's ETag matches the given value. This is useful for getting updates
  1384  // only after the object has changed since the last request.
  1385  func (c *LeaderboardConfigurationsListCall) IfNoneMatch(entityTag string) *LeaderboardConfigurationsListCall {
  1386  	c.ifNoneMatch_ = entityTag
  1387  	return c
  1388  }
  1389  
  1390  // Context sets the context to be used in this call's Do method.
  1391  func (c *LeaderboardConfigurationsListCall) Context(ctx context.Context) *LeaderboardConfigurationsListCall {
  1392  	c.ctx_ = ctx
  1393  	return c
  1394  }
  1395  
  1396  // Header returns a http.Header that can be modified by the caller to add
  1397  // headers to the request.
  1398  func (c *LeaderboardConfigurationsListCall) Header() http.Header {
  1399  	if c.header_ == nil {
  1400  		c.header_ = make(http.Header)
  1401  	}
  1402  	return c.header_
  1403  }
  1404  
  1405  func (c *LeaderboardConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  1406  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1407  	if c.ifNoneMatch_ != "" {
  1408  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1409  	}
  1410  	var body io.Reader = nil
  1411  	c.urlParams_.Set("alt", alt)
  1412  	c.urlParams_.Set("prettyPrint", "false")
  1413  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/applications/{applicationId}/leaderboards")
  1414  	urls += "?" + c.urlParams_.Encode()
  1415  	req, err := http.NewRequest("GET", urls, body)
  1416  	if err != nil {
  1417  		return nil, err
  1418  	}
  1419  	req.Header = reqHeaders
  1420  	googleapi.Expand(req.URL, map[string]string{
  1421  		"applicationId": c.applicationId,
  1422  	})
  1423  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1424  }
  1425  
  1426  // Do executes the "gamesConfiguration.leaderboardConfigurations.list" call.
  1427  // Any non-2xx status code is an error. Response headers are in either
  1428  // *LeaderboardConfigurationListResponse.ServerResponse.Header or (if a
  1429  // response was returned at all) in error.(*googleapi.Error).Header. Use
  1430  // googleapi.IsNotModified to check whether the returned error was because
  1431  // http.StatusNotModified was returned.
  1432  func (c *LeaderboardConfigurationsListCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfigurationListResponse, error) {
  1433  	gensupport.SetOptions(c.urlParams_, opts...)
  1434  	res, err := c.doRequest("json")
  1435  	if res != nil && res.StatusCode == http.StatusNotModified {
  1436  		if res.Body != nil {
  1437  			res.Body.Close()
  1438  		}
  1439  		return nil, gensupport.WrapError(&googleapi.Error{
  1440  			Code:   res.StatusCode,
  1441  			Header: res.Header,
  1442  		})
  1443  	}
  1444  	if err != nil {
  1445  		return nil, err
  1446  	}
  1447  	defer googleapi.CloseBody(res)
  1448  	if err := googleapi.CheckResponse(res); err != nil {
  1449  		return nil, gensupport.WrapError(err)
  1450  	}
  1451  	ret := &LeaderboardConfigurationListResponse{
  1452  		ServerResponse: googleapi.ServerResponse{
  1453  			Header:         res.Header,
  1454  			HTTPStatusCode: res.StatusCode,
  1455  		},
  1456  	}
  1457  	target := &ret
  1458  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1459  		return nil, err
  1460  	}
  1461  	return ret, nil
  1462  }
  1463  
  1464  // Pages invokes f for each page of results.
  1465  // A non-nil error returned from f will halt the iteration.
  1466  // The provided context supersedes any context provided to the Context method.
  1467  func (c *LeaderboardConfigurationsListCall) Pages(ctx context.Context, f func(*LeaderboardConfigurationListResponse) error) error {
  1468  	c.ctx_ = ctx
  1469  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1470  	for {
  1471  		x, err := c.Do()
  1472  		if err != nil {
  1473  			return err
  1474  		}
  1475  		if err := f(x); err != nil {
  1476  			return err
  1477  		}
  1478  		if x.NextPageToken == "" {
  1479  			return nil
  1480  		}
  1481  		c.PageToken(x.NextPageToken)
  1482  	}
  1483  }
  1484  
  1485  type LeaderboardConfigurationsUpdateCall struct {
  1486  	s                        *Service
  1487  	leaderboardId            string
  1488  	leaderboardconfiguration *LeaderboardConfiguration
  1489  	urlParams_               gensupport.URLParams
  1490  	ctx_                     context.Context
  1491  	header_                  http.Header
  1492  }
  1493  
  1494  // Update: Update the metadata of the leaderboard configuration with the given
  1495  // ID.
  1496  //
  1497  // - leaderboardId: The ID of the leaderboard.
  1498  func (r *LeaderboardConfigurationsService) Update(leaderboardId string, leaderboardconfiguration *LeaderboardConfiguration) *LeaderboardConfigurationsUpdateCall {
  1499  	c := &LeaderboardConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1500  	c.leaderboardId = leaderboardId
  1501  	c.leaderboardconfiguration = leaderboardconfiguration
  1502  	return c
  1503  }
  1504  
  1505  // Fields allows partial responses to be retrieved. See
  1506  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1507  // details.
  1508  func (c *LeaderboardConfigurationsUpdateCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsUpdateCall {
  1509  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1510  	return c
  1511  }
  1512  
  1513  // Context sets the context to be used in this call's Do method.
  1514  func (c *LeaderboardConfigurationsUpdateCall) Context(ctx context.Context) *LeaderboardConfigurationsUpdateCall {
  1515  	c.ctx_ = ctx
  1516  	return c
  1517  }
  1518  
  1519  // Header returns a http.Header that can be modified by the caller to add
  1520  // headers to the request.
  1521  func (c *LeaderboardConfigurationsUpdateCall) Header() http.Header {
  1522  	if c.header_ == nil {
  1523  		c.header_ = make(http.Header)
  1524  	}
  1525  	return c.header_
  1526  }
  1527  
  1528  func (c *LeaderboardConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1529  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1530  	var body io.Reader = nil
  1531  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration)
  1532  	if err != nil {
  1533  		return nil, err
  1534  	}
  1535  	c.urlParams_.Set("alt", alt)
  1536  	c.urlParams_.Set("prettyPrint", "false")
  1537  	urls := googleapi.ResolveRelative(c.s.BasePath, "games/v1configuration/leaderboards/{leaderboardId}")
  1538  	urls += "?" + c.urlParams_.Encode()
  1539  	req, err := http.NewRequest("PUT", urls, body)
  1540  	if err != nil {
  1541  		return nil, err
  1542  	}
  1543  	req.Header = reqHeaders
  1544  	googleapi.Expand(req.URL, map[string]string{
  1545  		"leaderboardId": c.leaderboardId,
  1546  	})
  1547  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1548  }
  1549  
  1550  // Do executes the "gamesConfiguration.leaderboardConfigurations.update" call.
  1551  // Any non-2xx status code is an error. Response headers are in either
  1552  // *LeaderboardConfiguration.ServerResponse.Header or (if a response was
  1553  // returned at all) in error.(*googleapi.Error).Header. Use
  1554  // googleapi.IsNotModified to check whether the returned error was because
  1555  // http.StatusNotModified was returned.
  1556  func (c *LeaderboardConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfiguration, error) {
  1557  	gensupport.SetOptions(c.urlParams_, opts...)
  1558  	res, err := c.doRequest("json")
  1559  	if res != nil && res.StatusCode == http.StatusNotModified {
  1560  		if res.Body != nil {
  1561  			res.Body.Close()
  1562  		}
  1563  		return nil, gensupport.WrapError(&googleapi.Error{
  1564  			Code:   res.StatusCode,
  1565  			Header: res.Header,
  1566  		})
  1567  	}
  1568  	if err != nil {
  1569  		return nil, err
  1570  	}
  1571  	defer googleapi.CloseBody(res)
  1572  	if err := googleapi.CheckResponse(res); err != nil {
  1573  		return nil, gensupport.WrapError(err)
  1574  	}
  1575  	ret := &LeaderboardConfiguration{
  1576  		ServerResponse: googleapi.ServerResponse{
  1577  			Header:         res.Header,
  1578  			HTTPStatusCode: res.StatusCode,
  1579  		},
  1580  	}
  1581  	target := &ret
  1582  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1583  		return nil, err
  1584  	}
  1585  	return ret, nil
  1586  }
  1587  

View as plain text