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.
 
 
 

3464 lines
119 KiB

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