You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

3596 lines
122 KiB

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